FlexNode
class FlexNode
Extends: Node
Known subtypes: ReorderableFlexNode
Package: dev.joid.lib.ui.node.impl.layout · Module: core · Source: FlexNode.java
Places its visible children one after the other in a column or a row, and takes the size of its content.

Description
Section titled “Description”On the main axis, a size of 0 takes the size of the content; a declared size is a minimum without overflow, and a fixed size with an overflow.
The children keep their own position as an offset that moves the child alone, without pushing the next ones; an ABSOLUTE or hidden child is left out.
Learn more
Section titled “Learn more”Creation
Section titled “Creation”| Returns | Signature | Summary |
|---|---|---|
FlexNode | horizontal(double x, double y, double height) factory | Creates a row at x, y, height high, whose width follows its children. |
FlexNode | vertical(double x, double y, double width) factory | Creates a column at x, y, width wide, whose height follows its children. |
| FlexNode(double x, double y, double width, double height) protected | Called by a subclass to create a column. | |
| FlexNode(double x, double y, double width, double height, Axis direction) protected | Called by a subclass with the direction. |
Properties
Section titled “Properties”| Property | Type | Default | Summary |
|---|---|---|---|
| direction signal | Axis | set at creation | VERTICAL for a column, HORIZONTAL for a row. |
| align signal | Align | none, the children keep their own cross position | Where the children sit across the line: START, CENTER or END; null keeps their own cross position. |
| margin signal | double | 0D | Space between two children, in design pixels. |
Inherited from Node (24)
x · y · width · height · position · anchor · anchorX · anchorY · aspectRatio · zindex · zlevel · skeleton · visible · enabled · interactive · cursor · hoverDuration · hoverEquation · hover · overflow · scrollSpeed · scrollbar · label · draggable
Methods
Section titled “Methods”| Returns | Signature | Summary |
|---|---|---|
boolean | isLaidOut(Node child) protected | If true, the child takes part in the layout: it is visible and not ABSOLUTE. |
For subclasses
Section titled “For subclasses”| Returns | Signature | Summary |
|---|---|---|
void | init(UI ui) hook | Places the children when the node loads. |
void | update() hook | Places the children on every frame, after they have measured their size. |
void | layout() hook | Places the children again right before they are drawn. |
void | drawSkeleton(double mouseX, double mouseY) hook | Draws nothing while the flex node waits. |
List<Node> | getLayoutOrder() hook protected | The children in the order they are placed; a subclass overrides it to change the order. |
void | layoutChild(Node child, double offset) hook protected | Places a child at this offset along the main axis, and across it by align; a subclass overrides it to move a child. |
Inherited from Node (128)
load · render · renderHover · updateScroll · updateScrollX · updateScrollY · append · attach · body · clearChildren · getChild · getChildren · getNodeListAt · getParent · isAttached · getAbsoluteX · getAbsoluteY · getAbsoluteDefaultX · getAbsoluteDefaultY · toDrawX · toDrawY · w · h · dw · dh · mw · mh · aw · ah · ax · ay · getDefaultWidth · getDefaultHeight · removeHover · clearHover · refreshHover · getResolvedCursor · hoverValue · getHoverAnimator · isHovered · handleMousePressed · handleMouseReleased · handleMouseDragged · handleMouseScroll · handleCharTyped · handleKeyPressed · handleKeyReleased · getLastClickTime · getLastClickButton · getLastKey · getLastKeyTime · scrollX · scrollY · scrollTo · beforeScroll · hasOverflowX · hasOverflowY · getOverflowArea · getScrollX · getScrollY · getTargetScrollX · getTargetScrollY · getMaxScrollX · getMaxScrollY · isScrollEndX · isScrollEndY · startDragging · stopDragging · beforeDragStart · beforeDragDrop · isDragging · getDragX · getDragY · isDragged · getDragSource · getDraggedNode · getStartDragX · getStartDragY · getTargetDragX · getTargetDragY · effect · removeEffect · clearEffects · hasEffect · getEffect · layer · clearLayers · animate · removeAnimator · wait · watch · hasListener · isVisibleProperty · isMounted · getIndex · getUi · getHierarchy · getMappedIndex · getTaskList · getShortcutList · toJson · toString · getEventBus · getBodyConsumer · getDefaultX · getDefaultY · getLayoutX · getLayoutY · getShiftX · getShiftY · isStepping · getLastCodepoint · getLoadCount · getRenderTime · remove · self · copy · useStore · addTask · removeTask · addShortcut · removeShortcut · layoutPosition · layoutSize · fit · move · beforeMove · hoverColor
Events
Section titled “Events”Inherited from Node (21)
onUpdate · onDetach · onInit · onRender · onDraw · onMount · onHoverStart · onHover · onHoverEnd · onScroll · onScrollToEnd · onScrollEndReached · onDragStart · onDrag · onDragDrop · onDragSnap · onMove · onChildAppend · onClick · onAnimate · onWatch
Creation details
Section titled “Creation details”horizontal
Section titled “horizontal”FlexNode horizontal(double x, double y, double height) factory
Creates a row at x, y, height high, whose width follows its children.
vertical
Section titled “vertical”FlexNode vertical(double x, double y, double width) factory
Creates a column at x, y, width wide, whose height follows its children.
FlexNode
Section titled “FlexNode”FlexNode(double x, double y, double width, double height) protected
Called by a subclass to create a column.
FlexNode(double x, double y, double width, double height, Axis direction) protected
Called by a subclass with the direction.
Property details
Section titled “Property details”direction
Section titled “direction”this direction(Axis direction)fluentthis direction(Supplier<Axis> direction)fluent signalAxis getDirection()
Default: set at creation
VERTICAL for a column, HORIZONTAL for a row.
this align(Align align)fluentthis align(Supplier<Align> align)fluent signalAlign getAlign()
Default: none, the children keep their own cross position
Where the children sit across the line: START, CENTER or END; null keeps their own cross position.
margin
Section titled “margin”this margin(double margin)fluentthis margin(Supplier<Double> margin)fluent signaldouble getMargin()
Default: 0D
Space between two children, in design pixels.
Method details
Section titled “Method details”isLaidOut
Section titled “isLaidOut”boolean isLaidOut(Node child) protected
If true, the child takes part in the layout: it is visible and not ABSOLUTE.
void init(UI ui) hook
Places the children when the node loads.
update
Section titled “update”void update() hook
Places the children on every frame, after they have measured their size.
layout
Section titled “layout”void layout() hook
Places the children again right before they are drawn.
drawSkeleton
Section titled “drawSkeleton”void drawSkeleton(double mouseX, double mouseY) hook
Draws nothing while the flex node waits.
getLayoutOrder
Section titled “getLayoutOrder”List<Node> getLayoutOrder() hook protected
The children in the order they are placed; a subclass overrides it to change the order.
layoutChild
Section titled “layoutChild”void layoutChild(Node child, double offset) hook protected
Places a child at this offset along the main axis, and across it by align; a subclass overrides it to move a child.
fluent returns the instance, typed for chaining · factory creates an instance · signal also accepts a value that follows signals, as a signal, an expression or a lambda (When does JOID compute this value again?) · hook called by JOID, override it · abstract you implement it · default interface method with a body · static called on the class · protected visible to subclasses
