Package limn.scene.layout
Class Flex
java.lang.Object
limn.scene.Widget
limn.scene.layout.Flex
Simplified flexbox shared by
Column and Row: children flow
along the main axis with an optional gap; Expanded children
split the leftover main-axis space by flex weight; alignment controls the
distribution of leftovers (Flex.MainAlignment) and cross-axis placement
(Flex.CrossAlignment, including STRETCH).-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumCross-axis placement.static enumHow leftover space along the layout axis is distributed, on two vocabularies that coexist on purpose. -
Method Summary
Modifier and TypeMethodDescriptioncrossAlignment(Flex.CrossAlignment alignment) How children are placed across the layout axis;BASELINEis the one for a row that mixes size steps and carries text.gap(float newGap) Space between children, in logical points.protected final voidgapSilently(float newGap) Sets the gap without requesting a layout pass: the measure-path form, for a container that derives its gap from resolved size tokens inside its ownonMeasure.mainAlignment(Flex.MainAlignment alignment) How leftover space along the layout axis is distributed.protected voidonLayout()Containers position children here (measure +Widget.layoutBox(float, float, float, float)per child).protected SizeonMeasure(Constraints constraints) Reports the size this widget wants withinconstraints.Methods inherited from class limn.scene.Widget
acceptsTextInput, add, baselineOffset, baselineOffsetOf, caretRect, children, clipboard, clipsChildren, controlSize, cursor, declaredControlSize, declaredLayoutDirection, declaredLocale, focusArrivedByTraversal, height, hitTest, imageCursor, invalidate, invalidate, isEnabled, isFocusable, isFocused, isShowing, isVisible, layoutBox, layoutDirection, locale, localToSceneX, localToSceneY, markNeedsContainedLayout, markNeedsLayout, measure, moveChild, neutralBase, onAttached, onCharTyped, onDetached, onFileDrop, onFocusGained, onFocusLost, onKeyEvent, onMouseEvent, onPaint, onPaintOverlay, onPreedit, overlayPassesPointer, paintChildren, paintOutset, paintWidget, parent, remove, requestFocus, revealInView, scene, sceneToLocalX, sceneToLocalY, setControlSize, setCursor, setEnabled, setFocusable, setImageCursor, setInheritanceHost, setLayoutDirection, setLocale, setTooltip, setTooltip, setVisible, shapeText, textRuler, tooltip, width, x, y
-
Method Details
-
gap
Space between children, in logical points. Not applied before the first or after the last. -
gapSilently
protected final void gapSilently(float newGap) Sets the gap without requesting a layout pass: the measure-path form, for a container that derives its gap from resolved size tokens inside its ownonMeasure. Safe there and only there: the caller is already inside the pass that will consume the new value, so requesting another one is at best wasteful and at worst non-terminating. Everything else usesgap(float). -
mainAlignment
How leftover space along the layout axis is distributed. -
crossAlignment
How children are placed across the layout axis;BASELINEis the one for a row that mixes size steps and carries text. -
onMeasure
Description copied from class:WidgetReports the size this widget wants withinconstraints. Called once per layout pass, and the result is cached against the constraints and the resolved axes (size step, layout direction, locale), so it must be a pure function of them and of this widget's own state.Resolve the
ControlSizeand theLayoutDirectiononce each here and thread them down; never read either in a constructor. The locale needs no threading: it is in scope, andI18n.locale()answers it wherever text is resolved. -
onLayout
protected void onLayout()Description copied from class:WidgetContainers position children here (measure +Widget.layoutBox(float, float, float, float)per child).
-