Spec-Zone .ru
спецификации, руководства, описания, API
|
public class FlowPane extends Pane
Горизонталь flowpane (значение по умолчанию) будет узлы расположения в строках, переносящихся в width flowpane. Вертикаль flowpane размечает узлы в столбцах, переносящихся в height flowpane. Если у flowpane будут граница и/или дополнение набора, то контент будет течься в пределах тех вставок.
prefWrapLength свойство FlowPane устанавливает, оно предпочло width (для горизонтали) или предпочло height (для вертикали). Приложения должны установить prefWrapLength, если значение по умолчанию (400) не достаточно. Отметьте, что prefWrapLength используется только для того, чтобы вычислить привилегированный размер и, возможно, не отражает фактическую размерность обертывания, которая отслеживает фактический размер flowpane.
Свойство выравнивания управляет, как строки и столбцы выровненные в пределах границ flowpane и значений по умолчанию к На месте продажи. TOP_LEFT. Также возможно управлять выравниванием узлов в строках и столбцах, устанавливая rowValignment для горизонтали или columnHalignment для вертикали.
Пример горизонтали 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.
horizontal:
width | height | |
---|---|---|
minimum | left/right insets plus largest of children's pref widths | top/bottom insets plus height required to display all children \nat 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 \nat their pref heights when wrapped at a specified width |
maximum | Double.MAX_VALUE | Double.MAX_VALUE |
vertical:
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 childrens' bounds may extend outside its own bounds if a child's min size is larger than the space flowpane has to allocate for it.
Type | Property and Description |
---|---|
ObjectProperty<Pos> |
выравнивание
The overall alignment of the flowpane's content within its width and height.
|
ObjectProperty<HPos> |
columnHalignment
The horizontal alignment of nodes within each column of a vertical flowpane.
|
DoubleProperty |
hgap
The amount of horizontal space between each node in a horizontal flowpane or the space between columns in a vertical flowpane.
|
ObjectProperty<Orientation> |
ориентация
The orientation of this flowpane.
|
DoubleProperty |
prefWrapLength
The preferred width where content should wrap in a horizontal flowpane or the preferred height where content should wrap in a vertical flowpane.
|
ObjectProperty<VPos> |
rowValignment
The vertical alignment of nodes within each row of a horizontal flowpane.
|
DoubleProperty |
vgap
The amount of vertical space between each node in a vertical flowpane or the space between rows in a horizontal flowpane.
|
heightProperty, maxHeightProperty, maxWidthProperty, minHeightProperty, minWidthProperty, paddingProperty, prefHeightProperty, prefWidthProperty, snapToPixelProperty, widthProperty
needsLayoutProperty
blendModeProperty, boundsInLocalProperty, boundsInParentProperty, cacheHintProperty, cacheProperty, clipProperty, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectProperty, eventDispatcherProperty, focusedProperty, focusTraversableProperty, hoverProperty, idProperty, inputMethodRequestsProperty, layoutBoundsProperty, layoutXProperty, layoutYProperty, managedProperty, mouseTransparentProperty, onDragDetectedProperty, onDragDoneProperty, onDragDroppedProperty, onDragEnteredProperty, onDragExitedProperty, onDragOverProperty, onInputMethodTextChangedProperty, onKeyPressedProperty, onKeyReleasedProperty, onKeyTypedProperty, onMouseClickedProperty, onMouseDraggedProperty, onMouseEnteredProperty, onMouseExitedProperty, onMouseMovedProperty, onMousePressedProperty, onMouseReleasedProperty, onScrollProperty, opacityProperty, parentProperty, pickOnBoundsProperty, pressedProperty, rotateProperty, rotationAxisProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, styleProperty, translateXProperty, translateYProperty, translateZProperty, visibleProperty
USE_COMPUTED_SIZE, USE_PREF_SIZE
Constructor and Description |
---|
FlowPane()
Creates a horizontal FlowPane layout with hgap/vgap = 0.
|
FlowPane(double hgap, double 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.
|
Modifier and Type | Method and Description |
---|---|
ObjectProperty<Pos> |
alignmentProperty()
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.
|
ObjectProperty<HPos> |
columnHalignmentProperty()
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.
|
На месте продажи |
getAlignment()
The overall alignment of the flowpane's content within its width and height.
|
HPos |
getColumnHalignment()
The horizontal alignment of nodes within each column of a vertical flowpane.
|
Ориентация |
getContentBias()
Returns the orientation of a node's resizing bias for layout purposes.
|
double |
getHgap()
The amount of horizontal space between each node in a horizontal flowpane or the space between columns in a vertical flowpane.
|
static Insets |
getMargin(Node child)
Returns the child's margin constraint if set.
|
Ориентация |
getOrientation()
The orientation of this flowpane.
|
double |
getPrefWrapLength()
The preferred width where content should wrap in a horizontal flowpane or the preferred height where content should wrap in a vertical flowpane.
|
VPos |
getRowValignment()
The vertical alignment of nodes within each row of a horizontal flowpane.
|
double |
getVgap()
The amount of vertical space between each node in a vertical flowpane or the space between rows in a horizontal flowpane.
|
DoubleProperty |
hgapProperty()
The amount of horizontal space between each node in a horizontal flowpane or the space between columns in a vertical flowpane.
|
protected void |
layoutChildren()
Invoked during the layout pass to layout the children in this region.
|
ObjectProperty<Orientation> |
orientationProperty()
The orientation of this flowpane.
|
DoubleProperty |
prefWrapLengthProperty()
The preferred width where content should wrap in a horizontal flowpane or the preferred height where content should wrap in a vertical flowpane.
|
void |
requestLayout()
Requests a layout pass to be performed before the next scene is rendered.
|
ObjectProperty<VPos> |
rowValignmentProperty()
The vertical alignment of nodes within each row of a horizontal flowpane.
|
void |
setAlignment(Pos value)
The overall alignment of the flowpane's content within its width and height.
|
void |
setColumnHalignment(HPos value)
The horizontal alignment of nodes within each column of a vertical flowpane.
|
void |
setHgap(double value)
The amount of horizontal space between each node in a horizontal flowpane or the space between columns in a vertical flowpane.
|
static void |
setMargin(Node child, Insets value)
Sets the margin for the child when contained by a flowpane.
|
void |
setOrientation(Orientation value)
The orientation of this flowpane.
|
void |
setPrefWrapLength(double value)
The preferred width where content should wrap in a horizontal flowpane or the preferred height where content should wrap in a vertical flowpane.
|
void |
setRowValignment(VPos value)
The vertical alignment of nodes within each row of a horizontal flowpane.
|
void |
setVgap(double value)
The amount of vertical space between each node in a vertical flowpane or the space between rows in a horizontal flowpane.
|
DoubleProperty |
vgapProperty()
The amount of vertical space between each node in a vertical flowpane or the space between rows in a horizontal flowpane.
|
getChildren
computeMaxHeight, computeMaxWidth, getHeight, getInsets, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getPadding, getPrefHeight, getPrefWidth, getWidth, heightProperty, isResizable, isSnapToPixel, layoutInArea, layoutInArea, layoutInArea, maxHeight, maxHeightProperty, maxWidth, maxWidthProperty, minHeight, minHeightProperty, minWidth, minWidthProperty, paddingProperty, positionInArea, positionInArea, prefHeight, prefHeightProperty, prefWidth, prefWidthProperty, resize, setHeight, setMaxHeight, setMaxSize, setMaxWidth, setMinHeight, setMinSize, setMinWidth, setPadding, setPrefHeight, setPrefSize, setPrefWidth, setSnapToPixel, setWidth, snapPosition, snapSize, snapSpace, snapToPixelProperty, widthProperty
getBaselineOffset, getChildrenUnmodifiable, getManagedChildren, isNeedsLayout, layout, lookup, needsLayoutProperty, setNeedsLayout
addEventFilter, addEventHandler, autosize, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, contains, contains, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectProperty, eventDispatcherProperty, fireEvent, focusedProperty, focusTraversableProperty, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClip, getCursor, getDepthTest, getEffect, getEventDispatcher, getId, getInputMethodRequests, getLayoutBounds, getLayoutX, getLayoutY, getOnDragDetected, getOnDragDone, getOnDragDropped, getOnDragEntered, getOnDragExited, getOnDragOver, getOnInputMethodTextChanged, getOnKeyPressed, getOnKeyReleased, getOnKeyTyped, getOnMouseClicked, getOnMouseDragged, getOnMouseEntered, getOnMouseExited, getOnMouseMoved, getOnMousePressed, getOnMouseReleased, getOnScroll, getOpacity, getParent, getProperties, getRotate, getRotationAxis, getScaleX, getScaleY, getScaleZ, getScene, getStyle, getStyleClass, getTransforms, getTranslateX, getTranslateY, getTranslateZ, getUserData, hasProperties, hoverProperty, idProperty, inputMethodRequestsProperty, intersects, intersects, isCache, isDisable, isDisabled, isFocused, isFocusTraversable, isHover, isManaged, isMouseTransparent, isPickOnBounds, isPressed, isVisible, layoutBoundsProperty, layoutXProperty, layoutYProperty, localToParent, localToParent, localToParent, localToScene, localToScene, localToScene, lookupAll, managedProperty, mouseTransparentProperty, onDragDetectedProperty, onDragDoneProperty, onDragDroppedProperty, onDragEnteredProperty, onDragExitedProperty, onDragOverProperty, onInputMethodTextChangedProperty, onKeyPressedProperty, onKeyReleasedProperty, onKeyTypedProperty, onMouseClickedProperty, onMouseDraggedProperty, onMouseEnteredProperty, onMouseExitedProperty, onMouseMovedProperty, onMousePressedProperty, onMouseReleasedProperty, onScrollProperty, opacityProperty, parentProperty, parentToLocal, parentToLocal, parentToLocal, pickOnBoundsProperty, pressedProperty, relocate, removeEventFilter, removeEventHandler, requestFocus, resizeRelocate, rotateProperty, rotationAxisProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, sceneToLocal, sceneToLocal, sceneToLocal, setBlendMode, setCache, setCacheHint, setClip, setCursor, setDepthTest, setDisable, setDisabled, setEffect, setEventDispatcher, setEventHandler, setFocused, setFocusTraversable, setHover, setId, setInputMethodRequests, setLayoutX, setLayoutY, setManaged, setMouseTransparent, setOnDragDetected, setOnDragDone, setOnDragDropped, setOnDragEntered, setOnDragExited, setOnDragOver, setOnInputMethodTextChanged, setOnKeyPressed, setOnKeyReleased, setOnKeyTyped, setOnMouseClicked, setOnMouseDragged, setOnMouseEntered, setOnMouseExited, setOnMouseMoved, setOnMousePressed, setOnMouseReleased, setOnScroll, setOpacity, setPickOnBounds, setPressed, setRotate, setRotationAxis, setScaleX, setScaleY, setScaleZ, setStyle, setTranslateX, setTranslateY, setTranslateZ, setUserData, setVisible, startDragAndDrop, styleProperty, toBack, toFront, toString, translateXProperty, translateYProperty, translateZProperty, visibleProperty
getOrientation()
, setOrientation(Orientation)
getHgap()
, setHgap(double)
getVgap()
, setVgap(double)
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.
getPrefWrapLength()
, setPrefWrapLength(double)
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.
getAlignment()
, setAlignment(Pos)
getRowValignment()
, setRowValignment(VPos)
public FlowPane()
public FlowPane(Orientation orientation)
orientation
- the direction the tiles should flow & wrappublic FlowPane(double hgap, double vgap)
hgap
- the amount of horizontal space between each tilevgap
- the amount of vertical space between each tilepublic FlowPane(Orientation orientation, double hgap, double vgap)
orientation
- the direction the tiles should flow & wraphgap
- the amount of horizontal space between each tilevgap
- the amount of vertical space between each tilepublic static void setMargin(Node child, Insets value)
child
- the child node of a flowpanevalue
- the margin of space around the childpublic static Insets getMargin(Node child)
child
- the child node of a flowpanepublic static void clearConstraints(Node child)
child
- the child nodepublic final ObjectProperty<Orientation> orientationProperty()
getOrientation()
, setOrientation(Orientation)
public final void setOrientation(Orientation value)
public final Orientation getOrientation()
public final DoubleProperty hgapProperty()
getHgap()
, setHgap(double)
public final void setHgap(double value)
public final double getHgap()
public final DoubleProperty vgapProperty()
getVgap()
, setVgap(double)
public final void setVgap(double value)
public final double getVgap()
public final DoubleProperty prefWrapLengthProperty()
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.
getPrefWrapLength()
, setPrefWrapLength(double)
public final void setPrefWrapLength(double value)
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.
public final double getPrefWrapLength()
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.
public final ObjectProperty<Pos> alignmentProperty()
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.
getAlignment()
, setAlignment(Pos)
public final void setAlignment(Pos value)
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.
public final Pos getAlignment()
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.
public final ObjectProperty<HPos> columnHalignmentProperty()
public final void setColumnHalignment(HPos value)
public final HPos getColumnHalignment()
public final ObjectProperty<VPos> rowValignmentProperty()
getRowValignment()
, setRowValignment(VPos)
public final void setRowValignment(VPos value)
public final VPos getRowValignment()
public Orientation getContentBias()
Node
Resizable subclasses should override this method to return an appropriate value.
getContentBias
in class Node
Node.isResizable()
, Node.minWidth(double)
, Node.minHeight(double)
, Node.prefWidth(double)
, Node.prefHeight(double)
, Node.maxWidth(double)
, Node.maxHeight(double)
protected double computeMinWidth(double height)
Region
computeMinWidth
in class Region
protected double computeMinHeight(double width)
Region
computeMinHeight
in class Region
protected double computePrefWidth(double forHeight)
Region
computePrefWidth
in class Region
forHeight
- the height that should be used if preferred width depends on itprotected double computePrefHeight(double forWidth)
Region
computePrefHeight
in class Region
forWidth
- the width that should be used if preferred height depends on itpublic void requestLayout()
Parent
If this parent is either a layout root or unmanaged, then it will be added directly to the scene's dirty layout list, otherwise requestLayout will be invoked on its parent.
requestLayout
in class Parent
protected void layoutChildren()
Region
Subclasses should override this function to layout content as needed.
layoutChildren
in class Region
Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved. Use is subject to