Spec-Zone .ru
спецификации, руководства, описания, API

JavaFX: Bringing Rich Experiences To All the Screens Of Your Life

expand all

Profile: desktop, common

Overview

Base class for container nodes. A container is a javafx.scene.Parent node which is Resizable and performs layout on its children, which are by default defined by its content sequence.

A Container subclass should override the doLayout function to position and resize (if appropriate) its managed content nodes in accordance with its own layout strategy given its current width and height values. Note that doLayout is called automatically by the scene graph while executing a top-down layout pass and it should not be invoked directly by a container subclass.

In addition to overriding doLayout, a Container subclass should also override getPrefWidth and getPrefHeight to return appropriate values given its current state. This is critical to ensure that the parent of the Container resizes it appropriately during layout. See Resizable for details on additional functions that may be overridden if the Container defaults are not sufficient.

Containers position nodes by setting layoutX/layoutY and do not alter translateX/translateY, which are reserved for adjustments and animation. Containers also resize Resizable content by typically querying their min/pref/max/fill size preferences and then setting the child's width and height accordingly. To make these operations easier, the Container class provides a number of script-level utility functions that handle details such as Resizable-vs-not, subtracting layoutBounds.minX/Y, etc:

A Container may choose to honor LayoutInfo constraints set on a child via the node's layoutInfo variable, though it doesn't have to. It is strongly recommended that if the Container will be used for general purpose layout that it at least honor any min/pref/max size overrides set by the application using LayoutInfo. Container provides many script-level utility functions to make it easier to deal with LayoutInfo:

Profile: common

Script Variable Summary

accessnametypeCan ReadCan InitCan WriteDefault Valuedescription

Variable Summary

accessnametypeCan ReadCan InitCan WriteDefault Valuedescription
publiccontentNode[]empty

A sequence of child Nodes that will be rendered in order whenever this Container is rendered.

A sequence of child Nodes that will be rendered in order whenever this Container is rendered.

See the class documentation for Node for scene graph structure restrictions on setting a Container's content sequence. If these restrictions are violated by a change to the content sequence, the change is ignored and the previous value of the content sequence is restored.

Throws: AssignToBoundException if the same node appears in two different bound sequences.

empty

Profile: common

 
publicsnapToPixelBoolean

Inherited Variables

javafx.scene.Parent

accessnametypeCan ReadCan InitCan WriteDefault Valuedescription
protectedchildrenNode[]subclasssubclasssubclassempty

A sequence of child Nodes.

A sequence of child Nodes. A CustomNode subclass may override or bind to this sequence as needed.

See the class documentation for Node for scene graph structure restrictions on setting a Parent's children sequence. If these restrictions are violated by a change to the children sequence, the change is ignored and the previous value of the child sequence is restored.

Throws: AssignToBoundException if the same node appears in two different bound sequences.

empty

Profile: common

 
public-read protectedneedsLayoutBooleansubclasssubclass

Indicates that this Node and its subnodes requires a layout pass on the next pulse.

javafx.scene.Node

accessnametypeCan ReadCan InitCan WriteDefault Valuedescription
publicblocksMouseBooleanfalse

If true, consumes mouse events in this Node and does not send them to other nodes further up the scene graph.

If true, consumes mouse events in this Node and does not send them to other nodes further up the scene graph. If a Node wants to block mouse events from going to nodes which are visually obscured by this Node, then set blocksMouse to true.

false

Profile: common

 
public-readboundsInLocalBounds

The rectangular bounds of this Node in the node's untransformed local coordinate space.

The rectangular bounds of this Node in the node's untransformed local coordinate space. For nodes that extend javafx.scene.shape.Shape, the local bounds will also include space required for a non-zero stroke that may fall outside the shape's geometry that is defined by position and size attributes. The local bounds will also include any clipping set with clip as well as effects set with effect.

Note that this method does not take the node's visibility into account; the test is based on the geometry of this Node only.

This variable will always be a non-null value.

Note that boundsInLocal is automatically recomputed whenever the geometry of a node changes. For this reason, it is an error to bind any of these values in a node to an expression that depends upon this variable. For example, the "x" or "y" variables of a shape should never be bound to boundsInLocal for the purpose of positioning the node.

Profile: common

 
public-readboundsInParentBounds

The rectangular bounds of this Node which include its transforms.

The rectangular bounds of this Node which include its transforms. boundsInParent is calculated by taking its local bounds (defined by boundsInLocal) and applying the transform created by setting the following additional variables:

  1. transforms[] sequence
  2. scaleX, scaleY
  3. rotate
  4. layoutX, layoutY
  5. translateX, translateY

The resulting bounds will be conceptually in the coordinate space of the Node's parent, however the node need not have a parent to calculate these bounds.

Note that this method does not take the node's visibility into account; the test is based on the geometry of this Node only.

This variable will always be a non-null value.

Note that boundsInParent is automatically recomputed whenever the geometry of a node changes, or when any of the following change: the transforms sequence, the translateX, translateY, layoutX, layoutY, scaleX, scaleY, or rotate variable. For this reason, it is an error to bind any of these values in a node to an expression that depends upon this variable. For example, the "x" or "y" variables of a shape, or translateX, translateY should never be bound to boundsInParent for the purpose of positioning the node.

Profile: common

 
publiccacheBooleanfalse

A performance hint to the system to indicate that this Node should be cached as a bitmap.

A performance hint to the system to indicate that this Node should be cached as a bitmap. Rendering a bitmap representation of a node will be faster than rendering primitives in many cases, especially in the case of primitives with effects applied (such as a blur). However, it also increases memory usage. This hint indicates whether that trade-off (increased memory usage for increased performance) is worthwhile. Also note that on some platforms such as GPU accelerated platforms there is little benefit to caching Nodes as bitmaps when blurs and other effects are used since they are very fast to render on the GPU. The cacheHint variable provides additional options for enabling more aggressive bitmap caching.

false

See Also:
Node.cacheHint

Profile: common

 
publiccacheHintCacheHintCacheHint.DEFAULT

Additional hint for controlling bitmap caching.

Additional hint for controlling bitmap caching.

Under certain circumstances, such as animating nodes that are very expensive to render, it is desirable to be able to perform transformations on the node without having to regenerate the cached bitmap. An option in such cases is to perform the transforms on the cached bitmap itself.

This technique can provide a dramatic improvement to animation performance, though may also result in a reduction in visual quality. The cacheHint variable provides a hint to the system about how and when that trade-off (visual quality for animation performance) is acceptable.

It is possible to enable the cacheHint only at times when your node is animating. In this way, expensive nodes can appear on screen with full visual quality, yet still animate smoothly.

Example:


 expensiveNode.cache = true;
 expensiveNode.cacheHint = CacheHint.QUALITY;
 ...
 // Do an animation
 expensiveNode.cacheHint = CacheHint.SPEED;
 Timeline {
     keyFrames: [
         KeyFrame {
             time: 2s
             values: [
                 expensiveNode.scaleX => 2.0,
                 expensiveNode.scaleY => 2.0,
                 expensiveNode.rotate=> 360,
                 expensiveNode.cacheHint => CacheHint.QUALITY
             ]
        }
     ]
 }.play();
 
Note that cacheHint is only a hint to the system. Depending on the details of the node or the transform, this hint may be ignored.

If Node.cache is false, cacheHint is ignored.

CacheHint.DEFAULT

See Also:
Node.cache

Profile: common

 
publicclipNodenull

Specifies a Node to use to define the the clipping shape for this Node.

Specifies a Node to use to define the the clipping shape for this Node. This clipping Node is not a child of this Node in the scene graph sense. Rather, it is used to define the clip for this Node.

For example, you can use an javafx.scene.image.ImageView Node as a mask to represent the Clip. Or you could use one of the geometric shape Nodes such as javafx.scene.shape.Rectangle or javafx.scene.shape.Circle. Or you could use a javafx.scene.text.Text node to represent the Clip.

See the class documentation for Node for scene graph structure restrictions on setting the clip. If these restrictions are violated by a change to the clip variable, the change is ignored and the previous value of the clip variable is restored.

Note: this is a conditional feature. See ConditionalFeature.SHAPE_CLIP for more information.

null

Profile: common conditional shape_clip

 
publiccursorCursornull

Defines the mouse cursor for this Node and subnodes.

Defines the mouse cursor for this Node and subnodes. If null, then the cursor of the first parent node with a non-null cursor will be used. If no Node in the scene graph defines a cursor, then the cursor of the Scene will be used.

null

Profile: common

 
publicdisableBooleanfalse

Sets the individual disabled state of this Node.

Sets the individual disabled state of this Node. Setting disable to true will cause this Node and any subnodes to become disabled. This variable should be used only to set the disabled state of a Node. For querying the disabled state of a Node, the disabled variable should instead be used, since it is possible that a Node was disabled as a result of an ancestor being disabled even if the individual disable state on this Node is false.

false

Profile: common

 
public-readdisabledBooleanfalse

Indicates whether or not this Node is disabled.

Indicates whether or not this Node is disabled. A Node will become disabled if disable is set to true on either itself or one of its ancestors in the scene graph.

A disabled Node should render itself differently to indicate its disabled state to the user. Such disabled rendering is dependent on the implementation of the Node. The shape classes contained in javafx.scene.shape do not implement such rendering by default, therefore applications using shapes for handling input must implement appropriate disabled rendering themselves. The user-interface controls defined in javafx.scene.control will implement disabled-sensitive rendering, however.

A disabled Node does not receive mouse or key events.

false

Profile: common

 
publiceffectEffectnull

Specifies an effect to apply to this Node.

Specifies an effect to apply to this Node.

Note: this is a conditional feature. See ConditionalFeature.EFFECT for more information.

null

Profile: common conditional effect

 
public-read protectedfocusedBooleansubclasssubclassfalse

Indicates whether this Node currently has the input focus.

Indicates whether this Node currently has the input focus. To have the input focus, a node must be the Scene's focus owner, and the scene must be in a Stage that is visible and active. See requestFocus() for more information.

false

Profile: common

 
publicfocusTraversableBooleanfalse

Specifies whether this Node should be a part of focus traversal cycle.

Specifies whether this Node should be a part of focus traversal cycle. When this property is true focus can be moved to this Node and from this Node using regular focus traversal keys. On a desktop such keys are usually TAB for moving focus forward and SHIFT+TAB for moving focus backward. When a Scene is created, the system gives focus to a Node whose focusTraversable variable is true and that is eligible to receive the focus, unless the focus had been set explicitly via a call to requestFocus().

false

Profile: common

 
public-read protectedhoverBooleansubclasssubclassfalse

Whether or not this Node is being hovered over.

Whether or not this Node is being hovered over. Typically this is due to the mouse being over the node, though it could be due to a pen hovering on a graphics tablet or other form of input.

NOTE: the current implementation of hover relies on mouse enter and exit events to determine whether this Node is in the hover state; this means that this feature is currently supported only on systems that have a mouse. Future implementations may provide alternative means of supporting hover.

false

Profile: common

 
publicidStringempty string

The id of this Node.

The id of this Node. This simple string identifier is useful for finding a specific Node within the scene graph. While the id of a Node should be unique within the scene graph, this uniqueness is not enforced. This is much like the "id" attribute of an HTML element.

empty string

Profile: common

 
public-read protectedlayoutBoundsBoundssubclasssubclass

The rectangular bounds that should be used for layout calculations on this Node.

The rectangular bounds that should be used for layout calculations on this Node. layoutBounds may differ from the visual bounds of the node and is computed differently depending on the node type.

See javafx.scene.shape.Shape, javafx.scene.text.Text, Group, and javafx.scene.layout.Resizable for detailed descriptions on how layoutBounds are computed.

Note that the layoutX, layoutY, translateX, and translateY variables are not included in the layoutBounds. This is important because layout code must first determine the current size and location of the Node (using layoutBounds) and then set layoutX and layoutY to adjust the translation of the Node so that it will have the desired layout position.

Because the computation of layoutBounds is often tied to a node's geometric variables, it is an error to bind any such variables to an expression that depends upon layoutBounds. For example, the "x" or "y" variables of a shape should never be bound to layoutBounds for the purpose of positioning the node.

Profile: common

 
publiclayoutInfoLayoutInfoBase

Hook for node-specific layout information used by layout containers.

Hook for node-specific layout information used by layout containers. If the node is not a child of a container which supports layout info, this variable will be ignored.

Note that layoutInfo object literals may be shared across nodes, which means altering the vars on a LayoutInfo will affect all such nodes.

 
publiclayoutXNumber0

Defines the x coordinate of the translation that is added to this Node's transform for the purpose of layout.

Defines the x coordinate of the translation that is added to this Node's transform for the purpose of layout. The value should be computed as the offset required to adjust the position of the node from its current layoutBounds.minX position (which might not be 0) to the desired location.

For example, if textnode should be positioned at finalX:

     textnode.layoutX = finalX - textnode.layoutBounds.minX;
 

Failure to subtract layoutBounds.minX may result in misplacement of the node.

The node's final translation will be computed as layoutX + translateX, where layoutX establishes the node's stable position and translateX) optionally makes dynamic adjustments to that position.

If the node is managed and has a javafx.scene.layout.Container as its parent, then the container will set layoutX according to its own layout policy. If the node is unmanaged or parented by a Group or Scene , then the application may set layoutX directly to position it.

0

Profile: common

 
publiclayoutYNumber0

Defines the y coordinate of the translation that is added to this Node's transform for the purpose of layout.

Defines the y coordinate of the translation that is added to this Node's transform for the purpose of layout. The value should be computed as the offset required to adjust the position of the node from its current layoutBounds.minY position (which might not be 0) to the desired location.

For example, if textnode should be positioned at finalY:

     textnode.layoutY = finalY - textnode.layoutBounds.minY;
 

Failure to subtract layoutBounds.minY may result in misplacement of the node.

The node's final translation will be computed as layoutY + translateY, where layoutY establishes the node's stable position and translateY) optionally makes dynamic adjustments to that position.

If the node is managed and has a javafx.scene.layout.Container as its parent, then the container will set layoutY according to its own layout policy. If the node is unmanaged or parented by a Group or Scene , then the application may set layoutY directly to position it.

0

Profile: common

 
publicmanagedBooleantrue

Defines whether or not this node's layout will be managed by it's parent.

Defines whether or not this node's layout will be managed by it's parent. Each parent class follows a strategy for laying out managed children during the scene's layout pass:

  • Group: sets the size of any Resizable children to their preferred size; does not alter the size of non-Resizable children; does not position children.
  • javafx.scene.layout.Container classes: set the size of any javafx.scene.layout.Resizable content according to its layout rules and each Resizable's sizing preferences; does not alter the size of non-Resizable content; will position nodes (setting layoutX/layoutY) according to its layout rules.
  • CustomNode: by default it behaves like Group, however its layout behavior may be overridden by a subclass.
Parents will ignore unmanaged children for the purposes of layout and it is the application's responsibility to set the size and position of an unmanaged node. By default all nodes are managed.

If a Parent node is unmanaged, then it will act as a root for layout, which means that layout requests beneath it will cause only the branch rooted by the parent node to be relayed out.

true  
publiconKeyPressedfunction(:KeyEvent):Void

Defines a function to be called when this Node has input focus and a key has been pressed.

publiconKeyReleasedfunction(:KeyEvent):Void

Defines a function to be called when this Node has input focus and a key has been released.

publiconKeyTypedfunction(:KeyEvent):Void

Defines a function to be called when this Node has input focus and a key has been typed.

publiconMouseClickedfunction(:MouseEvent):Void

Defines a function to be called when a mouse button has been clicked (pressed and released) on this Node.

publiconMouseDraggedfunction(:MouseEvent):Void

Defines a function to be called when a mouse button is pressed on this Node and then dragged.

publiconMouseEnteredfunction(:MouseEvent):Void

Defines a function to be called when the mouse enters this Node.

publiconMouseExitedfunction(:MouseEvent):Void

Defines a function to be called when the mouse exits this Node.

publiconMouseMovedfunction(:MouseEvent):Void

Defines a function to be called when mouse cursor moves within this Node but no buttons have been pushed.

publiconMousePressedfunction(:MouseEvent):Void

Defines a function to be called when a mouse button has been pressed on this Node.

publiconMouseReleasedfunction(:MouseEvent):Void

Defines a function to be called when a mouse button has been released on this Node.

publiconMouseWheelMovedfunction(:MouseEvent):Void

Defines a function to be called when the mouse scroll wheel has moved.

publicopacityNumber1.0

Specifies how opaque (that is, solid) the Node appears.

Specifies how opaque (that is, solid) the Node appears. A Node with 0% opacity is fully translucent. That is, while it is still visible and rendered, you generally won't be able to see it. The exception to this rule is when the ZNode is combined with a blending mode and blend effect in which case a translucent Node may still have an impact in rendering. An opacity of 50% will render the node as being 50% transparent.

A visible node with any opacity setting still receives mouse events and can receive keyboard focus. For example, if you want to have a large invisible rectangle overlay all Nodes in the scene graph in order to intercept mouse events but not be visible to the user, you could create a large Rectangle that had an opacity of 0%.

Opacity is specified as a value between 0 and 1. Values less than 0 or greater than 1 are clipped to 0 and 1 respectively.

On some platforms ImageView might not support opacity variable.

1.0

Profile: common

 
public-read packageparentParentnull

The parent of this Node.

The parent of this Node. If this Node has not been added to a scene graph, then parent will be null.

null

Profile: common

 
publicpickOnBoundsBooleanfalse

Defines how the picking computation is done for this node when triggered by a MouseEvent or a contains function call.

Defines how the picking computation is done for this node when triggered by a MouseEvent or a contains function call. If pickOnBounds is true, then picking is computed by intersecting with the bounds of this node, else picking is computed by intersecting with the geometric shape of this node.

false

Profile: common

 
public-read protectedpressedBooleansubclasssubclassfalse

Whether or not the Node is pressed.

Whether or not the Node is pressed. Typically this is true when the primary mouse button is down, though subclasses may define other mouse button state or key state to cause the node to be "pressed".

false

Profile: common

 
publicrotateNumber0.0

Defines the angle of rotation about the Node's center, measured in degrees.

Defines the angle of rotation about the Node's center, measured in degrees. This is used to rotate the Node.

This rotation factor is not included in layoutBounds by default, which makes it ideal for rotating the entire node after all effects and transforms have been taken into account.

The pivot point about which the rotation occurs is the center of the untransformed layoutBounds.

Note that because the pivot point is computed as the center of this Node's layout bounds, any change to the layout bounds will cause the pivot point to change, which can move the object. For a leaf node, any change to the geometry will cause the layout bounds to change. For a group node, any change to any of its children, including a change in a child's geometry, clip, effect, position, orientation, or scale, will cause the group's layout bounds to change. If this movement of the pivot point is not desired, applications should instead use the Node's transforms[] sequence, and add a javafx.scene.transform.Rotate transform, which has a user-specifiable pivot point.

0.0

Profile: common

 
publicrotationAxisPoint3DRotate.Z_AXIS

Defines the axis of rotation of this Node.

Defines the axis of rotation of this Node.

Note: this is a conditional feature. See ConditionalFeature.SCENE3D for more information.

Rotate.Z_AXIS

Profile: common conditional scene3d

 
publicscaleXNumber1.0

Defines the factor by which coordinates are scaled about the center of the object along the X axis of this Node.

Defines the factor by which coordinates are scaled about the center of the object along the X axis of this Node. This is used to stretch or animate the node either manually or by using an animation.

This scale factor is not included in layoutBounds by default, which makes it ideal for scaling the entire node after all effects and transforms have been taken into account.

The pivot point about which the scale occurs is the center of the untransformed layoutBounds.

1.0

Profile: common

 
publicscaleYNumber1.0

Defines the factor by which coordinates are scaled about the center of the object along the Y axis of this Node.

Defines the factor by which coordinates are scaled about the center of the object along the Y axis of this Node. This is used to stretch or animate the node either manually or by using an animation.

This scale factor is not included in layoutBounds by default, which makes it ideal for scaling the entire node after all effects and transforms have been taken into account.

The pivot point about which the scale occurs is the center of the untransformed layoutBounds.

1.0

Profile: common

 
publicscaleZNumber1.0

Defines the factor by which coordinates are scaled about the center of the object along the Z axis of this Node.

Defines the factor by which coordinates are scaled about the center of the object along the Z axis of this Node. This is used to stretch or animate the node either manually or by using an animation.

This scale factor is not included in layoutBounds by default, which makes it ideal for scaling the entire node after all effects and transforms have been taken into account.

The pivot point about which the scale occurs is the center of the rectangular bounds formed by taking boundsInLocal and applying all the transforms in the transforms[] sequence.

Note: this is a conditional feature. See ConditionalFeature.SCENE3D for more information.

1.0

Profile: common conditional scene3d

 
public-read packagesceneScenenull

The Scene that this Node is part of.

The Scene that this Node is part of. If the Node is not part of a scene, then this variable will be null.

null

Profile: common

 
publicstyleStringempty string

A string representation of the CSS style associated with this specific Node.

A string representation of the CSS style associated with this specific Node. This is exactly analogous to the "style" attribute on an HTML element, but uses the syntax defined in JavaFX CSS. Parsing this style might not be supported on some limited platforms. It is recomended to use standalone CSS file instead.

empty string

Profile: common

 
publicstyleClassStringempty string

A String identifier which can be used to logically group Nodes, specifically for an external style engine.

A String identifier which can be used to logically group Nodes, specifically for an external style engine. This variable is exactly analogous to the styleClass attribute on an HTML element.

empty string

Profile: common

 
publictransformsTransform[]empty

Defines the sequence of javafx.scene.transform.Transform objects to be applied to this Node.

Defines the sequence of javafx.scene.transform.Transform objects to be applied to this Node. This sequence of transforms is applied before translateX, translateY, scaleX, and scaleY, rotate transforms.

empty

Profile: common

 
publictranslateXNumber0

Defines the x coordinate of the translation that is added to this Node's transform.

Defines the x coordinate of the translation that is added to this Node's transform.

The node's final translation will be computed as layoutX + translateX, where layoutX establishes the node's stable position and translateX optionally makes dynamic adjustments to that position.

This variable can be used to alter the location of a node without disturbing its layoutBounds, which makes it useful for animating a node's location.

0

Profile: common

 
publictranslateYNumber0

Defines the y coordinate of the translation that is added to this Node's transform.

Defines the y coordinate of the translation that is added to this Node's transform.

The node's final translation will be computed as layoutY + translateY, where layoutY establishes the node's stable position and translateY optionally makes dynamic adjustments to that position.

This variable can be used to alter the location of a node without disturbing its layoutBounds, which makes it useful for animating a node's location.

0

Profile: common

 
publictranslateZNumber0

Defines the Z coordinate of the translation that is added to the transformed coordinates of this Node.

Defines the Z coordinate of the translation that is added to the transformed coordinates of this Node. This value will be added to any translation defined by the transforms sequence and layoutZ.

This variable can be used to alter the location of a Node without disturbing its layout bounds, which makes it useful for animating a node's location.

Note: this is a conditional feature. See ConditionalFeature.SCENE3D for more information.

0

Profile: common conditional scene3d

 
publicvisibleBooleantrue

Specifies whether this Node and any subnodes should be rendered as part of the scene graph.

Specifies whether this Node and any subnodes should be rendered as part of the scene graph. A node may be visible and yet not be shown in the rendered scene if, for instance, it is off the screen or obscured by another Node. Invisible nodes never receive mouse events or keyboard focus, and never maintain keyboard focus when they become invisible.

true

Profile: common

 

javafx.scene.layout.Resizable

accessnametypeCan ReadCan InitCan WriteDefault Valuedescription
publicheightNumber

The Resizable's layout height, which is set by the it's parent during layout and should not be set directly by the application.

The Resizable's layout height, which is set by the it's parent during layout and should not be set directly by the application. Any value set by the application will be overridden by the parent when it lays out the Resizable in accordance with the Resizable's sizing preferences and the parent's layout policy.

If an application needs to control the height of a Resizable node, it should override its preferred height using LayoutInfo:


      Label {
          layoutInfo: LayoutInfo { height: 100 }
      }
 

Profile: common

 
publicwidthNumber

The Resizable's layout width, which is set by the it's parent during layout and should not be set directly by the application.

The Resizable's layout width, which is set by the it's parent during layout and should not be set directly by the application. Any value set by the application will be overridden by the parent when it lays out the Resizable in accordance with the Resizable's sizing preferences and the parent's layout policy.

If an application needs to control the width of a Resizable node, it should override its preferred width using LayoutInfo:


      Label {
          layoutInfo: LayoutInfo { width: 100 }
      }
 

Profile: common

 

javafx.scene.text.TextOffsets

accessnametypeCan ReadCan InitCan WriteDefault Valuedescription
public-read protectedbaselineOffsetNumbersubclasssubclass

The 'alphabetic' (or 'roman') baseline offset from the node's layoutBounds.minY location.

Script Function Summary

public getManaged(content: Node[]) : Node[]

Utility function which returns the sequence of nodes within the content whose layout should be managed by its parent.

Utility function which returns the sequence of nodes within the content whose layout should be managed by its parent. See javafx.scene.Node#managed.

Parameters
content
Returns
Node[]
 
public bound getNodeBaselineOffset(node: Node) : Number

Utility function which returns the baseline offset of the Node if it implements javafx.scene.text.TextOffsets, otherwise returns layoutBounds.height.

Utility function which returns the baseline offset of the Node if it implements javafx.scene.text.TextOffsets, otherwise returns layoutBounds.height.

Parameters
node
Returns
Number
 
public getNodeHFill(node: Node, fallback: Boolean) : Boolean

Utility function which returns the horizontal fill constraint of the Node which defines whether the node should be sized larger than its preferred width (up to its maximum) if it's Resizable and its layout area has additional horizontal space.

Utility function which returns the horizontal fill constraint of the Node which defines whether the node should be sized larger than its preferred width (up to its maximum) if it's Resizable and its layout area has additional horizontal space.

If the node has a non-null layoutInfo where hfill is set, then that value is returned, else if the node is Resizable then its getHFill() is returned, else the fallback is returned.

Parameters
node
fallback
Returns
Boolean
 
public getNodeHGrow(node: Node) : javafx.scene.layout.Priority

Utility function which returns the horizontal grow priority of the Node, which defines whether the node's layout area should be allocated additional horizontal space if a container has additional horizontal space and multiple nodes are competing for it.

Utility function which returns the horizontal grow priority of the Node, which defines whether the node's layout area should be allocated additional horizontal space if a container has additional horizontal space and multiple nodes are competing for it.

If the node has a non-null layoutInfo where hgrow is set, then that value is returned, else if the node is Resizable then its getHGrow() is returned, else Priority.NEVER is returned.

Parameters
node
Returns
Priority
 
public getNodeHPos(node: Node, fallback: HPos) : HPos

Utility function which returns the horizontal layout position of the Node which defines how the node should be horizontally aligned within its layout space if the width of the layout space is greater than the layout bounds width of the node.

Utility function which returns the horizontal layout position of the Node which defines how the node should be horizontally aligned within its layout space if the width of the layout space is greater than the layout bounds width of the node.

If the node has a non-null layoutInfo where hpos is set, then that value is returned, else the fallback value is returned.

Parameters
node
fallback
Returns
HPos
 
public getNodeHShrink(node: Node) : javafx.scene.layout.Priority

Utility function which returns the horizontal shrink priority of the Node, which defines whether the node's layout area should shrink if the container's width is less than its preferred width and multiple nodes are competing for that horizontal space.

Utility function which returns the horizontal shrink priority of the Node, which defines whether the node's layout area should shrink if the container's width is less than its preferred width and multiple nodes are competing for that horizontal space.

If the node has a non-null layoutInfo where hshrink is set, then that value is returned, else if the node is Resizable then its getHShrink() is returned, else Priority.NEVER is returned.

Parameters
node
Returns
Priority
 
public getNodeMargin(node: Node) : Insets

Utility function which returns the margin constraint of the Node if it was set on a LayoutInfo on the node's layoutInfo variable, else returns an Insets with top, right, bottom, and left equal to 0.

Utility function which returns the margin constraint of the Node if it was set on a LayoutInfo on the node's layoutInfo variable, else returns an Insets with top, right, bottom, and left equal to 0.

Parameters
node
Returns
Insets
 
public getNodeMaxHeight(node: Node) : Number

Utility function which returns the maximum height of the Node.

Utility function which returns the maximum height of the Node. Layout containers should not set the height of a Resizable node to a value greater than this value.

If the node is Resizable, the function first checks for a maxHeight value set on the node's layoutInfo variable (such a constraint indicates that the application overrode the Resizable's intrinsic maximum height). If no override exists, it returns the Resizable's intrinsic maximum height by calling getMaxHeight.

If the node is not Resizable, returns its current layout bounds height.

Parameters
node
Returns
Number
 
public getNodeMaxWidth(node: Node) : Number

Utility function which returns the maximum width of the Node.

Utility function which returns the maximum width of the Node. Layout containers should not set the width of a Resizable node to a value greater than this value.

If the node is Resizable, the function first checks for a maxWidth value set on the node's layoutInfo variable (such a constraint indicates that the application overrode the Resizable's intrinsic maximum width). If no override exists, it returns the Resizable's intrinsic maximum width by calling getMaxWidth.

If the node is not Resizable, returns its current layout bounds width.

Parameters
node
Returns
Number
 
public getNodeMinHeight(node: Node) : Number
Parameters
node
Returns
Number
 
public getNodeMinWidth(node: Node) : Number

Utility function which returns the minimum width of the Node.

Utility function which returns the minimum width of the Node. Layout containers should not set the width of a Resizable node to a value less than this value.

If the node is Resizable, the function first checks for a minWidth value set on the node's layoutInfo variable (such a constraint indicates that the application overrode the Resizable's intrinsic minimum width). If no override exists, it returns the Resizable's intrinsic minimum width by calling getMinWidth().

If the node is not Resizable, then its layout bounds width is returned.

Parameters
node
Returns
Number
 
public getNodePrefHeight(node: Node) : Number

Utility function which returns the preferred height of the Node.

Utility function which returns the preferred height of the Node. Layout containers should strive to set the height of the node to this value.

If the node is Resizable, the function first checks for a height value set on the node's layoutInfo variable (such a constraint indicates that the application overrode the Resizable's intrinsic preferred height). If no override exists, it returns the Resizable's intrinsic preferred height by calling getPrefHeight.

If the node is not Resizable, returns its current layout bounds width.

Parameters
node
Returns
Number
 
public getNodePrefHeight(node: Node, width: Number) : Number

Utility function which returns the preferred height of the Node for the given width.

Utility function which returns the preferred height of the Node for the given width. Layout containers should strive to set the height of the node to this value.

If the node is Resizable, the function first checks for a height value set on the node's layoutInfo variable (such a constraint indicates that the application overrode the Resizable's intrinsic preferred height). If no override exists, it returns the Resizable's intrinsic preferred height by calling getPrefHeight.

If the node is not Resizable, returns its current layout bounds width.

Parameters
node
width
Returns
Number
 
public getNodePrefWidth(node: Node) : Number

Utility function which returns the preferred width of the Node.

Utility function which returns the preferred width of the Node. Layout containers should strive to set the width of the node to this value.

If the node is Resizable, the function first checks for a width value set on the node's layoutInfo variable (such a constraint indicates that the application overrode the Resizable's intrinsic preferred width). If no override exists, it returns the Resizable's intrinsic preferred width by calling getPrefWidth.

If the node is not Resizable, returns its current layout bounds width.

Parameters
node
Returns
Number
 
public getNodePrefWidth(node: Node, height: Number) : Number

Utility function which returns the preferred width of the Node for the given height.

Utility function which returns the preferred width of the Node for the given height. Layout containers should strive to set the width of the node to this value.

If the node is Resizable, the function first checks for a width value set on the node's layoutInfo variable (such a constraint indicates that the application overrode the Resizable's intrinsic preferred width). If no override exists, it returns the Resizable's intrinsic preferred width by calling getPrefWidth.

If the node is not Resizable, returns its current layout bounds width.

Parameters
node
height
Returns
Number
 
public getNodeVFill(node: Node, fallback: Boolean) : Boolean

Utility function which returns the vertical fill constraint of the Node which defines whether the Resizable should be sized larger than its preferred height (up to its maximum) if it's Resizable and its layout area has additional vertical space.

Utility function which returns the vertical fill constraint of the Node which defines whether the Resizable should be sized larger than its preferred height (up to its maximum) if it's Resizable and its layout area has additional vertical space.

If the node has a non-null layoutInfo where hfill is set, then that value is returned, else if the node is Resizable then its getVFill() is returned, else the fallback is returned.

Parameters
node
fallback
Returns
Boolean
 
public getNodeVGrow(node: Node) : javafx.scene.layout.Priority

Utility function which returns the vertical grow priority of the Node, which defines whether the node's layout area should be allocated additional vertical space if a container has additional vertical space and multiple nodes are competing for it.

Utility function which returns the vertical grow priority of the Node, which defines whether the node's layout area should be allocated additional vertical space if a container has additional vertical space and multiple nodes are competing for it.

If the node has a non-null layoutInfo where vgrow is set, then that value is returned, else if the node is Resizable then its getVGrow() is returned, else Priority.NEVER is returned.

Parameters
node
Returns
Priority
 
public getNodeVPos(node: Node, fallback: VPos) : VPos

Utility function which returns the vertical layout position of the Node which defines how the node should be vertically aligned within its layout space if the height of the layout space is greater than the layout bounds height of the node.

Utility function which returns the vertical layout position of the Node which defines how the node should be vertically aligned within its layout space if the height of the layout space is greater than the layout bounds height of the node.

If the node has a non-null layoutInfo where vpos is set, then that value is returned, else the fallback is returned.

Parameters
node
fallback
Returns
VPos
 
public getNodeVShrink(node: Node) : javafx.scene.layout.Priority

Utility function which returns the vertical shrink priority of the Node, which defines whether the node's layout area should shrink if the container's height is less than its preferred height and multiple nodes are competing for that vertical space.

Utility function which returns the vertical shrink priority of the Node, which defines whether the node's layout area should shrink if the container's height is less than its preferred height and multiple nodes are competing for that vertical space.

If the node has a non-null layoutInfo where vshrink is set, then that value is returned, else if the node is Resizable then its getVShrink() is returned, else Priority.NEVER is returned.

Parameters
node
Returns
Priority
 
public layoutNode(node: Node, x: Number, y: Number, width: Number, height: Number) : Boolean

Utility function which Lays out the node so that it will be positioned at x,y and if its Resizable, will also set its size to width x height.

Utility function which Lays out the node so that it will be positioned at x,y and if its Resizable, will also set its size to width x height. If the node's width and/or height are bound values then the bound dimension(s) will not be altered. If either the width and/or height were resized, returns true else returns false. This function does not query the minimum, preferred, or maximum size preferences of the node, nor does it look at any LayoutInfo constraints.

Parameters
node
x
y
width
height
Returns
Boolean
 
public layoutNode(node: Node, x: Number, y: Number, width: Number, height: Number, snapToPixel: Boolean) : Boolean

Utility function which Lays out the node so that it will be positioned at x,y and if its Resizable, will be resized to width x height.

Utility function which Lays out the node so that it will be positioned at x,y and if its Resizable, will be resized to width x height. If the node's width and/or height are bound values then the bound dimension(s) will not be altered. If either the width and/or height were resized, returns true else returns false. If snapToPixel is true, then the resulting x,y and width/height values will be rounded to their nearest pixel boundaries.

This function does not query the minimum, preferred, or maximum size preferences of the node, nor does it look at any LayoutInfo constraints.

Parameters
node
x
y
width
height
snapToPixel
Returns
Boolean
 
public layoutNode(node: Node, areaX: Number, areaY: Number, areaWidth: Number, areaHeight: Number, hpos: HPos, vpos: VPos) : Boolean

Note: This function has been superseded by layoutNode function which supports vertical baseline alignment, filling, and snap-to-pixel capability.

Note: This function has been superseded by layoutNode function which supports vertical baseline alignment, filling, and snap-to-pixel capability.

Parameters
node
areaX
areaY
areaWidth
areaHeight
hpos
vpos
Returns
Boolean
 
public layoutNode(node: Node, areaX: Number, areaY: Number, areaWidth: Number, areaHeight: Number, areaBaselineOffset: Number, hfill: Boolean, vfill: Boolean, hpos: HPos, vpos: VPos, snapToPixel: Boolean) : Boolean

Utility function which lays out the node relative to the specified layout area defined by areaX, areaY, areaWidth x areaHeight, and a baseline offset relative to that area.

Utility function which lays out the node relative to the specified layout area defined by areaX, areaY, areaWidth x areaHeight, and a baseline offset relative to that area.

If the node is Resizable, then it will be both sized and positioned according to its layout constraints, including its minimum, preferred, and maximum sizes, as well as its fill and alignment preferences.

If the layout area's width/height is greater than the Resizable's preferred width/height, then this function uses the node's fill preference to determine how to resize it. If horizontal/vertical fill is true, then the Resizable will be resized to fill the width/height of the layout area (up to the Resizable's maximum width/height). If horizontal/vertical fill is false, then the Resizable will be kept to its preferred width/height, even though the layout area has more space. The horizontal/vertical fill values are calculated by first looking for LayoutInfo hfill and/or vfill overrides set on the node's layoutInfo, and if those are not present, then it uses the Resizable's intrinsic fill preferences defined by getHFill()/getVFill(). Note that the "hfill" and "vfill" fallback parameters on this function are no longer used, so just pass in Priority.NEVER.

If the layout area's width/height is smaller than the Resizable's preferred size, then the Resizable will be resized smaller to fit into the area (down to its minimum width/height).

The node's minimum, preferred, and maximum dimensions are calculated by first looking for LayoutInfo size overrides specified on the node's layoutInfo; if no overrides are present, then it uses the intrinsic size range returned by the Resizable's getMinWidth()/getMinHeight(), getPrefWidth()/getPrefHeight(), and getMaxWidth()/getMaxHeight() functions.

If the node's resulting layout bounds differs from the area's size (either because it was non-Resizable or it's sizing preferences prevented it), then this function will align the node relative to the area using horizontal and vertical position values. These position values are calculated by first looking for LayoutInfo vpos and/or hpos overrides set on the node's layoutInfo, and if those are not present then it uses the hpos and vpos fallbacks passed as parameters to this function. If vpos == VPos.BASELINE then the node's baseline will be aligned with the area baseline offset passed into the function.

If snapToPixel is true, then the resulting x,y and width/height values will be rounded to their nearest pixel boundaries.

Parameters
node
areaX
areaY
areaWidth
areaHeight
areaBaselineOffset
hfill
vfill
hpos
vpos
snapToPixel
Returns
Boolean
 
public positionNode(node: Node, x: Number, y: Number) : Void

Utility function which positions the node at x,y by setting layoutX and layoutY to translate the node from it's current layout bounds minX and minY values to x,y.

Utility function which positions the node at x,y by setting layoutX and layoutY to translate the node from it's current layout bounds minX and minY values to x,y.

Parameters
node
x
y
 
public positionNode(node: Node, x: Number, y: Number, snapToPixel: Boolean) : Void

Utility function which positions the node at x,y by setting layoutX and layoutY to translate the node from it's current layout bounds minX and minY location to x,y.

Utility function which positions the node at x,y by setting layoutX and layoutY to translate the node from it's current layout bounds minX and minY location to x,y. If snapToPixel is true, then the x/y position values will be rounded to their nearest pixel boundaries before calculating the layoutX/layoutY offsets.

Parameters
node
x
y
snapToPixel
 
public positionNode(node: Node, areaX: Number, areaY: Number, areaWidth: Number, areaHeight: Number, hpos: HPos, vpos: VPos) : Void

Utility function which positions the node relative to the specified layout area defined by areaX, areaY, areaWidth x areaHeight.

Utility function which positions the node relative to the specified layout area defined by areaX, areaY, areaWidth x areaHeight.

This function does not resize the node and uses the node's layout bounds width and height to determine how it should be positioned within the area. If the node's size differs from the area's size, then this function will align the node relative to the area using horizontal and vertical position values. These position values are calculated by first looking for vpos and/or hpos variables set on the node's layoutInfo, and if those are not present then it uses the hpos and vpos parameters passed into this function.

Parameters
node
areaX
areaY
areaWidth
areaHeight
hpos
vpos
 
public positionNode(node: Node, areaX: Number, areaY: Number, areaWidth: Number, areaHeight: Number, areaBaselineOffset: Number, hpos: HPos, vpos: VPos, snapToPixel: Boolean) : Void

Utility function which positions the node within the specified layout area defined by areaX, areaY, areaWidth x areaHeight, with a baseline offset relative to that area.

Utility function which positions the node within the specified layout area defined by areaX, areaY, areaWidth x areaHeight, with a baseline offset relative to that area.

This function does not resize the node and uses the node's layout bounds width and height to determine how it should be positioned within the area.

If the node has a layoutInfo set with values for margin, hpos, or vpos, those value will be used in computing the node's position within the specified area. If no position values are set on layoutInfo then the hpos and vpos parameters are used to determine alignment within the area.

If the node's vertical position (vpos) is VPos.BASELINE then it will position the node so that its own baseline aligns with the passed in baselineOffset, otherwise it will align the node vertically within areaHeight according to its vertical position value as described above.

If snapToPixel is true, then the x/y position values will be rounded to their nearest pixel boundaries before calculating the layoutX/layoutY offsets.

Parameters
node
areaX
areaY
areaWidth
areaHeight
areaBaselineOffset
hpos
vpos
snapToPixel

Profile: common

 
public resizeNode(node: Node, width: Number, height: Number) : Boolean

Utility function which resizes the node if possible.

Utility function which resizes the node if possible. If the node is Resizable and either its width and/or height variables are not bound, then this function sets the width and/or height and returns true. If width and height are bound or the node is not Resizable then this function does nothing and returns false.

Parameters
node
width
height
Returns
Boolean
 
public resizeNode(node: Node, width: Number, height: Number, snapToPixel: Boolean) : Boolean

Utility function which resizes the node if possible.

Utility function which resizes the node if possible. If the node is Resizable and either its width and/or height variables are not bound, then this function sets the width and/or height and returns true. If width and height are bound or the node is not Resizable then this function does nothing and returns false. If snapToPixel is true, then the width/height values will be rounded to their nearest pixel boundaries.

Parameters
node
width
height
snapToPixel
Returns
Boolean
 
public setNodeHeight(node: Node, height: Number) : Boolean

Utility function which resizes the node's height if possible.

Utility function which resizes the node's height if possible. If the node is Resizable and its height is not bound, sets the height and returns true, else does nothing and returns false.

Parameters
node
height
Returns
Boolean
 
public setNodeHeight(node: Node, height: Number, snapToPixel: Boolean) : Boolean

Utility function which resizes the node's height if possible.

Utility function which resizes the node's height if possible. If the node is Resizable and its height is not bound, sets the height and returns true, else does nothing and returns false. If snapToPixel is true, then height will be rounded to its nearest pixel boundary.

Parameters
node
height
snapToPixel
Returns
Boolean
 
public setNodeWidth(node: Node, width: Number) : Boolean

Utility function which resizes the node's width if possible.

Utility function which resizes the node's width if possible. If the node is Resizable and its width is not bound, sets the width and returns true, else does nothing and returns false.

Parameters
node
width
Returns
Boolean
 
public setNodeWidth(node: Node, width: Number, snapToPixel: Boolean) : Boolean

Utility function which resizes the node's width if possible.

Utility function which resizes the node's width if possible. If the node is Resizable and its width is not bound, sets the width and returns true, else does nothing and returns false. If snapToPixel is true, then width will be rounded to its nearest pixel boundary.

Parameters
node
width
snapToPixel
Returns
Boolean
 

Function Summary

protected bound computeBaselineOffset() : Number

Computes the baseline offset for this container by returning the baseline location of the first managed content node, else returns the container's layoutBounds.height.

Computes the baseline offset for this container by returning the baseline location of the first managed content node, else returns the container's layoutBounds.height.

Returns
Number

Profile: common

 
protected doLayout() : Void

Invoked during the layout pass to layout the managed content nodes in this Container.

Invoked during the layout pass to layout the managed content nodes in this Container. 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.

 
getPrefHeight(width: Number) : Number

Returns the preferred height of this container.

Returns the preferred height of this container. The default implementation of this function returns the height required to encompass the preferred layout bounds of all managed content. The width parameter is ignored.

Subclasses should override this function to return the height needed to layout their content.

Parameters
width
Returns
Number
 
getPrefWidth(height: Number) : Number

Returns the preferred width of this container.

Returns the preferred width of this container. The default implementation of this function returns the width required to encompass the preferred layout bounds of all managed content. The height parameter is ignored.

Subclasses should override this function to return the width needed to layout their content.

Parameters
height
Returns
Number
 
requestLayout() : Void
 

Inherited Functions

javafx.scene.Parent

public layout() : Void

Executes a top-down layout pass on the scene graph under this parent.

Executes a top-down layout pass on the scene graph under this parent.

 
public lookup(id: java.lang.String) : Node
Parameters
id
Returns
Node
 
public requestLayout() : Void

Requests a layout pass to be performed before the next scene is rendered.

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 requestLayout will be invoked on its parent.

 

javafx.scene.Node

public contains(localX: Number, localY: Number) : Boolean

Returns true if the given point (specified in the local coordinate space of this Node) is contained within the shape of this Node.

Returns true if the given point (specified in the local coordinate space of this Node) is contained within the shape of this Node. Note that this method does not take visibility into account; the test is based on the geometry of this Node only.

Parameters
localX
localY
Returns
Boolean

Profile: common

 
public contains(localPoint: Point2D) : Boolean

Returns true if the given point (specified in the local coordinate space of this Node) is contained within the shape of this Node.

Returns true if the given point (specified in the local coordinate space of this Node) is contained within the shape of this Node. Note that this method does not take visibility into account; the test is based on the geometry of this Node only.

Parameters
localPoint
Returns
Boolean

Profile: common

 
public intersects(localX: Number, localY: Number, localWidth: Number, localHeight: Number) : Boolean

Returns true if the given rectangle (specified in the local coordinate space of this Node) intersects the shape of this Node.

Returns true if the given rectangle (specified in the local coordinate space of this Node) intersects the shape of this Node. Note that this method does not take visibility into account; the test is based on the geometry of this Node only. The default behavior of this function is simply to check if the given coordinates intersect with the local bounds.

Parameters
localX
localY
localWidth
localHeight
Returns
Boolean

Profile: common

 
public intersects(localBounds: Bounds) : Boolean

Returns true if the given bounds (specified in the local coordinate space of this Node) intersects the shape of this Node.

Returns true if the given bounds (specified in the local coordinate space of this Node) intersects the shape of this Node. Note that this method does not take visibility into account; the test is based on the geometry of this Node only. The default behavior of this function is simply to check if the given coordinates intersect with the local bounds.

Parameters
localBounds
Returns
Boolean

Profile: common

 
public localToParent(localX: Number, localY: Number) : Point2D

Transforms a point from the local coordinate space of this Node into the coordinate space of its parent.

Transforms a point from the local coordinate space of this Node into the coordinate space of its parent.

Parameters
localX
localY
Returns
Point2D

Profile: common

 
public localToParent(localPoint: Point2D) : Point2D

Transforms a point from the local coordinate space of this Node into the coordinate space of its parent.

Transforms a point from the local coordinate space of this Node into the coordinate space of its parent.

Parameters
localPoint
Returns
Point2D

Profile: common

 
public localToParent(localBounds: Bounds) : Bounds

Transforms a bounds from the local coordinate space of this Node into the coordinate space of its parent.

Transforms a bounds from the local coordinate space of this Node into the coordinate space of its parent.

Parameters
localBounds
Returns
Bounds

Profile: common

 
public localToScene(localX: Number, localY: Number) : Point2D

Transforms a point from the local coordinate space of this Node into the coordinate space of its javafx.scene.Scene.

Transforms a point from the local coordinate space of this Node into the coordinate space of its javafx.scene.Scene.

Parameters
localX
localY
Returns
Point2D

Profile: common

 
public localToScene(localPoint: Point2D) : Point2D

Transforms a point from the local coordinate space of this Node into the coordinate space of its javafx.scene.Scene.

Transforms a point from the local coordinate space of this Node into the coordinate space of its javafx.scene.Scene.

Parameters
localPoint
Returns
Point2D

Profile: common

 
public localToScene(localBounds: Bounds) : Bounds

Transforms a bounds from the local coordinate space of this Node into the coordinate space of its javafx.scene.Scene.

Transforms a bounds from the local coordinate space of this Node into the coordinate space of its javafx.scene.Scene.

Parameters
localBounds
Returns
Bounds

Profile: common

 
public lookup(id: java.lang.String) : Node

Finds this Node, or the first subnode, with the given id.

Finds this Node, or the first subnode, with the given id. If this node is a Parent, then this function will traverse down into the branch until it finds a match. If more than one subnode has the specified id, this function returns one of them. Which node it returns in that case is unspecified.

Parameters
id
The id of the node to find
Returns
Node
The first node, starting from this Node , which has an id of id .

Profile: common

 
public parentToLocal(parentX: Number, parentY: Number) : Point2D

Transforms a point from the coordinate space of the parent into the local coordinate space of this Node.

Transforms a point from the coordinate space of the parent into the local coordinate space of this Node.

Parameters
parentX
parentY
Returns
Point2D

Profile: common

 
public parentToLocal(parentPoint: Point2D) : Point2D

Transforms a point from the coordinate space of the parent into the local coordinate space of this Node.

Transforms a point from the coordinate space of the parent into the local coordinate space of this Node.

Parameters
parentPoint
Returns
Point2D

Profile: common

 
public parentToLocal(parentBounds: Bounds) : Bounds

Transforms a rectangle from the coordinate space of the parent into the local coordinate space of this Node.

Transforms a rectangle from the coordinate space of the parent into the local coordinate space of this Node.

Parameters
parentBounds
Returns
Bounds

Profile: common

 
public requestFocus() : Void

Requests that this Node get the input focus, and that this Node's top-level ancestor become the focused window.

Requests that this Node get the input focus, and that this Node's top-level ancestor become the focused window. To be eligible to receive the focus, the node must be part of a scene, it and all of its ancestors must be visible, and it must not be disabled. If this node is eligible, this function will cause it to become this Scene's "focus owner". Each scene has at most one focus owner node. The focus owner will not actually have the input focus, however, unless the scene belongs to a Stage that is both visible and active.

Profile: common

 
public sceneToLocal(sceneX: Number, sceneY: Number) : Point2D

Transforms a point from the coordinate space of the Scene into the local coordinate space of this Node.

Transforms a point from the coordinate space of the Scene into the local coordinate space of this Node.

Parameters
sceneX
sceneY
Returns
Point2D

Profile: common

 
public sceneToLocal(scenePoint: Point2D) : Point2D

Transforms a point from the coordinate space of the javafx.scene.Scene into the local coordinate space of this Node.

Transforms a point from the coordinate space of the javafx.scene.Scene into the local coordinate space of this Node.

Parameters
scenePoint
Returns
Point2D

Profile: common

 
public sceneToLocal(sceneBounds: Bounds) : Bounds

Transforms a rectangle from the coordinate space of the javafx.scene.Scene into the local coordinate space of this Node.

Transforms a rectangle from the coordinate space of the javafx.scene.Scene into the local coordinate space of this Node.

Parameters
sceneBounds
Returns
Bounds

Profile: common

 
public toBack() : Void

Moves this Node to the back of its sibling nodes in terms of z-order.

Moves this Node to the back of its sibling nodes in terms of z-order. This is accomplished by moving this Node to the first position in its parent's content sequence. This function has no effect if this Node is not part of a group.

Profile: common

 
public toFront() : Void

Moves this Node to the front of its sibling nodes in terms of z-order.

Moves this Node to the front of its sibling nodes in terms of z-order. This is accomplished by moving this Node to the last position in its parent's content sequence. This function has no effect if this Node is not part of a group.

Profile: common

 
public toString() : java.lang.String
Returns
String
 

javafx.scene.layout.Resizable

public getHFill() : Boolean

Returns the Resizable's horizontal fill preference, which indicates whether or not the Resizable's width should be resized beyond its preferred width (up to its maximum) to fill it's allocated layout area.

Returns the Resizable's horizontal fill preference, which indicates whether or not the Resizable's width should be resized beyond its preferred width (up to its maximum) to fill it's allocated layout area.

All container classes (HBox, VBox, Stack, Flow(vertical), Tile) consult this preference when resizing Resizable children.

An application may override the horizontal fill of a Resizable node using LayoutInfo:


      Label {
          layoutInfo: LayoutInfo { hfill: true }
      }
 

This function returns false by default; Resizable subclasses should override this function to return an appropriate value.

Returns
Boolean
 
public getHGrow() : javafx.scene.layout.Priority

Returns the Resizable's horizontal grow priority which determines whether it's layout area is given more horizontal space if its available.

Returns the Resizable's horizontal grow priority which determines whether it's layout area is given more horizontal space if its available.

The horizontal grow priority is only used if the parent container is resized larger than its preferred width and multiple nodes are competing for extra horizontal space, which for the concrete containers is only applicable to HBox. Note that growing applies only to the layout area assigned to the Resizable; how the Resizable is sized with respect to that area is determined separately by its size and fill preferences (see getPrefWidth and getPrefHFill).

If ALWAYS, the Resizable's layout area will always grow horizontally if there is additional space, sharing the increase with other nodes that have an hgrow of ALWAYS. The Resizable's layout area will never be grown beyond the Resizable's maximum width.

If SOMETIMES, the Resizable's layout area will only grow horizontally if either no other node has specified ALWAYS, or the additional space was not completely allocated to nodes specifying ALWAYS because of their maximum size limits.

If NEVER, the Resizable's layout area will never be grown horizontally if there is additional space.

If the Resizable returns ALWAYS or SOMETIMES, then getHFill should typically return true to ensure the node will be resized beyond its preferred to take advantage of its larger layout area.

An application may override the horizontal grow priority of a Resizable node using LayoutInfo:


      Label {
          layoutInfo: LayoutInfo { hgrow: Priority.ALWAYS }
      }
 

This function returns Priority.NEVER by default; Resizable subclasses should override this function to return an appropriate value.

Returns
Priority
 
public getHShrink() : javafx.scene.layout.Priority

Returns the Resizable's horizontal shrink priority, which determines whether it's layout area is given less horizontal space if its parent is resized smaller than its preferred width.

Returns the Resizable's horizontal shrink priority, which determines whether it's layout area is given less horizontal space if its parent is resized smaller than its preferred width.

The horizontal shrink priority is only used if the parent container is resized smaller than its preferred width and multiple nodes are competing for horizontal space, which for the concrete containers is only applicable to HBox.

If ALWAYS, the Resizable's layout area will always shrink horizontally if there is less space, sharing the decrease with other nodes that have an hshrink of ALWAYS. The Resizable's layout area will never be sized smaller than the node's minimum width.

If SOMETIMES, the Resizable's layout area will only shrink horizontally if either no other node has specified ALWAYS, or the reduced space was not completely distributed to nodes specifying ALWAYS because of their minimum size limits.

If NEVER, the Resizable's layout area will never be shrunken horizontally if there is reduced space.

An application may override the horizontal shrink priority of a Resizable node using LayoutInfo:


      Label {
          layoutInfo: LayoutInfo { hshrink: Priority.ALWAYS }
      }
 

This function returns Priority.NEVER by default; Resizable subclasses should override this function to return an appropriate value.

Returns
Priority
 
public getMaxHeight() : Number

Returns the Resizable's maximum height.

Returns the Resizable's maximum height. Layout containers should strive not to set the Resizable's height larger than this value. This value is computed by the node subclass using applicable state and variable settings and is not directly settable by applications.

An application may override the maximum height of a Resizable node using LayoutInfo:


      Label {
          layoutInfo: LayoutInfo { maxHeight: 30 }
      }
 

This function returns Integer.MAX_VALUE by default; Resizable subclasses should override this function to return an appropriate value.

Returns
Number

Profile: common

 
public getMaxWidth() : Number

Returns the Resizable's maximum width.

Returns the Resizable's maximum width. Layout containers should strive not to set the Resizable's width larger than this value. This value is computed by the node subclass using applicable state and variable settings and is not directly settable by applications.

An application may override the maximum width of a Resizable node using LayoutInfo:


      Label {
          layoutInfo: LayoutInfo { maxWidth: 30 }
      }
 

This function returns Integer.MAX_VALUE by default; Resizable subclasses should override this function to return an appropriate value.

Returns
Number

Profile: common

 
public getMinHeight() : Number

Returns the Resizable's minimum height.

Returns the Resizable's minimum height. Layout containers should strive not to set the Resizable's height smaller than this value. This value is computed by the node subclass using applicable state and variable settings and is not directly settable by applications.

An application may override the minimum height of a Resizable node using LayoutInfo:


      Label {
          layoutInfo: LayoutInfo { minHeight: 30 }
      }
 

This function returns 0 by default; Resizable subclasses should override this function to return an appropriate value.

Returns
Number

Profile: common

 
public getMinWidth() : Number

Returns the Resizable's minimum width.

Returns the Resizable's minimum width. Layout containers should strive not to set the Resizable's width smaller than this value. This value is calculated by the node subclass using applicable state and variable settings and is not directly settable by applications.

An application may override the minimum width of a Resizable node using LayoutInfo:


      Label {
          layoutInfo: LayoutInfo { minWidth: 50 }
      }
 

This function returns 0 by default; Resizable subclasses should override this function to return an appropriate value.

Returns
Number

Profile: common

 
public abstract getPrefHeight(width: Number) : Number

Returns the Resizable's preferred height, given the specified width.

Returns the Resizable's preferred height, given the specified width. If a particular width need not be factored into the result, -1 may be passed in as the width parameter. Implementations of this function may also choose to ignore width if it does not impact the result.

Layout containers should set the Resizable's height to this value whenever possible. This value is computed by the node subclass using applicable state and variable settings and is not directly settable by applications.

An application may override the preferred height of a Resizable node using LayoutInfo:


      Label {
          layoutInfo: LayoutInfo { height: 80 }
      }
 

Resizable subclasses must override this function to return an appropriate value.

Parameters
width
Returns
Number

Profile: common

 
public abstract getPrefWidth(height: Number) : Number

Returns the Resizable's preferred width, given the specified height.

Returns the Resizable's preferred width, given the specified height. If a particular height need not be factored into the result, -1 may be passed in as the height parameter. Implementations of this function may also choose to ignore height if it does not impact the result.

Layout containers should set the Resizable's width to this value whenever possible. This value is computed by the node subclass using applicable state and variable settings and is not directly settable by applications.

An application may override the preferred width of a Resizable node using LayoutInfo:


      Label {
          layoutInfo: LayoutInfo { width: 50 }
      }
 

Resizable subclasses must override this function to return an appropriate value.

Parameters
height
Returns
Number

Profile: common

 
public getVFill() : Boolean

Returns the Resizable's vertical fill preference, which indicates whether or not the Resizable's height should be resized beyond its preferred height (up to its maximum) to fill it's allocated layout area.

Returns the Resizable's vertical fill preference, which indicates whether or not the Resizable's height should be resized beyond its preferred height (up to its maximum) to fill it's allocated layout area.

All container classes (HBox, VBox, Stack, Flow(horizontal), Tile) consult this preference when resizing Resizable children.

An application may override the vertical fill of a Resizable node using LayoutInfo:


      Label {
          layoutInfo: LayoutInfo { vfill: true }
      }
 

This function returns false by default; Resizable subclasses should override this function to return an appropriate value.

Returns
Boolean
 
public getVGrow() : javafx.scene.layout.Priority

Returns the Resizable's vertical grow priority, which determines whether it's layout area is given more vertical space if its available.

Returns the Resizable's vertical grow priority, which determines whether it's layout area is given more vertical space if its available.

The vertical grow priority is only used if the parent container is resized larger than its preferred height and multiple nodes are competing for extra vertical space, which for the concrete containers is only applicable to VBox. Note that growing applies only to the layout area assigned to the Resizable; how the Resizable is sized with respect to that area is determined separately by its size and fill preferences (see getPrefHeight and getPrefVFill).

If ALWAYS, the Resizable's layout area will always grow vertically if there is additional space, sharing the increase with other nodes that have an vgrow of ALWAYS. The Resizable's layout area will never be grown beyond the Resizable's maximum height.

If SOMETIMES, the Resizable's layout area will only grow vertically if either no other node has specified ALWAYS, or the additional space was not completely allocated to nodes specifying ALWAYS because of their maximum size limits.

If NEVER, the Resizable's layout area will never be grown vertically if there is additional space.

If the Resizable returns ALWAYS or SOMETIMES, then getVFill should typically return true to ensure the node will be resized beyond its preferred to take advantage of its larger layout area.

An application may override the vertical grow priority of a Resizable node using LayoutInfo:


      Label {
          layoutInfo: LayoutInfo { vgrow: Priority.ALWAYS }
      }
 

This function returns Priority.NEVER by default; Resizable subclasses should override this function to return an appropriate value.

Returns
Priority
 
public getVShrink() : javafx.scene.layout.Priority

Returns the Resizable's vertical shrink priority, which determines whether it's layout area is given less vertical space if its parent is resized smaller than its preferred height.

Returns the Resizable's vertical shrink priority, which determines whether it's layout area is given less vertical space if its parent is resized smaller than its preferred height.

The vertical shrink priority is only used if the parent container is resized smaller than its preferred height and multiple nodes are competing for vertical space, which for the concrete containers is only applicable to VBox.

If ALWAYS, the Resizable's layout area will always shrink vertically if there is less space, sharing the decrease with other nodes that have an vshrink of ALWAYS. The Resizable's layout area will never be sized smaller than the node's minimum height.

If SOMETIMES, the Resizable's layout area will only shrink vertically if either no other node has specified ALWAYS, or the reduced space was not completely distributed to nodes specifying ALWAYS because of their minimum size limits.

If NEVER, the Resizable's layout area will never be shrunken vertically if there is reduced space.

An application may override the vertical shrink priority of a Resizable node using LayoutInfo:


      Label {
          layoutInfo: LayoutInfo { vshrink: Priority.ALWAYS }
      }
 

This function returns Priority.NEVER by default; Resizable subclasses should override this function to return an appropriate value.

Returns
Priority