Class FlowPane
- All Implemented Interfaces:
LayoutMeasurable
,LayoutMeasurableMixin
,HasBackgroundProperty
,HasBlendModeProperty
,HasBorderProperty
,HasClipProperty
,HasEffectProperty
,HasHeightProperty
,HasLayoutXProperty
,HasLayoutYProperty
,HasManagedProperty
,HasMaxHeightProperty
,HasMaxWidthProperty
,HasMinHeightProperty
,HasMinWidthProperty
,HasMouseTransparentProperty
,HasOnMouseClickedProperty
,HasOpacityProperty
,HasPaddingProperty
,HasParentProperty
,HasPrefHeightProperty
,HasPrefWidthProperty
,HasSnapToPixelProperty
,HasVisibleProperty
,HasWidthProperty
,Styleable
,EventTarget
,INode
,PreferenceResizableNode
A horizontal flowpane (the default) will layout nodes in rows, wrapping at the flowpane's width. A vertical flowpane lays out nodes in columns, wrapping at the flowpane's height. If the flowpane has a border and/or padding set, the content will be flowed within those insets.
FlowPane's prefWrapLength property establishes its preferred width (for horizontal) or preferred height (for vertical). Applications should set prefWrapLength if the default value (400) doesn't suffice. Note that prefWrapLength is used only for calculating the preferred size and may not reflect the actual wrapping dimension, which tracks the actual size of the flowpane.
The alignment property controls how the rows and columns are aligned within the bounds of the flowpane and defaults to Pos.TOP_LEFT. It is also possible to control the alignment of nodes within the rows and columns by setting rowValignment for horizontal or columnHalignment for vertical.
Example of a horizontal flowpane:
Image images[] = { ... };
FlowPane flow = new FlowPane();
flow.setVgap(8);
flow.setHgap(4);
flow.setPrefWrapLength(300); // preferred width = 300
for (int i = 0; i < images.length; i++) {
flow.getChildren().add(new ImageView(image[i]);
}
Example of a vertical flowpane:
FlowPane flow = new FlowPane(Orientation.VERTICAL);
flow.setColumnHalignment(HPos.LEFT); // align labels on left
flow.setPrefWrapLength(200); // preferred height = 200
for (int i = 0; i < titles.size(); i++) {
flow.getChildren().add(new Label(titles[i]);
}
FlowPane lays out each managed child regardless of the child's visible property value; unmanaged children are ignored for all layout calculations.
FlowPane may be styled with backgrounds and borders using CSS. See
Region
superclass for details.
Resizable Range
A flowpane's parent will resize the flowpane within the flowpane's resizable range during layout. By default the flowpane computes this range based on its content as outlined in the tables below.
width | height | |
---|---|---|
minimum | left/right insets plus largest of children's pref widths | top/bottom insets plus height required to display all children at their preferred heights when wrapped at a specified width |
preferred | left/right insets plus prefWrapLength | top/bottom insets plus height required to display all children at their pref heights when wrapped at a specified width |
maximum | Double.MAX_VALUE | Double.MAX_VALUE |
width | height | |
---|---|---|
minimum | left/right insets plus width required to display all children at their preferred widths when wrapped at a specified height | top/bottom insets plus largest of children's pref heights |
preferred | left/right insets plus width required to display all children at their pref widths when wrapped at the specified height | top/bottom insets plus prefWrapLength |
maximum | Double.MAX_VALUE | Double.MAX_VALUE |
A flowpane's unbounded maximum width and height are an indication to the parent that it may be resized beyond its preferred size to fill whatever space is assigned to it.
FlowPane provides properties for setting the size range directly. These properties default to the sentinel value Region.USE_COMPUTED_SIZE, however the application may set them to other values as needed:
flowPane.setMaxWidth(500);
Applications may restore the computed values by setting these properties back
to Region.USE_COMPUTED_SIZE.
FlowPane does not clip its content by default, so it is possible that children's bounds may extend outside its own bounds if a child's pref size is larger than the space flowpane has to allocate for it.
- Since:
- JavaFX 2.0
-
Property Summary
TypePropertyDescriptionfinal ObjectProperty<Pos>
The overall alignment of the flowpane's content within its width and height.final ObjectProperty<HPos>
The horizontal alignment of nodes within each column of a vertical flowpane.final DoubleProperty
The amount of horizontal space between each node in a horizontal flowpane or the space between columns in a vertical flowpane.final ObjectProperty<Orientation>
The orientation of this flowpane.final DoubleProperty
The preferred width where content should wrap in a horizontal flowpane or the preferred height where content should wrap in a vertical flowpane.final ObjectProperty<VPos>
The vertical alignment of nodes within each row of a horizontal flowpane.final DoubleProperty
The amount of vertical space between each node in a vertical flowpane or the space between rows in a horizontal flowpane.Properties inherited from class javafx.scene.layout.Region
background, border, height, insets, maxHeight, maxWidth, minHeight, minWidth, padding, prefHeight, prefWidth, snapToPixel, width
Properties inherited from class javafx.scene.Parent
needsLayout
Properties inherited from class javafx.scene.Node
blendMode, cacheHint, cache, clip, cursor, disabled, disable, effect, eventDispatcher, focused, focusTraversable, hover, id, layoutBounds, layoutX, layoutY, managed, mouseTransparent, onContextMenuRequested, onDragDetected, onDragDone, onDragDropped, onDragEntered, onDragExited, onDragOver, onKeyPressed, onKeyReleased, onKeyTyped, onMouseClicked, onMouseDragged, onMouseEntered, onMouseExited, onMouseMoved, onMousePressed, onMouseReleased, onScroll, onSwipeDown, onSwipeLeft, onSwipeRight, onSwipeUp, onTouchMoved, onTouchPressed, onTouchReleased, onTouchStationary, opacity, parent, pressed, rotate, scaleX, scaleY, scaleZ, scene, style, translateX, translateY, visible
Properties inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasBlendModeProperty
blendMode
Properties inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasClipProperty
clip
Properties inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasEffectProperty
effect
Properties inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasLayoutXProperty
layoutX
Properties inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasLayoutYProperty
layoutY
Properties inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasManagedProperty
managed
Properties inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasMouseTransparentProperty
mouseTransparent
Properties inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasOnMouseClickedProperty
onMouseClicked
Properties inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasOpacityProperty
opacity
Properties inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasParentProperty
parent
Properties inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasVisibleProperty
visible
-
Field Summary
Fields inherited from interface javafx.scene.INode
BASELINE_OFFSET_SAME_AS_HEIGHT
Fields inherited from interface javafx.scene.layout.PreferenceResizableNode
USE_COMPUTED_SIZE, USE_PREF_SIZE
-
Constructor Summary
ConstructorDescriptionFlowPane()
Creates a horizontal FlowPane layout with hgap/vgap = 0.FlowPane
(double hgap, double vgap) Creates a horizontal FlowPane layout with the specified hgap/vgap.Creates a horizontal FlowPane layout with the specified hgap/vgap.FlowPane
(Orientation orientation) Creates a FlowPane layout with the specified orientation and hgap/vgap = 0.FlowPane
(Orientation orientation, double hgap, double vgap) Creates a FlowPane layout with the specified orientation and hgap/vgap.FlowPane
(Orientation orientation, double hgap, double vgap, Node... children) Creates a FlowPane layout with the specified orientation and hgap/vgap.FlowPane
(Orientation orientation, Node... children) Creates a FlowPane layout with the specified orientation and hgap/vgap = 0.Creates a horizontal FlowPane layout with hgap/vgap = 0. -
Method Summary
Modifier and TypeMethodDescriptionfinal ObjectProperty<Pos>
The overall alignment of the flowpane's content within its width and height.static void
clearConstraints
(Node child) Removes all flowpane constraints from the child node.final ObjectProperty<HPos>
The horizontal alignment of nodes within each column of a vertical flowpane.protected double
computeMinHeight
(double width) Computes the minimum height of this region.protected double
computeMinWidth
(double height) Computes the minimum width of this region.protected double
computePrefHeight
(double forWidth) Computes the preferred height of this region for the given width; Region subclasses should override this method to return an appropriate value based on their content and layout strategy.protected double
computePrefWidth
(double forHeight) Computes the preferred width of this region for the given height.final Pos
Gets the value of thealignment
property.final HPos
Gets the value of thecolumnHalignment
property.final double
getHgap()
Gets the value of thehgap
property.static Insets
Returns the child's margin constraint if set.final Orientation
Gets the value of theorientation
property.final double
Gets the value of theprefWrapLength
property.final VPos
Gets the value of therowValignment
property.final double
getVgap()
Gets the value of thevgap
property.final DoubleProperty
The amount of horizontal space between each node in a horizontal flowpane or the space between columns in a vertical flowpane.protected void
Invoked during the layout pass to layout the children in thisParent
.final ObjectProperty<Orientation>
The orientation of this flowpane.final DoubleProperty
The preferred width where content should wrap in a horizontal flowpane or the preferred height where content should wrap in a vertical flowpane.void
Requests a layout pass to be performed before the next scene is rendered.final ObjectProperty<VPos>
The vertical alignment of nodes within each row of a horizontal flowpane.final void
setAlignment
(Pos value) Sets the value of thealignment
property.final void
setColumnHalignment
(HPos value) Sets the value of thecolumnHalignment
property.final void
setHgap
(double value) Sets the value of thehgap
property.static void
Sets the margin for the child when contained by a flowpane.final void
setOrientation
(Orientation value) Sets the value of theorientation
property.final void
setPrefWrapLength
(double value) Sets the value of theprefWrapLength
property.final void
setRowValignment
(VPos value) Sets the value of therowValignment
property.final void
setVgap
(double value) Sets the value of thevgap
property.final DoubleProperty
The amount of vertical space between each node in a vertical flowpane or the space between rows in a horizontal flowpane.Methods inherited from class javafx.scene.layout.Region
backgroundProperty, borderProperty, boundedSize, computeMaxHeight, computeMaxWidth, getInsets, heightProperty, impl_computeGeomBounds, impl_computeLayoutBounds, impl_maxHeight, impl_maxWidth, impl_minHeight, impl_minWidth, impl_prefHeight, impl_prefWidth, insetsProperty, layoutInArea, layoutInArea, layoutInArea, layoutInArea, maxHeightProperty, maxWidthProperty, minHeightProperty, minWidthProperty, paddingProperty, positionInArea, positionInArea, prefHeightProperty, prefWidthProperty, resize, setMaxSize, setMinSize, setPrefSize, snappedBottomInset, snappedLeftInset, snappedRightInset, snappedTopInset, snapPosition, snapPositionX, snapPositionY, snapSize, snapSizeX, snapSizeY, snapSpace, snapSpaceX, snapSpaceY, snapToPixelProperty, widthProperty
Methods inherited from class javafx.scene.Parent
getBaselineOffset, getChildren, getChildrenUnmodifiable, getManagedChildren, isNeedsLayout, layout, needsLayoutProperty, requestParentLayout, setLayoutFlag, setNeedsLayout, setSceneRoot
Methods inherited from class javafx.scene.Node
addEventFilter, addEventHandler, autosize, blendModeProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, createLayoutMeasurable, cursorProperty, disabledProperty, disableProperty, effectProperty, eventDispatcherProperty, fireEvent, focusedProperty, focusTraversableProperty, getAllNodeTransforms, getBoundsInLocal, getCacheHint, getCursor, getEventDispatcher, getId, getLayoutMeasurable, getNodePeer, getOnContextMenuRequested, getOnDragDetected, getOnDragDone, getOnDragDropped, getOnDragEntered, getOnDragExited, getOnDragOver, getOnKeyPressed, getOnKeyReleased, getOnKeyTyped, getOnMouseDragged, getOnMouseEntered, getOnMouseExited, getOnMouseMoved, getOnMousePressed, getOnMouseReleased, getOnScroll, getOnSwipeDown, getOnSwipeLeft, getOnSwipeRight, getOnSwipeUp, getOnTouchMoved, getOnTouchPressed, getOnTouchReleased, getOnTouchStationary, getOrCreateAndBindNodePeer, getProperties, getRotate, getScaleX, getScaleY, getScaleZ, getScene, getStyle, getStyleClass, getTransforms, getTranslateX, getTranslateY, getUserData, hasProperties, hoverProperty, idProperty, impl_getLayoutBounds, impl_isTreeVisible, impl_traverse, isCache, isDisable, isDisabled, isFocused, isFocusTraversable, isHover, isPressed, layoutBoundsProperty, layoutXProperty, layoutYProperty, localToParent, localToParent, localToParent, localToScene, localToScene, localToScreen, localToScreen, localToScreen, localToScreen, managedProperty, mouseTransparentProperty, onContextMenuRequestedProperty, onDragDetectedProperty, onDragDoneProperty, onDragDroppedProperty, onDragEnteredProperty, onDragExitedProperty, onDragOverProperty, onKeyPressedProperty, onKeyReleasedProperty, onKeyTypedProperty, onMouseClickedProperty, onMouseDraggedProperty, onMouseEnteredProperty, onMouseExitedProperty, onMouseMovedProperty, onMousePressedProperty, onMouseReleasedProperty, onNodePeerReady, onPeerSizeChanged, onScrollProperty, onSwipeDownProperty, onSwipeLeftProperty, onSwipeRightProperty, onSwipeUpProperty, onTouchMovedProperty, onTouchPressedProperty, onTouchReleasedProperty, onTouchStationaryProperty, opacityProperty, parentProperty, parentToLocal, pressedProperty, removeEventFilter, removeEventHandler, requestFocus, requestPeerFocus, rotateProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, sceneToLocal, sceneToLocal, sceneToLocal, setCache, setCacheHint, setCursor, setDisable, setDisabled, setEventDispatcher, setEventHandler, setFocused, setFocusTraversable, setHover, setId, setNodePeer, setOnContextMenuRequested, setOnDragDetected, setOnDragDone, setOnDragDropped, setOnDragEntered, setOnDragExited, setOnDragOver, setOnKeyPressed, setOnKeyReleased, setOnKeyTyped, setOnMouseDragged, setOnMouseEntered, setOnMouseExited, setOnMouseMoved, setOnMousePressed, setOnMouseReleased, setOnScroll, setOnSwipeDown, setOnSwipeLeft, setOnSwipeRight, setOnSwipeUp, setOnTouchMoved, setOnTouchPressed, setOnTouchReleased, setOnTouchStationary, setPressed, setRotate, setScaleX, setScaleY, setScaleZ, setScene, setStyle, setTranslateX, setTranslateY, setUserData, shouldUseLayoutMeasurable, snapshot, startDragAndDrop, styleProperty, toBack, toFront, translateXProperty, translateYProperty, visibleProperty
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasBackgroundProperty
getBackground, setBackground
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasBlendModeProperty
blendModeProperty, getBlendMode, setBlendMode
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasBorderProperty
getBorder, setBorder
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasClipProperty
clipProperty, getClip, setClip
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasEffectProperty
effectProperty, getEffect, setEffect
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasHeightProperty
getHeight, setHeight
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasLayoutXProperty
getLayoutX, layoutXProperty, setLayoutX
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasLayoutYProperty
getLayoutY, layoutYProperty, setLayoutY
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasManagedProperty
isManaged, managedProperty, setManaged
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasMaxHeightProperty
getMaxHeight, setMaxHeight
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasMaxWidthProperty
getMaxWidth, setMaxWidth
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasMinHeightProperty
getMinHeight, setMinHeight
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasMinWidthProperty
getMinWidth, setMinWidth
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasMouseTransparentProperty
isMouseTransparent, mouseTransparentProperty, setMouseTransparent
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasOnMouseClickedProperty
getOnMouseClicked, onMouseClickedProperty, setOnMouseClicked
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasOpacityProperty
getOpacity, opacityProperty, setOpacity
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasPaddingProperty
getPadding, setPadding
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasParentProperty
getParent, parentProperty, setParent
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasPrefHeightProperty
getPrefHeight, setPrefHeight
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasPrefWidthProperty
getPrefWidth, setPrefWidth
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasSnapToPixelProperty
isSnapToPixel, setSnapToPixel
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasVisibleProperty
isVisible, setVisible, visibleProperty
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasWidthProperty
getWidth, setWidth
Methods inherited from interface javafx.scene.INode
autosize, getAllNodeTransforms, getBaselineOffset, getNodePeer, getOrCreateAndBindNodePeer, getProperties, getScene, getTransforms, hasProperties, relocate, resizeRelocate
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.emul_coupling.LayoutMeasurableMixin
clearCache, getLayoutBounds, getLayoutMeasurable, maxHeight, maxWidth, minHeight, minWidth, prefHeight, prefWidth
Methods inherited from interface javafx.scene.layout.PreferenceResizableNode
isResizable
-
Property Details
-
orientation
The orientation of this flowpane. A horizontal flowpane lays out children left to right, wrapping at the flowpane's width boundary. A vertical flowpane lays out children top to bottom, wrapping at the flowpane's height. The default is horizontal. -
hgap
The amount of horizontal space between each node in a horizontal flowpane or the space between columns in a vertical flowpane.- See Also:
-
vgap
The amount of vertical space between each node in a vertical flowpane or the space between rows in a horizontal flowpane.- See Also:
-
prefWrapLength
The preferred width where content should wrap in a horizontal flowpane or the preferred height where content should wrap in a vertical flowpane.This value is used only to compute the preferred size of the flowpane and may not reflect the actual width or height, which may change if the flowpane is resized to something other than its preferred size.
Applications should initialize this value to define a reasonable span for wrapping the content.
-
alignment
The overall alignment of the flowpane's content within its width and height.For a horizontal flowpane, each row will be aligned within the flowpane's width using the alignment's hpos value, and the rows will be aligned within the flowpane's height using the alignment's vpos value.
For a vertical flowpane, each column will be aligned within the flowpane's height using the alignment's vpos value, and the columns will be aligned within the flowpane's width using the alignment's hpos value.
-
columnHalignment
The horizontal alignment of nodes within each column of a vertical flowpane. The property is ignored for horizontal flowpanes. -
rowValignment
The vertical alignment of nodes within each row of a horizontal flowpane. If this property is set to VPos.BASELINE, then the flowpane will always resize children to their preferred heights, rather than expanding heights to fill the row height. The property is ignored for vertical flowpanes.
-
-
Constructor Details
-
FlowPane
public FlowPane()Creates a horizontal FlowPane layout with hgap/vgap = 0. -
FlowPane
Creates a FlowPane layout with the specified orientation and hgap/vgap = 0.- Parameters:
orientation
- the direction the tiles should flow & wrap
-
FlowPane
public FlowPane(double hgap, double vgap) Creates a horizontal FlowPane layout with the specified hgap/vgap.- Parameters:
hgap
- the amount of horizontal space between each tilevgap
- the amount of vertical space between each tile
-
FlowPane
Creates a FlowPane layout with the specified orientation and hgap/vgap.- Parameters:
orientation
- the direction the tiles should flow & wraphgap
- the amount of horizontal space between each tilevgap
- the amount of vertical space between each tile
-
FlowPane
Creates a horizontal FlowPane layout with hgap/vgap = 0.- Parameters:
children
- The initial set of children for this pane.- Since:
- JavaFX 8.0
-
FlowPane
Creates a FlowPane layout with the specified orientation and hgap/vgap = 0.- Parameters:
orientation
- the direction the tiles should flow & wrapchildren
- The initial set of children for this pane.- Since:
- JavaFX 8.0
-
FlowPane
Creates a horizontal FlowPane layout with the specified hgap/vgap.- Parameters:
hgap
- the amount of horizontal space between each tilevgap
- the amount of vertical space between each tilechildren
- The initial set of children for this pane.- Since:
- JavaFX 8.0
-
FlowPane
Creates a FlowPane layout with the specified orientation and hgap/vgap.- Parameters:
orientation
- the direction the tiles should flow & wraphgap
- the amount of horizontal space between each tilevgap
- the amount of vertical space between each tilechildren
- The initial set of children for this pane.- Since:
- JavaFX 8.0
-
-
Method Details
-
setMargin
Sets the margin for the child when contained by a flowpane. If set, the flowpane will layout it out with the margin space around it. Setting the value to null will remove the constraint.- Parameters:
child
- the child node of a flowpanevalue
- the margin of space around the child
-
getMargin
Returns the child's margin constraint if set.- Parameters:
child
- the child node of a flowpane- Returns:
- the margin for the child or null if no margin was set
-
clearConstraints
Removes all flowpane constraints from the child node.- Parameters:
child
- the child node
-
orientationProperty
The orientation of this flowpane. A horizontal flowpane lays out children left to right, wrapping at the flowpane's width boundary. A vertical flowpane lays out children top to bottom, wrapping at the flowpane's height. The default is horizontal.- Returns:
- the orientation of this flowpane
- See Also:
-
setOrientation
Sets the value of theorientation
property.- Property description:
- The orientation of this flowpane. A horizontal flowpane lays out children left to right, wrapping at the flowpane's width boundary. A vertical flowpane lays out children top to bottom, wrapping at the flowpane's height. The default is horizontal.
- Parameters:
value
- the value for theorientation
property- See Also:
-
getOrientation
Gets the value of theorientation
property.- Property description:
- The orientation of this flowpane. A horizontal flowpane lays out children left to right, wrapping at the flowpane's width boundary. A vertical flowpane lays out children top to bottom, wrapping at the flowpane's height. The default is horizontal.
- Returns:
- the value of the
orientation
property - See Also:
-
hgapProperty
The amount of horizontal space between each node in a horizontal flowpane or the space between columns in a vertical flowpane.- Returns:
- the amount of horizontal space between each node in a horizontal flowpane or the space between columns in a vertical flowpane
- See Also:
-
setHgap
public final void setHgap(double value) Sets the value of thehgap
property.- Property description:
- The amount of horizontal space between each node in a horizontal flowpane or the space between columns in a vertical flowpane.
- Parameters:
value
- the value for thehgap
property- See Also:
-
getHgap
public final double getHgap()Gets the value of thehgap
property.- Property description:
- The amount of horizontal space between each node in a horizontal flowpane or the space between columns in a vertical flowpane.
- Returns:
- the value of the
hgap
property - See Also:
-
vgapProperty
The amount of vertical space between each node in a vertical flowpane or the space between rows in a horizontal flowpane.- Returns:
- the amount of vertical space between each node in a vertical flowpane or the space between rows in a horizontal flowpane
- See Also:
-
setVgap
public final void setVgap(double value) Sets the value of thevgap
property.- Property description:
- The amount of vertical space between each node in a vertical flowpane or the space between rows in a horizontal flowpane.
- Parameters:
value
- the value for thevgap
property- See Also:
-
getVgap
public final double getVgap()Gets the value of thevgap
property.- Property description:
- The amount of vertical space between each node in a vertical flowpane or the space between rows in a horizontal flowpane.
- Returns:
- the value of the
vgap
property - See Also:
-
prefWrapLengthProperty
The preferred width where content should wrap in a horizontal flowpane or the preferred height where content should wrap in a vertical flowpane.This value is used only to compute the preferred size of the flowpane and may not reflect the actual width or height, which may change if the flowpane is resized to something other than its preferred size.
Applications should initialize this value to define a reasonable span for wrapping the content.
- Returns:
- the preferred width where content should wrap in a horizontal flowpane or the preferred height where content should wrap in a vertical flowpane
- See Also:
-
setPrefWrapLength
public final void setPrefWrapLength(double value) Sets the value of theprefWrapLength
property.- Property description:
- The preferred width where content should wrap in a horizontal flowpane or
the preferred height where content should wrap in a vertical flowpane.
This value is used only to compute the preferred size of the flowpane and may not reflect the actual width or height, which may change if the flowpane is resized to something other than its preferred size.
Applications should initialize this value to define a reasonable span for wrapping the content.
- Parameters:
value
- the value for theprefWrapLength
property- See Also:
-
getPrefWrapLength
public final double getPrefWrapLength()Gets the value of theprefWrapLength
property.- Property description:
- The preferred width where content should wrap in a horizontal flowpane or
the preferred height where content should wrap in a vertical flowpane.
This value is used only to compute the preferred size of the flowpane and may not reflect the actual width or height, which may change if the flowpane is resized to something other than its preferred size.
Applications should initialize this value to define a reasonable span for wrapping the content.
- Returns:
- the value of the
prefWrapLength
property - See Also:
-
alignmentProperty
The overall alignment of the flowpane's content within its width and height.For a horizontal flowpane, each row will be aligned within the flowpane's width using the alignment's hpos value, and the rows will be aligned within the flowpane's height using the alignment's vpos value.
For a vertical flowpane, each column will be aligned within the flowpane's height using the alignment's vpos value, and the columns will be aligned within the flowpane's width using the alignment's hpos value.
- Returns:
- the overall alignment of the flowpane's content within its width and height
- See Also:
-
setAlignment
Sets the value of thealignment
property.- Property description:
- The overall alignment of the flowpane's content within its width and height.
For a horizontal flowpane, each row will be aligned within the flowpane's width using the alignment's hpos value, and the rows will be aligned within the flowpane's height using the alignment's vpos value.
For a vertical flowpane, each column will be aligned within the flowpane's height using the alignment's vpos value, and the columns will be aligned within the flowpane's width using the alignment's hpos value.
- Parameters:
value
- the value for thealignment
property- See Also:
-
getAlignment
Gets the value of thealignment
property.- Property description:
- The overall alignment of the flowpane's content within its width and height.
For a horizontal flowpane, each row will be aligned within the flowpane's width using the alignment's hpos value, and the rows will be aligned within the flowpane's height using the alignment's vpos value.
For a vertical flowpane, each column will be aligned within the flowpane's height using the alignment's vpos value, and the columns will be aligned within the flowpane's width using the alignment's hpos value.
- Returns:
- the value of the
alignment
property - See Also:
-
columnHalignmentProperty
The horizontal alignment of nodes within each column of a vertical flowpane. The property is ignored for horizontal flowpanes.- Returns:
- the horizontal alignment of nodes within each column of a vertical flowpane
- See Also:
-
setColumnHalignment
Sets the value of thecolumnHalignment
property.- Property description:
- The horizontal alignment of nodes within each column of a vertical flowpane. The property is ignored for horizontal flowpanes.
- Parameters:
value
- the value for thecolumnHalignment
property- See Also:
-
getColumnHalignment
Gets the value of thecolumnHalignment
property.- Property description:
- The horizontal alignment of nodes within each column of a vertical flowpane. The property is ignored for horizontal flowpanes.
- Returns:
- the value of the
columnHalignment
property - See Also:
-
rowValignmentProperty
The vertical alignment of nodes within each row of a horizontal flowpane. If this property is set to VPos.BASELINE, then the flowpane will always resize children to their preferred heights, rather than expanding heights to fill the row height. The property is ignored for vertical flowpanes.- Returns:
- the vertical alignment of nodes within each row of a horizontal flowpane
- See Also:
-
setRowValignment
Sets the value of therowValignment
property.- Property description:
- The vertical alignment of nodes within each row of a horizontal flowpane. If this property is set to VPos.BASELINE, then the flowpane will always resize children to their preferred heights, rather than expanding heights to fill the row height. The property is ignored for vertical flowpanes.
- Parameters:
value
- the value for therowValignment
property- See Also:
-
getRowValignment
Gets the value of therowValignment
property.- Property description:
- The vertical alignment of nodes within each row of a horizontal flowpane. If this property is set to VPos.BASELINE, then the flowpane will always resize children to their preferred heights, rather than expanding heights to fill the row height. The property is ignored for vertical flowpanes.
- Returns:
- the value of the
rowValignment
property - See Also:
-
getContentBias
-
computeMinWidth
protected double computeMinWidth(double height) Description copied from class:Region
Computes the minimum width of this region. Returns the sum of the left and right insets by default. region subclasses should override this method to return an appropriate value based on their content and layout strategy. If the subclass doesn't have a VERTICAL content bias, then the height parameter can be ignored.- Overrides:
computeMinWidth
in classRegion
- Parameters:
height
- the height that should be used if min width depends on it- Returns:
- the computed minimum width of this region
-
computeMinHeight
protected double computeMinHeight(double width) Description copied from class:Region
Computes the minimum height of this region. Returns the sum of the top and bottom insets by default. Region subclasses should override this method to return an appropriate value based on their content and layout strategy. If the subclass doesn't have a HORIZONTAL content bias, then the width parameter can be ignored.- Overrides:
computeMinHeight
in classRegion
- Parameters:
width
- the width that should be used if min height depends on it- Returns:
- the computed minimum height for this region
-
computePrefWidth
protected double computePrefWidth(double forHeight) Description copied from class:Region
Computes the preferred width of this region for the given height. Region subclasses should override this method to return an appropriate value based on their content and layout strategy. If the subclass doesn't have a VERTICAL content bias, then the height parameter can be ignored.- Overrides:
computePrefWidth
in classRegion
- Parameters:
forHeight
- the height that should be used if preferred width depends on it- Returns:
- the computed preferred width for this region
-
computePrefHeight
protected double computePrefHeight(double forWidth) Description copied from class:Region
Computes the preferred height of this region for the given width; Region subclasses should override this method to return an appropriate value based on their content and layout strategy. If the subclass doesn't have a HORIZONTAL content bias, then the width parameter can be ignored.- Overrides:
computePrefHeight
in classRegion
- Parameters:
forWidth
- the width that should be used if preferred height depends on it- Returns:
- the computed preferred height for this region
-
requestLayout
public void requestLayout()Description copied from class:Parent
Requests a layout pass to be performed before the next scene is rendered. This is batched up asynchronously to happen once per "pulse", or frame of animation.If this parent is either a layout root or unmanaged, then it will be added directly to the scene's dirty layout list, otherwise requestParentLayout will be invoked.
- Overrides:
requestLayout
in classParent
-
layoutChildren
protected void layoutChildren()Description copied from class:Parent
Invoked during the layout pass to layout the children in thisParent
. By default it will only set the size of managed, resizable content to their preferred sizes and does not do any node positioning.Subclasses should override this function to layout content as needed.
- Overrides:
layoutChildren
in classParent
-