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 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 |
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 pref 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.
|
background, border, cacheShape, centerShape, height, insets, maxHeight, maxWidth, minHeight, minWidth, opaqueInsets, padding, prefHeight, prefWidth, scaleShape, shape, snapToPixel, width
needsLayout
blendMode, boundsInLocal, boundsInParent, cacheHint, cache, clip, cursor, depthTest, disabled, disable, effectiveNodeOrientation, effect, eventDispatcher, focused, focusTraversable, hover, id, inputMethodRequests, layoutBounds, layoutX, layoutY, localToParentTransform, localToSceneTransform, managed, mouseTransparent, nodeOrientation, onContextMenuRequested, onDragDetected, onDragDone, onDragDropped, onDragEntered, onDragExited, onDragOver, onInputMethodTextChanged, onKeyPressed, onKeyReleased, onKeyTyped, onMouseClicked, onMouseDragEntered, onMouseDragExited, onMouseDragged, onMouseDragOver, onMouseDragReleased, onMouseEntered, onMouseExited, onMouseMoved, onMousePressed, onMouseReleased, onRotate, onRotationFinished, onRotationStarted, onScrollFinished, onScroll, onScrollStarted, onSwipeDown, onSwipeLeft, onSwipeRight, onSwipeUp, onTouchMoved, onTouchPressed, onTouchReleased, onTouchStationary, onZoomFinished, onZoom, onZoomStarted, opacity, parent, pickOnBounds, pressed, rotate, rotationAxis, scaleX, scaleY, scaleZ, scene, style, translateX, translateY, translateZ, visible
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(double hgap, double vgap, Node... children)
Creates a horizontal FlowPane layout with the specified hgap/vgap.
|
FlowPane(Node... children)
Creates a horizontal FlowPane layout with hgap/vgap = 0.
|
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.
|
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()
Gets the value of the property alignment.
|
static java.util.List<CssMetaData<? extends Styleable,?>> |
getClassCssMetaData() |
HPos |
getColumnHalignment()
Gets the value of the property columnHalignment.
|
Ориентация |
getContentBias()
Returns the orientation of a node's resizing bias for layout purposes.
|
java.util.List<CssMetaData<? extends Styleable,?>> |
getCssMetaData()
This method should delegate to
Node.getClassCssMetaData() so that a Node's CssMetaData can be accessed without the need for reflection. |
double |
getHgap()
Gets the value of the property hgap.
|
static Insets |
getMargin(Node child)
Returns the child's margin constraint if set.
|
Ориентация |
getOrientation()
Gets the value of the property orientation.
|
double |
getPrefWrapLength()
Gets the value of the property prefWrapLength.
|
VPos |
getRowValignment()
Gets the value of the property rowValignment.
|
double |
getVgap()
Gets the value of the property vgap.
|
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
Parent . |
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)
Sets the value of the property alignment.
|
void |
setColumnHalignment(HPos value)
Sets the value of the property columnHalignment.
|
void |
setHgap(double value)
Sets the value of the property hgap.
|
static void |
setMargin(Node child, Insets value)
Sets the margin for the child when contained by a flowpane.
|
void |
setOrientation(Orientation value)
Sets the value of the property orientation.
|
void |
setPrefWrapLength(double value)
Sets the value of the property prefWrapLength.
|
void |
setRowValignment(VPos value)
Sets the value of the property rowValignment.
|
void |
setVgap(double value)
Sets the value of the property vgap.
|
DoubleProperty |
vgapProperty()
The amount of vertical space between each node in a vertical flowpane or the space between rows in a horizontal flowpane.
|
getChildren
backgroundProperty, borderProperty, cacheShapeProperty, centerShapeProperty, computeMaxHeight, computeMaxWidth, getBackground, getBorder, getHeight, getInsets, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOpaqueInsets, getPadding, getPrefHeight, getPrefWidth, getShape, getWidth, heightProperty, insetsProperty, isCacheShape, isCenterShape, isResizable, isScaleShape, isSnapToPixel, layoutInArea, layoutInArea, layoutInArea, layoutInArea, maxHeight, maxHeightProperty, maxWidth, maxWidthProperty, minHeight, minHeightProperty, minWidth, minWidthProperty, opaqueInsetsProperty, paddingProperty, positionInArea, positionInArea, prefHeight, prefHeightProperty, prefWidth, prefWidthProperty, resize, scaleShapeProperty, setBackground, setBorder, setCacheShape, setCenterShape, setHeight, setMaxHeight, setMaxSize, setMaxWidth, setMinHeight, setMinSize, setMinWidth, setOpaqueInsets, setPadding, setPrefHeight, setPrefSize, setPrefWidth, setScaleShape, setShape, setSnapToPixel, setWidth, shapeProperty, snappedBottomInset, snappedLeftInset, snappedRightInset, snappedTopInset, snapPosition, snapSize, snapSpace, snapToPixelProperty, widthProperty
getBaselineOffset, getChildrenUnmodifiable, getManagedChildren, getStylesheets, isNeedsLayout, layout, lookup, needsLayoutProperty, setNeedsLayout
addEventFilter, addEventHandler, autosize, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, computeAreaInScreen, contains, contains, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectiveNodeOrientationProperty, effectProperty, eventDispatcherProperty, fireEvent, focusedProperty, focusTraversableProperty, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClip, getCursor, getDepthTest, getEffect, getEffectiveNodeOrientation, getEventDispatcher, getId, getInputMethodRequests, getLayoutBounds, getLayoutX, getLayoutY, getLocalToParentTransform, getLocalToSceneTransform, getNodeOrientation, getOnContextMenuRequested, getOnDragDetected, getOnDragDone, getOnDragDropped, getOnDragEntered, getOnDragExited, getOnDragOver, getOnInputMethodTextChanged, getOnKeyPressed, getOnKeyReleased, getOnKeyTyped, getOnMouseClicked, getOnMouseDragEntered, getOnMouseDragExited, getOnMouseDragged, getOnMouseDragOver, getOnMouseDragReleased, getOnMouseEntered, getOnMouseExited, getOnMouseMoved, getOnMousePressed, getOnMouseReleased, getOnRotate, getOnRotationFinished, getOnRotationStarted, getOnScroll, getOnScrollFinished, getOnScrollStarted, getOnSwipeDown, getOnSwipeLeft, getOnSwipeRight, getOnSwipeUp, getOnTouchMoved, getOnTouchPressed, getOnTouchReleased, getOnTouchStationary, getOnZoom, getOnZoomFinished, getOnZoomStarted, getOpacity, getParent, getProperties, getPseudoClassStates, getRotate, getRotationAxis, getScaleX, getScaleY, getScaleZ, getScene, getStyle, getStyleableParent, getStyleClass, getTransforms, getTranslateX, getTranslateY, getTranslateZ, getTypeSelector, getUserData, hasProperties, hoverProperty, idProperty, inputMethodRequestsProperty, intersects, intersects, isCache, isDisable, isDisabled, isFocused, isFocusTraversable, isHover, isManaged, isMouseTransparent, isPickOnBounds, isPressed, isVisible, layoutBoundsProperty, layoutXProperty, layoutYProperty, localToParent, localToParent, localToParent, localToParent, localToParent, localToParentTransformProperty, localToScene, localToScene, localToScene, localToScene, localToScene, localToSceneTransformProperty, localToScreen, localToScreen, localToScreen, localToScreen, localToScreen, lookupAll, managedProperty, mouseTransparentProperty, nodeOrientationProperty, onContextMenuRequestedProperty, onDragDetectedProperty, onDragDoneProperty, onDragDroppedProperty, onDragEnteredProperty, onDragExitedProperty, onDragOverProperty, onInputMethodTextChangedProperty, onKeyPressedProperty, onKeyReleasedProperty, onKeyTypedProperty, onMouseClickedProperty, onMouseDragEnteredProperty, onMouseDragExitedProperty, onMouseDraggedProperty, onMouseDragOverProperty, onMouseDragReleasedProperty, onMouseEnteredProperty, onMouseExitedProperty, onMouseMovedProperty, onMousePressedProperty, onMouseReleasedProperty, onRotateProperty, onRotationFinishedProperty, onRotationStartedProperty, onScrollFinishedProperty, onScrollProperty, onScrollStartedProperty, onSwipeDownProperty, onSwipeLeftProperty, onSwipeRightProperty, onSwipeUpProperty, onTouchMovedProperty, onTouchPressedProperty, onTouchReleasedProperty, onTouchStationaryProperty, onZoomFinishedProperty, onZoomProperty, onZoomStartedProperty, opacityProperty, parentProperty, parentToLocal, parentToLocal, parentToLocal, parentToLocal, parentToLocal, pickOnBoundsProperty, pressedProperty, pseudoClassStateChanged, relocate, removeEventFilter, removeEventHandler, requestFocus, resizeRelocate, rotateProperty, rotationAxisProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, screenToLocal, screenToLocal, screenToLocal, setBlendMode, setCache, setCacheHint, setClip, setCursor, setDepthTest, setDisable, setDisabled, setEffect, setEventDispatcher, setEventHandler, setFocused, setFocusTraversable, setHover, setId, setInputMethodRequests, setLayoutX, setLayoutY, setManaged, setMouseTransparent, setNodeOrientation, setOnContextMenuRequested, setOnDragDetected, setOnDragDone, setOnDragDropped, setOnDragEntered, setOnDragExited, setOnDragOver, setOnInputMethodTextChanged, setOnKeyPressed, setOnKeyReleased, setOnKeyTyped, setOnMouseClicked, setOnMouseDragEntered, setOnMouseDragExited, setOnMouseDragged, setOnMouseDragOver, setOnMouseDragReleased, setOnMouseEntered, setOnMouseExited, setOnMouseMoved, setOnMousePressed, setOnMouseReleased, setOnRotate, setOnRotationFinished, setOnRotationStarted, setOnScroll, setOnScrollFinished, setOnScrollStarted, setOnSwipeDown, setOnSwipeLeft, setOnSwipeRight, setOnSwipeUp, setOnTouchMoved, setOnTouchPressed, setOnTouchReleased, setOnTouchStationary, setOnZoom, setOnZoomFinished, setOnZoomStarted, setOpacity, setPickOnBounds, setPressed, setRotate, setRotationAxis, setScaleX, setScaleY, setScaleZ, setStyle, setTranslateX, setTranslateY, setTranslateZ, setUserData, setVisible, snapshot, snapshot, startDragAndDrop, startFullDrag, styleProperty, toBack, toFront, toString, translateXProperty, translateYProperty, translateZProperty, usesMirroring, visibleProperty
public final ObjectProperty<Ориентация> orientationProperty
getOrientation()
, setOrientation(Orientation)
public final DoubleProperty hgapProperty
getHgap()
, setHgap(double)
public final DoubleProperty vgapProperty
getVgap()
, setVgap(double)
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 ObjectProperty<На месте продажи> 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 ObjectProperty<HPos> columnHalignmentProperty
getColumnHalignment()
, setColumnHalignment(HPos)
public final ObjectProperty<VPos> rowValignmentProperty
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 FlowPane(Node... children)
children
- The initial set of children for this pane.public FlowPane(Orientation orientation, Node... children)
orientation
- the direction the tiles should flow & wrapchildren
- The initial set of children for this pane.public FlowPane(double hgap, double vgap, Node... children)
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.public FlowPane(Orientation orientation, double hgap, double vgap, Node... children)
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.public static void setMargin(Node child, Insets value)
child
- the child node of a flowpanevalue
- the margin of space around the childpublic static Вставки getMargin(Node child)
child
- the child node of a flowpanepublic static void clearConstraints(Node child)
child
- the child nodepublic final ObjectProperty<Ориентация> orientationProperty()
getOrientation()
, setOrientation(Orientation)
public final void setOrientation(Orientation value)
public final Ориентация 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<На месте продажи> 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 На месте продажи 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()
getColumnHalignment()
, setColumnHalignment(HPos)
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 Ориентация 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
height
- the height that should be used if min width depends on itprotected double computeMinHeight(double width)
Region
computeMinHeight
in class Region
width
- the width that should be used if min height depends on itprotected 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()
Parent
Parent
. 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.
layoutChildren
in class Parent
public static java.util.List<CssMetaData<? extends Styleable,?>> getClassCssMetaData()
public java.util.List<CssMetaData<? extends Styleable,?>> getCssMetaData()
Node.getClassCssMetaData()
so that a Node's CssMetaData can be accessed without the need for reflection.getCssMetaData
in interface Styleable
getCssMetaData
in class Region
Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. Use is subject to