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
Group
effects and transforms to be applied to a collection of child nodes.javafx.scene.layout.Region
class for nodes that can be styled with CSS and layout children. Type | Property and Description |
---|---|
ReadOnlyBooleanProperty |
needsLayout
Indicates that this Node and its subnodes requires a layout pass on
the next pulse.
|
accessibleHelpProperty, accessibleRoleDescriptionProperty, accessibleRoleProperty, accessibleTextProperty, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, cacheHintProperty, cacheProperty, clipProperty, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectiveNodeOrientationProperty, effectProperty, eventDispatcherProperty, focusedProperty, focusTraversableProperty, hoverProperty, idProperty, inputMethodRequestsProperty, layoutBoundsProperty, layoutXProperty, layoutYProperty, localToParentTransformProperty, localToSceneTransformProperty, 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, pickOnBoundsProperty, pressedProperty, rotateProperty, rotationAxisProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, showMnemonicsProperty, styleProperty, translateXProperty, translateYProperty, translateZProperty, treeShowingProperty, treeVisibleProperty, viewOrderProperty, visibleProperty
Node.FocusedProperty, Node.TreeShowingPropertyReadOnly, Node.TreeVisiblePropertyReadOnly
Modifier and Type | Field and Description |
---|---|
private Node |
bottom |
private int |
BOTTOM_INVALID |
private BaseBounds |
cachedBounds
The cached bounds for the Group.
|
private boolean |
cachedBoundsInvalid
Indicates that the cachedBounds is invalid (or old) and need to be recomputed.
|
private <any> |
children |
private boolean |
childrenTriggerPermutation |
private java.util.Set<Node> |
childSet
Scenegraph Structure *
*
Functions and variables related to the scenegraph structure, *
modifying the structure, and walking the structure.
|
private boolean |
childSetModified |
private Node |
currentLayoutChild
It stores the reference to the current child being laid out by its parent.
|
private Node |
currentlyProcessedChild |
(package private) static int |
DIRTY_CHILDREN_THRESHOLD |
private java.util.ArrayList<Node> |
dirtyChildren
This set is used to track all of the children of this group which are
dirty.
|
private int |
dirtyChildrenCount
The number of dirty children which bounds haven't been incorporated
into the cached bounds yet.
|
private Node |
far |
private int |
FAR_INVALID |
private boolean |
forceParentLayout |
private boolean |
geomChanged |
(package private) LayoutFlags |
layoutFlag |
(package private) boolean |
layoutRoot
Keeps track of whether this node is a layout root.
|
private Node |
left |
private int |
LEFT_INVALID |
private double |
minHeightCache |
private double |
minWidthCache |
private Node |
near |
private int |
NEAR_INVALID |
private ReadOnlyBooleanWrapper |
needsLayout
Indicates that this Node and its subnodes requires a layout pass on
the next pulse.
|
private boolean |
performingLayout
This is used only by CCS in Node.
|
private int |
pgChildrenSize |
private double |
prefHeightCache |
private double |
prefWidthCache |
private java.util.List<Node> |
removed |
private static int |
REMOVED_CHILDREN_THRESHOLD
Threshold when it's worth to populate list of removed children.
|
private boolean |
removedChildrenOptimizationDisabled
Do not populate list of removed children when its number exceeds threshold,
but mark whole parent dirty.
|
private Node |
right |
private int |
RIGHT_INVALID |
private boolean |
sceneRoot
This field is managed by the Scene, and set on any node which is the
root of a Scene.
|
private boolean |
sizeCacheClear |
private int |
startIdx |
private <any> |
stylesheets
A ObservableList of string URLs linking to the stylesheets to use with this scene's
contents.
|
private BaseBounds |
tmp
*
Bounds Computations *
*
This code originated in GroupBoundsHelper (part of javafx-sg-common) *
but has been ported here to the FX side since we cannot rely on the PG *
side for computing the bounds (due to the decoupling of the two *
scenegraphs for threading and other purposes).
|
private Node |
top |
private int |
TOP_INVALID |
private ParentTraversalEngine |
traversalEngine |
private <any> |
unmodifiableChildren
A constant reference to an unmodifiable view of the children, such that every time
we ask for an unmodifiable list of children, we don't actually create a new
collection and return it.
|
private java.util.List<Node> |
unmodifiableManagedChildren
A cached reference to the unmodifiable managed children of this Parent.
|
private java.util.List<Node> |
viewOrderChildren
The viewOrderChildren is a list children sorted in decreasing viewOrder
order if it is not empty.
|
private static boolean |
warnOnAutoMove |
accessibilityProperties, accessible, BASELINE_OFFSET_SAME_AS_HEIGHT, boundsChanged, cssFlag, pseudoClassStates, styleHelper
Modifier | Constructor and Description |
---|---|
protected |
Parent()
Constructs a new
Parent . |
Modifier and Type | Method and Description |
---|---|
(package private) void |
childBoundsChanged(Node node)
Called by Node whenever its bounds have changed.
|
private void |
childExcluded(Node node) |
private void |
childIncluded(Node node) |
(package private) void |
childVisibilityChanged(Node node)
Called by node whenever the visibility of the node changes.
|
(package private) void |
clearSizeCache() |
protected double |
computeMinHeight(double width)
Calculates the min height of this
Parent . |
protected double |
computeMinWidth(double height)
Calculates the minimum width of this
Parent . |
protected double |
computePrefHeight(double width)
Calculates the preferred height of this
Parent . |
protected double |
computePrefWidth(double height)
Calculates the preferred width of this
Parent . |
private void |
computeViewOrderChidrenAndUpdatePeer() |
private void |
createCachedBounds(java.util.List<Node> fromNodes) |
private boolean |
doComputeContains(double localX,
double localY) |
private BaseBounds |
doComputeGeomBounds(BaseBounds bounds,
BaseTransform tx) |
private NGNode |
doCreatePeer() |
private java.util.List<java.lang.String> |
doGetAllParentStylesheets() |
private void |
doPickNodeLocal(PickRay pickRay,
PickResultChooser result) |
private void |
doProcessCSS() |
private void |
doUpdatePeer() |
double |
getBaselineOffset()
Calculates the baseline offset based on the first managed child.
|
protected <any> |
getChildren()
Gets the list of children of this
Parent . |
<any> |
getChildrenUnmodifiable()
Gets the list of children of this
Parent as a read-only
list. |
private BaseBounds |
getChildTransformedBounds(Node node,
BaseTransform tx,
BaseBounds bounds) |
protected <E extends Node> |
getManagedChildren()
Gets the list of all managed children of this
Parent . |
private java.util.List<Node> |
getOrderedChildren() |
<any> |
getStylesheets()
Gets an observable list of string URLs linking to the stylesheets to use
with this Parent's contents.
|
private ParentTraversalEngine |
getTraversalEngine() |
(package private) boolean |
isConnected()
Determines whether this node is connected anywhere in the scene graph.
|
(package private) boolean |
isCurrentLayoutChild(Node node) |
boolean |
isNeedsLayout()
Gets the value of the property needsLayout.
|
(package private) boolean |
isPerformingLayout() |
(package private) boolean |
isSceneRoot() |
void |
layout()
Executes a top-down layout pass on the scene graph under this parent.
|
protected void |
layoutChildren()
Invoked during the layout pass to layout the children in this
Parent . |
Node |
lookup(java.lang.String selector)
Finds this
Node , or the first sub-node, based on the given CSS selector. |
(package private) java.util.List<Node> |
lookupAll(Selector selector,
java.util.List<Node> results)
Please Note: This method should never create the results set,
let the Node class implementation do this!
|
(package private) void |
managedChildChanged()
Called by Node whenever its managed state may have changed, this
method will cause the view of managed children to be updated
such that it properly includes or excludes this child.
|
private void |
markDirtyLayout(boolean local,
boolean forceParentLayout) |
(package private) void |
markViewOrderChildrenDirty() |
double |
minHeight(double width)
Returns the node's minimum height for use in layout calculations.
|
double |
minWidth(double height)
Returns the node's minimum width for use in layout calculations.
|
ReadOnlyBooleanProperty |
needsLayoutProperty()
Indicates that this Node and its subnodes requires a layout pass on
the next pulse.
|
(package private) void |
nodeResolvedOrientationChanged() |
(package private) void |
notifyManagedChanged()
Called whenever the "managed" flag has changed.
|
(package private) boolean |
pickChildrenNode(PickRay pickRay,
PickResultChooser result) |
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.
|
(package private) void |
printSeq(java.lang.String prefix,
java.util.List<Node> nodes) |
java.lang.Object |
queryAccessibleAttribute(AccessibleAttribute attribute,
java.lang.Object... parameters)
This method is called by the assistive technology to request
the value for an attribute.
|
private void |
recomputeBounds()
Recomputes the bounds from scratch and saves the cached bounds.
|
(package private) void |
releaseAccessible() |
void |
requestLayout()
Requests a layout pass to be performed before the next scene is
rendered.
|
(package private) void |
requestLayout(boolean forceParentLayout)
A package scope method used by Node and serves as a helper method for
requestLayout() (see above).
|
protected void |
requestParentLayout()
Requests a layout pass of the parent to be performed before the next scene is
rendered.
|
(package private) void |
requestParentLayout(boolean forceParentLayout)
A package scope method used by Node and serves as a helper method for
requestParentLayout() (see above).
|
(package private) void |
scenesChanged(Scene newScene,
SubScene newSubScene,
Scene oldScene,
SubScene oldSubScene)
Exists for Parent and LightBase
|
private void |
setChildDirty(Node node,
boolean dirty) |
(package private) void |
setDerivedDepthTest(boolean value) |
(package private) void |
setLayoutFlag(LayoutFlags flag) |
protected void |
setNeedsLayout(boolean value)
Sets the value of the property needsLayout.
|
private void |
setTraversalEngine(ParentTraversalEngine value) |
(package private) java.util.List<Node> |
test_getRemoved()
Note: The only user of this method is in unit test: Parent_structure_sync_Test.
|
(package private) java.util.List<Node> |
test_getViewOrderChildren()
Note: The only user of this method is in unit test:
Parent_viewOrderChildren_sync_Test.
|
(package private) void |
toBack(Node node) |
(package private) void |
toFront(Node node) |
protected void |
updateBounds()
Updates the bounds of this
Parent and its children. |
private boolean |
updateCachedBounds(java.util.List<Node> dirtyNodes,
int remainingDirtyNodes) |
(package private) void |
validatePG() |
accessibleHelpProperty, accessibleRoleDescriptionProperty, accessibleRoleProperty, accessibleTextProperty, addEventFilter, addEventHandler, almostZero, applyCss, autosize, blendModeProperty, boundedSize, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clearDirty, clipProperty, computeAreaInScreen, computeDerivedDepthTest, contains, contains, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectiveNodeOrientationProperty, effectProperty, eventDispatcherProperty, executeAccessibleAction, findStyles, fireEvent, focusedProperty, focusTraversableProperty, getAccessible, getAccessibleHelp, getAccessibleRole, getAccessibleRoleDescription, getAccessibleText, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClassCssMetaData, getClip, getClipParent, getContentBias, getCSSFlags, getCssMetaData, getCurrentLocalToSceneTransformState, getCursor, getDepthTest, getEffect, getEffectiveNodeOrientation, getEventDispatcher, getGeomBounds, getId, getInitialCursor, getInitialFocusTraversable, getInputMethodRequests, getLayoutBounds, getLayoutX, getLayoutY, getLeafTransform, getLocalBounds, getLocalToParentTransform, getLocalToParentTransform, getLocalToSceneTransform, getMatchingStyles, 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, getPeer, getPivotX, getPivotY, getPivotZ, getProperties, getPseudoClassStates, getRotate, getRotationAxis, getScaleX, getScaleY, getScaleZ, getScene, getStyle, getStyleableParent, getStyleClass, getStyleMap, getSubScene, getTransformedBounds, getTransforms, getTranslateX, getTranslateY, getTranslateZ, getTypeSelector, getUserData, getViewOrder, hasMirroring, hasProperties, hoverProperty, idProperty, indent, inputMethodRequestsProperty, intersects, intersects, intersects, intersectsBounds, isCache, isCanReceiveFocus, isDerivedDepthTest, isDirty, isDirtyEmpty, isDisable, isDisabled, isFocused, isFocusTraversable, isHover, isManaged, isMouseTransparent, isPickOnBounds, isPressed, isResizable, isShowMnemonics, isTreeShowing, isTreeVisible, isVisible, layoutBoundsChanged, layoutBoundsProperty, layoutXProperty, layoutYProperty, localBoundsChanged, localToParent, localToParent, localToParent, localToParent, localToParent, localToParent, localToParent, localToParentTransformProperty, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToSceneTransformProperty, localToScreen, localToScreen, localToScreen, localToScreen, localToScreen, lookupAll, managedProperty, markDirtyLayoutBranch, maxHeight, maxWidth, mouseTransparentProperty, nodeOrientationProperty, nodeResolvedOrientationInvalidated, notifyAccessibleAttributeChanged, notifyParentOfBoundsChange, notifyParentsOfInvalidatedCSS, 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, parentResolvedOrientationInvalidated, parentToLocal, parentToLocal, parentToLocal, parentToLocal, parentToLocal, parentToLocal, parentToLocal, pickNode, pickOnBoundsProperty, pressedProperty, processCSS, pseudoClassStateChanged, reapplyCSS, relocate, removeEventFilter, removeEventHandler, requestFocus, resize, resizeRelocate, rotateProperty, rotationAxisProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, sceneToLocal, sceneToLocal, 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, setParent, setPickOnBounds, setPressed, setRotate, setRotationAxis, setScaleX, setScaleY, setScaleZ, setScenes, setShowMnemonics, setStyle, setStyleMap, setTranslateX, setTranslateY, setTranslateZ, setTreeShowing, setTreeVisible, setUserData, setViewOrder, setVisible, showMnemonicsProperty, snapshot, snapshot, startDragAndDrop, startFullDrag, styleProperty, syncPeer, toBack, toFront, toString, transformedBoundsChanged, translateXProperty, translateYProperty, translateZProperty, traverse, treeShowingProperty, treeVisibleProperty, updateGeomBounds, updateLocalToParentTransform, updateTxBounds, usesMirroring, viewOrderProperty, visibleProperty, wouldCreateCycle
public final ReadOnlyBooleanProperty needsLayoutProperty
isNeedsLayout()
,
setNeedsLayout(boolean)
static final int DIRTY_CHILDREN_THRESHOLD
private static final boolean warnOnAutoMove
private static final int REMOVED_CHILDREN_THRESHOLD
private boolean removedChildrenOptimizationDisabled
private final java.util.Set<Node> childSet
private int startIdx
private int pgChildrenSize
private final java.util.List<Node> viewOrderChildren
private boolean childrenTriggerPermutation
private java.util.List<Node> removed
private boolean geomChanged
private boolean childSetModified
private final <any> children
private final <any> unmodifiableChildren
private java.util.List<Node> unmodifiableManagedChildren
private ParentTraversalEngine traversalEngine
private ReadOnlyBooleanWrapper needsLayout
LayoutFlags layoutFlag
private boolean performingLayout
private boolean sizeCacheClear
private double prefWidthCache
private double prefHeightCache
private double minWidthCache
private double minHeightCache
private boolean forceParentLayout
private Node currentLayoutChild
private boolean sceneRoot
boolean layoutRoot
private final <any> stylesheets
private BaseBounds tmp
private BaseBounds cachedBounds
private boolean cachedBoundsInvalid
private int dirtyChildrenCount
private java.util.ArrayList<Node> dirtyChildren
private Node top
private Node left
private Node bottom
private Node right
private Node near
private Node far
private final int LEFT_INVALID
private final int TOP_INVALID
private final int NEAR_INVALID
private final int RIGHT_INVALID
private final int BOTTOM_INVALID
private final int FAR_INVALID
private Node currentlyProcessedChild
private void doUpdatePeer()
void validatePG()
void printSeq(java.lang.String prefix, java.util.List<Node> nodes)
void markViewOrderChildrenDirty()
private void computeViewOrderChidrenAndUpdatePeer()
private java.util.List<Node> getOrderedChildren()
protected <any> getChildren()
Parent
.
See the class documentation for Node
for scene graph structure
restrictions on setting a Parent
'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. An IllegalArgumentException
is thrown in this case.
If this Parent
node is attached to a Scene
attached to a Window
that is showning (javafx.stage.Window#isShowing()
), then its
list of children must only be modified on the JavaFX Application Thread.
An IllegalStateException
is 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.
Parent
.public <any> getChildrenUnmodifiable()
Parent
as a read-only
list.protected <E extends Node> java.util.List<E> getManagedChildren()
Parent
.E
- the type of the children nodesfinal void managedChildChanged()
final void toFront(Node node)
final void toBack(Node node)
void scenesChanged(Scene newScene, SubScene newSubScene, Scene oldScene, SubScene oldSubScene)
Node
scenesChanged
in class Node
void setDerivedDepthTest(boolean value)
setDerivedDepthTest
in class Node
boolean pickChildrenNode(PickRay pickRay, PickResultChooser result)
private void doPickNodeLocal(PickRay pickRay, PickResultChooser result)
boolean isConnected()
Node
isConnected
in class Node
public Node lookup(java.lang.String selector)
Node
Node
, or the first sub-node, based on the given CSS selector.
If this node is a Parent
, then this function will traverse down
into the branch until it finds a match. If more than one sub-node matches the
specified selector, this function returns the first of them.
For example, if a Node is given the id of "myId", then the lookup method can
be used to find this node as follows: scene.lookup("#myId");
.
java.util.List<Node> lookupAll(Selector selector, java.util.List<Node> results)
private final void setTraversalEngine(ParentTraversalEngine value)
private final ParentTraversalEngine getTraversalEngine()
protected final void setNeedsLayout(boolean value)
public final boolean isNeedsLayout()
public final ReadOnlyBooleanProperty needsLayoutProperty()
isNeedsLayout()
,
setNeedsLayout(boolean)
boolean isPerformingLayout()
void setLayoutFlag(LayoutFlags flag)
private void markDirtyLayout(boolean local, boolean forceParentLayout)
public void requestLayout()
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.
void requestLayout(boolean forceParentLayout)
protected final void requestParentLayout()
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.
void requestParentLayout(boolean forceParentLayout)
void clearSizeCache()
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 Node
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 Node
width
- the width that should be used if preferred height depends on itNode.getContentBias()
,
Node.autosize()
public double minWidth(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 minimum 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).
If Node's Node.maxWidth(double)
is lower than this number,
minWidth
takes precedence. This means the Node should never be resized below minWidth
.
minWidth
in class Node
height
- the height that should be used if minimum width depends on itNode.isResizable()
,
Node.getContentBias()
public double minHeight(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 minimum 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 width parameter whether -1 or a positive value. All other subclasses may ignore the width parameter (which will likely be -1).
If Node's Node.maxHeight(double)
is lower than this number,
minHeight
takes precedence. This means the Node should never be resized below minHeight
.
minHeight
in class Node
width
- the width that should be used if minimum height depends on itNode.isResizable()
,
Node.getContentBias()
protected double computePrefWidth(double height)
Parent
. 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.height
- the height that should be used if preferred width depends
on itprotected double computePrefHeight(double width)
Parent
. 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.width
- the width that should be used if preferred height depends
on itprotected double computeMinWidth(double height)
Parent
. The default
implementation simply returns the pref width.height
- the height that should be used if min width depends
on itprotected double computeMinHeight(double width)
Parent
. The default
implementation simply returns the pref height;width
- the width that should be used if min height depends
on itpublic double getBaselineOffset()
Node.getBaselineOffset()
.getBaselineOffset
in class Node
boolean isCurrentLayoutChild(Node node)
public final void layout()
protected void layoutChildren()
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.
final void notifyManagedChanged()
Node
notifyManagedChanged
in class Node
final boolean isSceneRoot()
public final <any> getStylesheets()
Scene.getStylesheets()
for details.
For additional information about using CSS with the scene graph, see the CSS Reference Guide.
private java.util.List<java.lang.String> doGetAllParentStylesheets()
private void doProcessCSS()
private NGNode doCreatePeer()
void nodeResolvedOrientationChanged()
nodeResolvedOrientationChanged
in class Node
private BaseBounds doComputeGeomBounds(BaseBounds bounds, BaseTransform tx)
private void setChildDirty(Node node, boolean dirty)
private void childIncluded(Node node)
private void childExcluded(Node node)
private void recomputeBounds()
private boolean updateCachedBounds(java.util.List<Node> dirtyNodes, int remainingDirtyNodes)
private void createCachedBounds(java.util.List<Node> fromNodes)
protected void updateBounds()
Parent
and its children.updateBounds
in class Node
private BaseBounds getChildTransformedBounds(Node node, BaseTransform tx, BaseBounds bounds)
void childBoundsChanged(Node node)
void childVisibilityChanged(Node node)
private boolean doComputeContains(double localX, double localY)
public java.lang.Object queryAccessibleAttribute(AccessibleAttribute attribute, java.lang.Object... parameters)
This method is commonly overridden by subclasses to implement
attributes that are required for a specific role.
If a particular attribute is not handled, the superclass implementation
must be called.
queryAccessibleAttribute
in class Node
attribute
- the requested attributeparameters
- optional list of parametersAccessibleAttribute
void releaseAccessible()
releaseAccessible
in class Node
java.util.List<Node> test_getRemoved()
java.util.List<Node> test_getViewOrderChildren()