Package javafx.scene
Class Parent
java.lang.Object
javafx.scene.Node
javafx.scene.Parent
- All Implemented Interfaces:
LayoutMeasurable
,LayoutMeasurableMixin
,HasBlendModeProperty
,HasClipProperty
,HasEffectProperty
,HasLayoutXProperty
,HasLayoutYProperty
,HasManagedProperty
,HasMouseTransparentProperty
,HasOnMouseClickedProperty
,HasOpacityProperty
,HasParentProperty
,HasVisibleProperty
,Styleable
,EventTarget
,INode
- Author:
- Bruno Salmon
-
Property Summary
TypePropertyDescriptionIndicates that this Node and its subnodes requires a layout pass on the next pulse.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
-
Field Summary
Fields inherited from interface javafx.scene.INode
BASELINE_OFFSET_SAME_AS_HEIGHT
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected double
computeMinHeight
(double width) Calculates the min height of thisParent
.protected double
computeMinWidth
(double height) Calculates the minimum width of thisParent
.protected double
computePrefHeight
(double width) Calculates the preferred height of thisParent
.protected double
computePrefWidth
(double height) Calculates the preferred width of thisParent
.double
Calculates the baseline offset based on the first managed child.Gets the list of children of thisParent
as a read-only list.Gets the list of all managed children of thisParent
.impl_computeGeomBounds
(BaseBounds bounds, BaseTransform tx) This set is used to track all of the children of this group which are dirty.protected double
impl_minHeight
(double width) protected double
impl_minWidth
(double height) protected double
impl_prefHeight
(double width) protected double
impl_prefWidth
(double height) final boolean
void
layout()
Executes a top-down layout pass on the scene graph under this parent.protected void
Invoked during the layout pass to layout the children in thisParent
.Indicates that this Node and its subnodes requires a layout pass on the next pulse.void
Requests a layout pass to be performed before the next scene is rendered.protected final void
Requests a layout pass of the parent to be performed before the next scene is rendered.void
setLayoutFlag
(LayoutFlags flag) protected final void
setNeedsLayout
(boolean value) Sets the value of theneedsLayout
property.void
setSceneRoot
(boolean sceneRoot) 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_computeLayoutBounds, impl_getLayoutBounds, impl_isTreeVisible, impl_maxHeight, impl_maxWidth, 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.HasBlendModeProperty
getBlendMode, setBlendMode
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasClipProperty
getClip, setClip
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasEffectProperty
getEffect, setEffect
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasLayoutXProperty
getLayoutX, setLayoutX
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasLayoutYProperty
getLayoutY, setLayoutY
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasManagedProperty
isManaged, setManaged
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasMouseTransparentProperty
isMouseTransparent, setMouseTransparent
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasOnMouseClickedProperty
getOnMouseClicked, setOnMouseClicked
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasOpacityProperty
getOpacity, setOpacity
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasParentProperty
getParent, setParent
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasVisibleProperty
isVisible, setVisible
Methods inherited from interface javafx.scene.INode
getContentBias, isResizable, relocate, resize, resizeRelocate
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.emul_coupling.LayoutMeasurableMixin
clearCache, getLayoutBounds, maxHeight, maxWidth, minHeight, minWidth, prefHeight, prefWidth
-
Property Details
-
needsLayout
Indicates that this Node and its subnodes requires a layout pass on the next pulse.- See Also:
-
-
Constructor Details
-
Parent
-
-
Method Details
-
getChildren
-
getChildrenUnmodifiable
Gets the list of children of thisParent
as a read-only list.- Returns:
- read-only access to this parent's children ObservableList
-
getManagedChildren
Gets the list of all managed children of thisParent
.- Type Parameters:
E
- the type of the children nodes- Returns:
- list of all managed children in this parent
-
setNeedsLayout
protected final void setNeedsLayout(boolean value) Sets the value of theneedsLayout
property.- Property description:
- Indicates that this Node and its subnodes requires a layout pass on the next pulse.
- Parameters:
value
- the value for theneedsLayout
property- See Also:
-
isNeedsLayout
public final boolean isNeedsLayout() -
needsLayoutProperty
Indicates that this Node and its subnodes requires a layout pass on the next pulse.- Returns:
- the
needsLayout
property - See Also:
-
setLayoutFlag
-
requestLayout
public void requestLayout()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.
-
requestParentLayout
protected final void requestParentLayout()Requests a layout pass of the parent to be performed before the next scene is rendered. This is batched up asynchronously to happen once per "pulse", or frame of animation.This may be used when the current parent have changed it's min/max/preferred width/height, but doesn't know yet if the change will lead to it's actual size change. This will be determined when it's parent recomputes the layout with the new hints.
-
impl_prefWidth
protected double impl_prefWidth(double height) - Overrides:
impl_prefWidth
in classNode
-
impl_prefHeight
protected double impl_prefHeight(double width) - Overrides:
impl_prefHeight
in classNode
-
impl_minWidth
protected double impl_minWidth(double height) - Overrides:
impl_minWidth
in classNode
-
impl_minHeight
protected double impl_minHeight(double width) - Overrides:
impl_minHeight
in classNode
-
computePrefWidth
protected double computePrefWidth(double height) Calculates the preferred width of thisParent
. The default implementation calculates this width as the width of the area occupied by its managed children when they are positioned at their current positions at their preferred widths.- Parameters:
height
- the height that should be used if preferred width depends on it- Returns:
- the calculated preferred width
-
computePrefHeight
protected double computePrefHeight(double width) Calculates the preferred height of thisParent
. The default implementation calculates this height as the height of the area occupied by its managed children when they are positioned at their current positions at their preferred heights.- Parameters:
width
- the width that should be used if preferred height depends on it- Returns:
- the calculated preferred height
-
computeMinWidth
protected double computeMinWidth(double height) Calculates the minimum width of thisParent
. The default implementation simply returns the pref width.- Parameters:
height
- the height that should be used if min width depends on it- Returns:
- the calculated min width
-
computeMinHeight
protected double computeMinHeight(double width) Calculates the min height of thisParent
. The default implementation simply returns the pref height;- Parameters:
width
- the width that should be used if min height depends on it- Returns:
- the calculated min height
-
getBaselineOffset
public double getBaselineOffset()Calculates the baseline offset based on the first managed child. If there is no such child, returnsINode.getBaselineOffset()
.- Returns:
- baseline offset
-
layout
public void layout()Executes a top-down layout pass on the scene graph under this parent. Calling this method while the Parent is doing layout is a no-op. -
layoutChildren
protected void layoutChildren()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.
-
setSceneRoot
public void setSceneRoot(boolean sceneRoot) -
impl_computeGeomBounds
This set is used to track all of the children of this group which are dirty. It is only used in cases where the number of children is > some value (currently 10). For very wide trees, this can provide a very important speed boost. For the sake of memory consumption, this is null unless the number of children ever crosses the threshold where it will be activated.- Specified by:
impl_computeGeomBounds
in classNode
-