- All Implemented Interfaces:
- Styleable,- EventTarget
public abstract class Parent extends Node
This class handles all hierarchical scene graph operations, including adding/removing child nodes, marking branches dirty for layout and rendering, picking, bounds calculations, and executing the layout pass on each pulse.
There are two direct concrete Parent subclasses
- Since:
- JavaFX 2.0
- 
Property SummaryProperties Type Property Description ReadOnlyBooleanPropertyneedsLayoutIndicates that this Node and its subnodes requires a layout pass on the next pulse.Properties declared in class javafx.scene.NodeaccessibleHelp, accessibleRoleDescription, accessibleRole, accessibleText, 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, viewOrder, visible
- 
Field SummaryFields declared in class javafx.scene.NodeBASELINE_OFFSET_SAME_AS_HEIGHT
- 
Constructor SummaryConstructors Modifier Constructor Description protectedParent()Constructs a newParent.
- 
Method SummaryModifier and Type Method Description protected doublecomputeMinHeight(double width)Calculates the min height of thisParent.protected doublecomputeMinWidth(double height)Calculates the minimum width of thisParent.protected doublecomputePrefHeight(double width)Calculates the preferred height of thisParent.protected doublecomputePrefWidth(double height)Calculates the preferred width of thisParent.doublegetBaselineOffset()Calculates the baseline offset based on the first managed child.protected ObservableList<Node>getChildren()Gets the list of children of thisParent.ObservableList<Node>getChildrenUnmodifiable()Gets the list of children of thisParentas a read-only list.protected <E extends Node>
 List<E>getManagedChildren()Gets the list of all managed children of thisParent.ObservableList<String>getStylesheets()Gets an observable list of string URLs linking to the stylesheets to use with this Parent's contents.booleanisNeedsLayout()Gets the value of the property needsLayout.voidlayout()Executes a top-down layout pass on the scene graph under this parent.protected voidlayoutChildren()Invoked during the layout pass to layout the children in thisParent.ReadOnlyBooleanPropertyneedsLayoutProperty()Indicates that this Node and its subnodes requires a layout pass on the next pulse.voidrequestLayout()Requests a layout pass to be performed before the next scene is rendered.protected voidrequestParentLayout()Requests a layout pass of the parent to be performed before the next scene is rendered.protected voidsetNeedsLayout(boolean value)Sets the value of the property needsLayout.protected voidupdateBounds()Updates the bounds of thisParentand its children.Methods declared in class javafx.scene.NodeaccessibleHelpProperty, accessibleRoleDescriptionProperty, accessibleRoleProperty, accessibleTextProperty, addEventFilter, addEventHandler, applyCss, autosize, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, computeAreaInScreen, contains, contains, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectiveNodeOrientationProperty, effectProperty, eventDispatcherProperty, executeAccessibleAction, fireEvent, focusedProperty, focusTraversableProperty, getAccessibleHelp, getAccessibleRole, getAccessibleRoleDescription, getAccessibleText, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClassCssMetaData, getClip, getContentBias, getCssMetaData, getCursor, getDepthTest, getEffect, getEffectiveNodeOrientation, getEventDispatcher, getId, getInitialCursor, getInitialFocusTraversable, 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, getTransforms, getTranslateX, getTranslateY, getTranslateZ, getTypeSelector, getUserData, getViewOrder, hasProperties, hoverProperty, idProperty, inputMethodRequestsProperty, intersects, intersects, isCache, isDisable, isDisabled, isFocused, isFocusTraversable, isHover, isManaged, isMouseTransparent, isPickOnBounds, isPressed, isResizable, isVisible, layoutBoundsProperty, layoutXProperty, layoutYProperty, localToParent, localToParent, localToParent, localToParent, localToParent, localToParentTransformProperty, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToSceneTransformProperty, localToScreen, localToScreen, localToScreen, localToScreen, localToScreen, lookup, lookupAll, managedProperty, maxHeight, maxWidth, minHeight, minWidth, mouseTransparentProperty, nodeOrientationProperty, notifyAccessibleAttributeChanged, 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, prefHeight, prefWidth, pressedProperty, pseudoClassStateChanged, queryAccessibleAttribute, relocate, removeEventFilter, removeEventHandler, requestFocus, resize, resizeRelocate, rotateProperty, rotationAxisProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, screenToLocal, screenToLocal, screenToLocal, setAccessibleHelp, setAccessibleRole, setAccessibleRoleDescription, setAccessibleText, 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, setViewOrder, setVisible, snapshot, snapshot, startDragAndDrop, startFullDrag, styleProperty, toBack, toFront, toString, translateXProperty, translateYProperty, translateZProperty, usesMirroring, viewOrderProperty, visiblePropertyMethods declared in class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods declared in interface javafx.css.StyleablegetStyleableNode, getStyleClass
- 
Property Details- 
needsLayoutIndicates that this Node and its subnodes requires a layout pass on the next pulse.- See Also:
- isNeedsLayout(),- setNeedsLayout(boolean)
 
 
- 
- 
Constructor Details- 
Parentprotected Parent()Constructs a newParent.
 
- 
- 
Method Details- 
getChildrenGets the list of children of thisParent.See the class documentation for Nodefor scene graph structure restrictions on setting aParent's children list. If these restrictions are violated by a change to the list of children, the change is ignored and the previous value of the children list is restored. AnIllegalArgumentExceptionis thrown in this case.If this Parentnode is attached to aSceneattached to aWindowthat is showning (Window.isShowing()), then its list of children must only be modified on the JavaFX Application Thread. AnIllegalStateExceptionis thrown if this restriction is violated.Note to subclasses: if you override this method, you must return from your implementation the result of calling this super method. The actual list instance returned from any getChildren() implementation must be the list owned and managed by this Parent. The only typical purpose for overriding this method is to promote the method to be public. - Returns:
- the list of children of this Parent.
 
- 
getChildrenUnmodifiableGets the list of children of thisParentas a read-only list.- Returns:
- read-only access to this parent's children ObservableList
 
- 
getManagedChildrenGets 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
 
- 
setNeedsLayoutprotected final void setNeedsLayout(boolean value)Sets the value of the property needsLayout.- Property description:
- Indicates that this Node and its subnodes requires a layout pass on the next pulse.
 
- 
isNeedsLayoutpublic final boolean isNeedsLayout()Gets the value of the property needsLayout.- Property description:
- Indicates that this Node and its subnodes requires a layout pass on the next pulse.
 
- 
needsLayoutPropertyIndicates that this Node and its subnodes requires a layout pass on the next pulse.- See Also:
- isNeedsLayout(),- setNeedsLayout(boolean)
 
- 
requestLayoutpublic 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. - Since:
- JavaFX 8.0
 
- 
requestParentLayoutprotected 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. 
- 
computePrefWidthprotected 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
 
- 
computePrefHeightprotected 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
 
- 
computeMinWidthprotected 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
- Since:
- JavaFX 2.1
 
- 
computeMinHeightprotected 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
- Since:
- JavaFX 2.1
 
- 
getBaselineOffsetpublic double getBaselineOffset()Calculates the baseline offset based on the first managed child. If there is no such child, returnsNode.getBaselineOffset().- Overrides:
- getBaselineOffsetin class- Node
- Returns:
- baseline offset
 
- 
layoutpublic final 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.
- 
layoutChildrenprotected 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. 
- 
getStylesheetsGets an observable list of string URLs linking to the stylesheets to use with this Parent's contents. SeeScene.getStylesheets()for details.For additional information about using CSS with the scene graph, see the CSS Reference Guide. - Returns:
- the list of stylesheets to use with this Parent
- Since:
- JavaFX 2.1
 
- 
updateBoundsprotected void updateBounds()Updates the bounds of thisParentand its children.
 
-