Spec-Zone .ru
спецификации, руководства, описания, API
|
public class Group extends Parent
Group
узел содержит ObservableList дочерних элементов, которые представляются в порядке всякий раз, когда этот узел представляется. A Group
возьмет коллективные границы его дочерних элементов и не непосредственно изменяемого размера.
Любой преобразовывает, производит, или утверждает примененный к a Group
будет применен ко всем дочерним элементам той группы. Такие преобразования и эффекты НЕ будут включены в границы расположения этой Группы, однако если преобразует, и эффекты устанавливаются непосредственно на дочерних элементах этой Группы, то те будут включены в границы расположения этой Группы.
По умолчанию, a Group
"автоизмерит" его управляемые дочерние элементы изменяемого размера к их привилегированным размерам во время передачи расположения, чтобы гарантировать, что Области и Средства управления измеряются должным образом как их изменения состояния. Если приложение должно отключить это поведение автокалибровки, то это должно установить autoSizeChildren
к false
и поймите что, если привилегированный размер дочернего изменения, они не будут автоматически изменять размеры (так покупатель остерегаются!).
Групповой Пример:
import javafx.scene.*; import javafx.scene.paint.*; import javafx.scene.shape.*; import java.lang.Math; Group g = new Group(); for (int i = 0; i < 5; i++) { Rectangle r = new Rectangle(); r.setY(i * 20); r.setWidth(100); r.setHeight(10); r.setFill(Color.RED); g.getChildren().add(r); }
Type | Property and Description |
---|---|
BooleanProperty |
autoSizeChildren
Controls whether or not this
Group will automatically resize any
managed resizable children to their preferred sizes
during the layout pass. |
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
Constructor and Description |
---|
Group()
Constructs a group.
|
Group(Node... children)
Constructs a group consisting of children.
|
Modifier and Type | Method and Description |
---|---|
BooleanProperty |
autoSizeChildrenProperty()
Controls whether or not this
Group will automatically resize any
managed resizable children to their preferred sizes
during the layout pass. |
ObservableList<Node> |
getChildren()
Gets the list of children of this
Group . |
boolean |
isAutoSizeChildren()
Controls whether or not this
Group will automatically resize any
managed resizable children to their preferred sizes
during the layout pass. |
protected void |
layoutChildren()
Invoked during the layout pass to layout the children in this
Parent . |
double |
prefHeight(double width)
Returns the node's preferred height for use in layout calculations.
|
double |
prefWidth(double height)
Returns the node's preferred width for use in layout calculations.
|
void |
setAutoSizeChildren(boolean value)
Controls whether or not this
Group will automatically resize any
managed resizable children to their preferred sizes
during the layout pass. |
computePrefHeight, computePrefWidth, getBaselineOffset, getChildrenUnmodifiable, getManagedChildren, isNeedsLayout, layout, lookup, needsLayoutProperty, requestLayout, 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, getContentBias, 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, isResizable, isVisible, layoutBoundsProperty, layoutXProperty, layoutYProperty, localToParent, localToParent, localToParent, localToScene, localToScene, localToScene, lookupAll, managedProperty, maxHeight, maxWidth, minHeight, minWidth, 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, resize, 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
Group
will automatically resize any
managed resizable children to their preferred sizes
during the layout pass. If set to false
, then the application is
responsible for setting the size of this Group's resizable children, otherwise
such nodes may end up with a zero width/height and will not be visible.
This variable has no effect on content nodes which are not resizable (Shape, Text, etc).public Group()
public Group(Node... children)
children
- children.public final void setAutoSizeChildren(boolean value)
Group
will automatically resize any
managed resizable children to their preferred sizes
during the layout pass. If set to false
, then the application is
responsible for setting the size of this Group's resizable children, otherwise
such nodes may end up with a zero width/height and will not be visible.
This variable has no effect on content nodes which are not resizable (Shape, Text, etc).public final boolean isAutoSizeChildren()
Group
will automatically resize any
managed resizable children to their preferred sizes
during the layout pass. If set to false
, then the application is
responsible for setting the size of this Group's resizable children, otherwise
such nodes may end up with a zero width/height and will not be visible.
This variable has no effect on content nodes which are not resizable (Shape, Text, etc).public final BooleanProperty autoSizeChildrenProperty()
Group
will automatically resize any
managed resizable children to their preferred sizes
during the layout pass. If set to false
, then the application is
responsible for setting the size of this Group's resizable children, otherwise
such nodes may end up with a zero width/height and will not be visible.
This variable has no effect on content nodes which are not resizable (Shape, Text, etc).public ObservableList<Node> getChildren()
Group
.getChildren
in class Parent
Group
.public double prefWidth(double height)
Node
Layout code which calls this method should first check the content-bias of the node. If the node has a vertical content-bias, then callers should pass in a height value that the preferred width should be based on. If the node has either a horizontal or null content-bias, then the caller should pass in -1.
Node subclasses with a vertical content-bias should honor the height parameter whether -1 or a positive value. All other subclasses may ignore the height parameter (which will likely be -1).
prefWidth
in class Parent
height
- the height that should be used if preferred width depends on itNode.isResizable()
,
Node.getContentBias()
,
Node.autosize()
public double prefHeight(double width)
Node
Layout code which calls this method should first check the content-bias of the node. If the node has a horizontal content-bias, then callers should pass in a width value that the preferred height should be based on. If the node has either a vertical or null content-bias, then the caller should pass in -1.
Node subclasses with a horizontal content-bias should honor the height parameter whether -1 or a positive value. All other subclasses may ignore the height parameter (which will likely be -1).
prefHeight
in class Parent
width
- the width that should be used if preferred height depends on itNode.getContentBias()
,
Node.autosize()
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
Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved. Use is subject to