@IDProperty(value="id") public abstract class Node extends java.lang.Object implements EventTarget, Styleable
Each item in the scene graph is called a Node
. Branch nodes are
of type Parent
, whose concrete subclasses are Group
,
Region
, and Control
,
or subclasses thereof.
Leaf nodes are classes such as
Rectangle
, Text
,
ImageView
, MediaView
,
or other such leaf classes which cannot have children. Only a single node within
each scene graph tree will have no parent, which is referred to as the "root" node.
There may be several trees in the scene graph. Some trees may be part of
a Scene
, in which case they are eligible to be displayed.
Other trees might not be part of any Scene
.
A node may occur at most once anywhere in the scene graph. Specifically,
a node must appear no more than once in all of the following:
as the root node of a Scene
,
the children ObservableList of a Parent
,
or as the clip of a Node
.
The scene graph must not have cycles. A cycle would exist if a node is
an ancestor of itself in the tree, considering the Group
content
ObservableList, Parent
children ObservableList, and Node
clip relationships
mentioned above.
If a program adds a child node to a Parent (including Group, Region, etc) and that node is already a child of a different Parent or the root of a Scene, the node is automatically (and silently) removed from its former parent. If a program attempts to modify the scene graph in any other way that violates the above rules, an exception is thrown, the modification attempt is ignored and the scene graph is restored to its previous state.
It is possible to rearrange the structure of the scene graph, for example, to move a subtree from one location in the scene graph to another. In order to do this, one would normally remove the subtree from its old location before inserting it at the new location. However, the subtree will be automatically removed as described above if the application doesn't explicitly remove it.
Node objects may be constructed and modified on any thread as long they are
not yet attached to a Scene
in a Window
that is showing.
An application must attach nodes to such a Scene or modify them on the JavaFX
Application Thread.
Each node in the scene graph can be given a unique id
. This id is
much like the "id" attribute of an HTML tag in that it is up to the designer
and developer to ensure that the id
is unique within the scene graph.
A convenience function called lookup(String)
can be used to find
a node with a unique id within the scene graph, or within a subtree of the
scene graph. The id can also be used identify nodes for applying styles; see
the CSS section below.
The Node
class defines a traditional computer graphics "local"
coordinate system in which the x
axis increases to the right and the
y
axis increases downwards. The concrete node classes for shapes
provide variables for defining the geometry and location of the shape
within this local coordinate space. For example,
Rectangle
provides x
, y
,
width
, height
variables while
Circle
provides centerX
, centerY
,
and radius
.
At the device pixel level, integer coordinates map onto the corners and
cracks between the pixels and the centers of the pixels appear at the
midpoints between integer pixel locations. Because all coordinate values
are specified with floating point numbers, coordinates can precisely
point to these corners (when the floating point values have exact integer
values) or to any location on the pixel. For example, a coordinate of
(0.5, 0.5)
would point to the center of the upper left pixel on the
Stage
. Similarly, a rectangle at (0, 0)
with dimensions
of 10
by 10
would span from the upper left corner of the
upper left pixel on the Stage
to the lower right corner of the
10th pixel on the 10th scanline. The pixel center of the last pixel
inside that rectangle would be at the coordinates (9.5, 9.5)
.
In practice, most nodes have transformations applied to their coordinate
system as mentioned below. As a result, the information above describing
the alignment of device coordinates to the pixel grid is relative to
the transformed coordinates, not the local coordinates of the nodes.
The Shape
class describes some additional
important context-specific information about coordinate mapping and how
it can affect rendering.
Any Node
can have transformations applied to it. These include
translation, rotation, scaling, or shearing.
A translation transformation is one which shifts the origin of the
node's coordinate space along either the x or y axis. For example, if you
create a Rectangle
which is drawn at the origin
(x=0, y=0) and has a width of 100 and a height of 50, and then apply a
Translate
with a shift of 10 along the x axis
(x=10), then the rectangle will appear drawn at (x=10, y=0) and remain
100 points wide and 50 tall. Note that the origin was shifted, not the
x
variable of the rectangle.
A common node transform is a translation by an integer distance, most often used to lay out nodes on the stage. Such integer translations maintain the device pixel mapping so that local coordinates that are integers still map to the cracks between pixels.
A rotation transformation is one which rotates the coordinate space of
the node about a specified "pivot" point, causing the node to appear rotated.
For example, if you create a Rectangle
which is
drawn at the origin (x=0, y=0) and has a width of 100 and height of 30 and
you apply a Rotate
with a 90 degree rotation
(angle=90) and a pivot at the origin (pivotX=0, pivotY=0), then
the rectangle will be drawn as if its x and y were zero but its height was
100 and its width -30. That is, it is as if a pin is being stuck at the top
left corner and the rectangle is rotating 90 degrees clockwise around that
pin. If the pivot point is instead placed in the center of the rectangle
(at point x=50, y=15) then the rectangle will instead appear to rotate about
its center.
Note that as with all transformations, the x, y, width, and height variables of the rectangle (which remain relative to the local coordinate space) have not changed, but rather the transformation alters the entire coordinate space of the rectangle.
A scaling transformation causes a node to either appear larger or
smaller depending on the scaling factor. Scaling alters the coordinate space
of the node such that each unit of distance along the axis in local
coordinates is multipled by the scale factor. As with rotation
transformations, scaling transformations are applied about a "pivot" point.
You can think of this as the point in the Node around which you "zoom". For
example, if you create a Rectangle
with a
strokeWidth
of 5, and a width and height of 50, and you apply a
Scale
with scale factors (x=2.0, y=2.0) and
a pivot at the origin (pivotX=0, pivotY=0), the entire rectangle
(including the stroke) will double in size, growing to the right and
downwards from the origin.
A shearing transformation, sometimes called a skew, effectively rotates one axis so that the x and y axes are no longer perpendicular.
Multiple transformations may be applied to a node by specifying an ordered
chain of transforms. The order in which the transforms are applied is
defined by the ObservableList specified in the transforms
variable.
Since every Node
has transformations, every Node's geometric
bounding rectangle can be described differently depending on whether
transformations are accounted for or not.
Each Node
has a read-only boundsInLocal
variable which specifies the bounding rectangle of the Node
in
untransformed local coordinates. boundsInLocal
includes the
Node's shape geometry, including any space required for a
non-zero stroke that may fall outside the local position/size variables,
and its clip
and effect
variables.
Each Node
also has a read-only boundsInParent
variable which
specifies the bounding rectangle of the Node
after all transformations
have been applied, including those set in transforms
,
scaleX
/scaleY
, rotate
,
translateX
/translateY
, and layoutX
/layoutY
.
It is called "boundsInParent" because the rectangle will be relative to the
parent's coordinate system. This is the 'visual' bounds of the node.
Finally, the layoutBounds
variable defines the rectangular bounds of
the Node
that should be used as the basis for layout calculations and
may differ from the visual bounds of the node. For shapes, Text, and ImageView,
layoutBounds by default includes only the shape geometry, including space required
for a non-zero strokeWidth
, but does not include the effect,
clip, or any transforms. For resizable classes (Regions and Controls)
layoutBounds will always map to 0,0 width x height
.
The image shows a node without any transformation and its boundsInLocal
:
boundsInParent
in the
coordinate space of the Node's parent. The boundsInLocal
stays the same
as in the first image, the green rectangle in this image represents boundsInLocal
in the coordinate space of the Node.
The images show a filled and stroked rectangle and their bounds. The
first rectangle [x:10.0 y:10.0 width:100.0 height:100.0 strokeWidth:0]
has the following bounds bounds: [x:10.0 y:10.0 width:100.0 height:100.0]
.
The second rectangle [x:10.0 y:10.0 width:100.0 height:100.0 strokeWidth:5]
has the following bounds: [x:7.5 y:7.5 width:105 height:105]
(the stroke is centered by default, so only half of it is outside
of the original bounds; it is also possible to create inside or outside
stroke).
Since neither of the rectangles has any transformation applied,
boundsInParent
and boundsInLocal
are the same.
The Node
class contains id
, styleClass
, and
style
variables that are used in styling this node from
CSS. The id
and styleClass
variables are used in
CSS style sheets to identify nodes to which styles should be
applied. The style
variable contains style properties and
values that are applied directly to this node.
For further information about CSS and how to apply CSS styles to nodes, see the CSS Reference Guide.
Modifier and Type | Class and Description |
---|---|
private class |
Node.AccessibilityProperties |
private class |
Node.EffectiveOrientationProperty |
(package private) class |
Node.FocusedProperty
Special boolean property which allows for atomic focus change.
|
private static class |
Node.LazyBoundsProperty |
private static class |
Node.LazyTransformProperty |
private class |
Node.MiscProperties |
private class |
Node.NodeTransformation |
private class |
Node.ReadOnlyObjectWrapperManualFire<T> |
private static class |
Node.StyleableProperties
Super-lazy instantiation pattern from Bill Pugh.
|
(package private) class |
Node.TreeVisiblePropertyReadOnly |
Modifier and Type | Field and Description |
---|---|
private BaseBounds |
_geomBounds
A temporary rect used for computing bounds by the various bounds
variables.
|
private BaseBounds |
_txBounds |
(package private) Node.AccessibilityProperties |
accessibilityProperties |
(package private) Accessible |
accessible |
private ObjectProperty<AccessibleRole> |
accessibleRole
The accessible role for this
Node . |
private static byte |
AUTOMATIC_ORIENTATION_LTR |
private static byte |
AUTOMATIC_ORIENTATION_MASK |
private static byte |
AUTOMATIC_ORIENTATION_RTL |
static double |
BASELINE_OFFSET_SAME_AS_HEIGHT
This is a special value that might be returned by
getBaselineOffset() . |
private ObjectProperty<BlendMode> |
blendMode
The
BlendMode used to blend this individual node
into the scene behind it. |
private static BoundsAccessor |
boundsAccessor |
(package private) boolean |
boundsChanged
This special flag is used only by Parent to flag whether or not
the *parent* has processed the fact that bounds have changed for this
child Node.
|
private boolean |
canReceiveFocus |
private Node |
clipParent
If this Node is being used as the clip of another Node, that other node
is referred to as the clipParent.
|
(package private) CssFlags |
cssFlag
Flags used to indicate in which way this node is dirty (or whether it
is clean) and what must happen during the next CSS cycle on the
scenegraph.
|
private static boolean |
DEFAULT_CACHE |
private static CacheHint |
DEFAULT_CACHE_HINT |
private static Node |
DEFAULT_CLIP |
private static Cursor |
DEFAULT_CURSOR |
private static DepthTest |
DEFAULT_DEPTH_TEST |
private static boolean |
DEFAULT_DISABLE |
private static Effect |
DEFAULT_EFFECT |
private static InputMethodRequests |
DEFAULT_INPUT_METHOD_REQUESTS |
private static boolean |
DEFAULT_MOUSE_TRANSPARENT |
private static double |
DEFAULT_ROTATE |
private static Point3D |
DEFAULT_ROTATION_AXIS |
private static double |
DEFAULT_SCALE_X |
private static double |
DEFAULT_SCALE_Y |
private static double |
DEFAULT_SCALE_Z |
private static double |
DEFAULT_TRANSLATE_X |
private static double |
DEFAULT_TRANSLATE_Y |
private static double |
DEFAULT_TRANSLATE_Z |
private boolean |
derivedDepthTest |
private int |
dirtyBits
Set of dirty bits that are set when state is invalidated and cleared by
the updateState method, which is called from the synchronizer.
|
private ReadOnlyBooleanWrapper |
disabled
Indicates whether or not this
Node is disabled. |
private static PseudoClass |
DISABLED_PSEUDOCLASS_STATE |
private static byte |
EFFECTIVE_ORIENTATION_LTR |
private static byte |
EFFECTIVE_ORIENTATION_MASK |
private static byte |
EFFECTIVE_ORIENTATION_RTL |
private Node.EffectiveOrientationProperty |
effectiveNodeOrientationProperty |
private static double |
EPSILON_ABSOLUTE |
private ObjectProperty<EventDispatcher> |
eventDispatcher
Specifies the event dispatcher for this node.
|
private EventHandlerProperties |
eventHandlerProperties
*
Event Handler Properties *
*
|
private Node.FocusedProperty |
focused
Indicates whether this
Node currently has the input focus. |
private static PseudoClass |
FOCUSED_PSEUDOCLASS_STATE |
private BooleanProperty |
focusTraversable
Specifies whether this
Node should be a part of focus traversal
cycle. |
private BaseBounds |
geomBounds
The cached bounds.
|
private boolean |
geomBoundsInvalid |
private ReadOnlyBooleanWrapper |
hover
Whether or not this
Node is being hovered over. |
private static PseudoClass |
HOVER_PSEUDOCLASS_STATE |
private StringProperty |
id
The id of this
Node . |
private BooleanProperty |
impl_showMnemonics
Deprecated.
This is an internal API that is not intended for use and will be removed in the next version
|
private NodeEventDispatcher |
internalEventDispatcher |
private Node |
labeledBy
References a node that is a labelFor this node.
|
private Node.LazyBoundsProperty |
layoutBounds
The rectangular bounds that should be used for layout calculations for
this node.
|
private DoubleProperty |
layoutX
Defines the x coordinate of the translation that is added to this
Node 's
transform for the purpose of layout. |
private DoubleProperty |
layoutY
Defines the y coordinate of the translation that is added to this
Node 's
transform for the purpose of layout. |
private BaseBounds |
localBounds
The cached local bounds (without transforms, with clip and effects).
|
private boolean |
localBoundsInvalid |
private BaseTransform |
localToParentTx
An affine transform that holds the computed local-to-parent transform.
|
private BooleanProperty |
managed
Defines whether or not this node's layout will be managed by it's parent.
|
private Node.MiscProperties |
miscProperties
*
Misc Seldom Used Properties *
*
|
private ObjectProperty<NodeOrientation> |
nodeOrientation
*
Component Orientation Properties *
*
|
private Node.NodeTransformation |
nodeTransformation |
private DoubleProperty |
opacity
Specifies how opaque (that is, solid) the
Node appears. |
private ReadOnlyObjectWrapper<Parent> |
parent
The parent of this
Node . |
private InvalidationListener |
parentDisabledChangedListener |
private InvalidationListener |
parentTreeVisibleChangedListener |
private NGNode |
peer
The peer node created by the graphics Toolkit/Pipeline implementation
|
private boolean |
pendingUpdateBounds |
private BooleanProperty |
pickOnBounds
Defines how the picking computation is done for this node when
triggered by a
MouseEvent or a contains function call. |
private EventDispatcher |
preprocessMouseEventDispatcher
Event dispatcher for invoking preprocessing of mouse events
|
private ReadOnlyBooleanWrapper |
pressed
Whether or not the
Node is pressed. |
private static PseudoClass |
PRESSED_PSEUDOCLASS_STATE |
private ObservableMap<java.lang.Object,java.lang.Object> |
properties |
(package private) ObservableSet<PseudoClass> |
pseudoClassStates |
private byte |
resolvedNodeOrientation |
private Node.ReadOnlyObjectWrapperManualFire<Scene> |
scene
The
Scene that this Node is part of. |
private static PseudoClass |
SHOW_MNEMONICS_PSEUDOCLASS_STATE |
private StringProperty |
style
A string representation of the CSS style associated with this
specific
Node . |
private ObservableList<java.lang.String> |
styleClass
A list of String identifiers which can be used to logically group
Nodes, specifically for an external style engine.
|
(package private) CssStyleHelper |
styleHelper
A StyleHelper for this node.
|
private SubScene |
subScene |
private boolean |
transformDirty
This flag is used to indicate that localToParentTx is dirty and needs
to be recomputed.
|
private boolean |
treeVisible |
private Node.TreeVisiblePropertyReadOnly |
treeVisibleRO |
private BaseBounds |
txBounds
The cached transformed bounds.
|
private boolean |
txBoundsInvalid |
private static java.lang.Object |
USER_DATA_KEY
*
*
*
|
private BooleanProperty |
visible
Specifies whether this
Node and any subnodes should be rendered
as part of the scene graph. |
Modifier | Constructor and Description |
---|---|
protected |
Node()
Creates a new instance of Node.
|
Modifier and Type | Method and Description |
---|---|
ObjectProperty<java.lang.String> |
accessibleHelpProperty()
The accessible help text for this
Node . |
ObjectProperty<java.lang.String> |
accessibleRoleDescriptionProperty()
The role description of this
Node . |
ObjectProperty<AccessibleRole> |
accessibleRoleProperty() |
ObjectProperty<java.lang.String> |
accessibleTextProperty()
The accessible text for this
Node . |
<T extends Event> |
addEventFilter(EventType<T> eventType,
EventHandler<? super T> eventFilter)
Registers an event filter to this node.
|
<T extends Event> |
addEventHandler(EventType<T> eventType,
EventHandler<? super T> eventHandler)
Registers an event handler to this node.
|
private void |
addToSceneDirtyList() |
(package private) static boolean |
almostZero(double a) |
void |
applyCss()
If required, apply styles to this Node and its children, if any.
|
void |
autosize()
If the node is resizable, will set its layout bounds to its current preferred
width and height.
|
ObjectProperty<BlendMode> |
blendModeProperty() |
(package private) double |
boundedSize(double value,
double min,
double max) |
ReadOnlyObjectProperty<Bounds> |
boundsInLocalProperty()
The rectangular bounds of this
Node in the node's
untransformed local coordinate space. |
ReadOnlyObjectProperty<Bounds> |
boundsInParentProperty()
The rectangular bounds of this
Node which include its transforms. |
EventDispatchChain |
buildEventDispatchChain(EventDispatchChain tail)
Construct an event dispatch chain for this node.
|
ObjectProperty<CacheHint> |
cacheHintProperty()
Additional hint for controlling bitmap caching.
|
BooleanProperty |
cacheProperty()
A performance hint to the system to indicate that this
Node
should be cached as a bitmap. |
private byte |
calcAutomaticNodeOrientation() |
private byte |
calcEffectiveNodeOrientation() |
private void |
clearDirty()
Clear all dirty bits
|
ObjectProperty<Node> |
clipProperty()
Specifies a
Node to use to define the the clipping shape for this
Node. |
double |
computeAreaInScreen()
Returns the area of this
Node projected onto the
physical screen in pixel units. |
(package private) void |
computeDerivedDepthTest()
Recompute the derived depth test flag.
|
private BaseBounds |
computeLocalBounds(BaseBounds bounds,
BaseTransform tx)
Computes the local bounds of this Node.
|
boolean |
contains(double localX,
double localY)
Returns
true if the given point (specified in the local
coordinate space of this Node ) is contained within the shape of
this Node . |
boolean |
contains(Point2D localPoint)
Returns
true if the given point (specified in the local
coordinate space of this Node ) is contained within the shape of
this Node . |
protected boolean |
containsBounds(double localX,
double localY)
Deprecated.
This is an internal API that is not intended for use and will be removed in the next version
|
private NodeEventDispatcher |
createInternalEventDispatcher() |
ObjectProperty<Cursor> |
cursorProperty()
Defines the mouse cursor for this
Node and subnodes. |
ObjectProperty<DepthTest> |
depthTestProperty()
Indicates whether depth testing is used when rendering this node.
|
ReadOnlyBooleanProperty |
disabledProperty() |
private ReadOnlyBooleanWrapper |
disabledPropertyImpl() |
BooleanProperty |
disableProperty()
Defines the individual disabled state of this
Node . |
private void |
doCSSLayoutSyncForSnapshot() |
private void |
doCSSPass() |
private void |
doLayoutPass() |
private WritableImage |
doSnapshot(SnapshotParameters params,
WritableImage img) |
ReadOnlyObjectProperty<NodeOrientation> |
effectiveNodeOrientationProperty()
The effective orientation of a node resolves the inheritance of
node orientation, returning either left-to-right or right-to-left.
|
ObjectProperty<Effect> |
effectProperty()
Specifies an effect to apply to this
Node . |
ObjectProperty<EventDispatcher> |
eventDispatcherProperty() |
void |
executeAccessibleAction(AccessibleAction action,
java.lang.Object... parameters)
This method is called by the assistive technology to request the action
indicated by the argument should be executed.
|
void |
fireEvent(Event event)
Fires the specified event.
|
ReadOnlyBooleanProperty |
focusedProperty() |
private Node.FocusedProperty |
focusedPropertyImpl() |
private void |
focusSetDirty(Scene s)
Called when something has changed on this node that *may* have made the
scene's focus dirty.
|
BooleanProperty |
focusTraversableProperty() |
private Node.AccessibilityProperties |
getAccessibilityProperties() |
(package private) Accessible |
getAccessible() |
java.lang.String |
getAccessibleHelp() |
AccessibleRole |
getAccessibleRole() |
java.lang.String |
getAccessibleRoleDescription() |
java.lang.String |
getAccessibleText() |
private static byte |
getAutomaticOrientation(byte resolvedNodeOrientation) |
double |
getBaselineOffset()
The 'alphabetic' (or 'roman') baseline offset from the node's layoutBounds.minY location
that should be used when this node is being vertically aligned by baseline with
other nodes.
|
BlendMode |
getBlendMode() |
Bounds |
getBoundsInLocal() |
Bounds |
getBoundsInParent() |
CacheHint |
getCacheHint() |
static java.util.List<CssMetaData<? extends Styleable,?>> |
getClassCssMetaData() |
Node |
getClip() |
(package private) Node |
getClipParent() |
Orientation |
getContentBias()
Returns the orientation of a node's resizing bias for layout purposes.
|
(package private) CssFlags |
getCSSFlags()
Needed for testing.
|
java.util.List<CssMetaData<? extends Styleable,?>> |
getCssMetaData()
This method should delegate to
getClassCssMetaData() so that
a Node's CssMetaData can be accessed without the need for reflection. |
(package private) Transform |
getCurrentLocalToSceneTransformState() |
Cursor |
getCursor() |
DepthTest |
getDepthTest() |
Effect |
getEffect() |
NodeOrientation |
getEffectiveNodeOrientation() |
private static byte |
getEffectiveOrientation(byte resolvedNodeOrientation) |
EventDispatcher |
getEventDispatcher() |
private EventHandlerProperties |
getEventHandlerProperties() |
(package private) BaseBounds |
getGeomBounds(BaseBounds bounds,
BaseTransform tx)
Loads the given bounds object with the geometric bounds relative to,
and based on, the given transform.
|
java.lang.String |
getId()
The id of this
Node . |
InputMethodRequests |
getInputMethodRequests() |
private NodeEventDispatcher |
getInternalEventDispatcher() |
Bounds |
getLayoutBounds() |
double |
getLayoutX() |
double |
getLayoutY() |
(package private) BaseBounds |
getLocalBounds(BaseBounds bounds,
BaseTransform tx)
Loads the given bounds object with the local bounds relative to,
and based on, the given transform.
|
Transform |
getLocalToParentTransform() |
(package private) BaseTransform |
getLocalToParentTransform(BaseTransform tx)
Copy the localToParent transform into specified transform.
|
Transform |
getLocalToSceneTransform() |
private Node |
getMirroringOrientationParent() |
private Node.MiscProperties |
getMiscProperties() |
NodeOrientation |
getNodeOrientation() |
private Node.NodeTransformation |
getNodeTransformation() |
EventHandler<? super ContextMenuEvent> |
getOnContextMenuRequested() |
EventHandler<? super MouseEvent> |
getOnDragDetected() |
EventHandler<? super DragEvent> |
getOnDragDone() |
EventHandler<? super DragEvent> |
getOnDragDropped() |
EventHandler<? super DragEvent> |
getOnDragEntered() |
EventHandler<? super DragEvent> |
getOnDragExited() |
EventHandler<? super DragEvent> |
getOnDragOver() |
EventHandler<? super InputMethodEvent> |
getOnInputMethodTextChanged() |
EventHandler<? super KeyEvent> |
getOnKeyPressed() |
EventHandler<? super KeyEvent> |
getOnKeyReleased() |
EventHandler<? super KeyEvent> |
getOnKeyTyped() |
EventHandler<? super MouseEvent> |
getOnMouseClicked() |
EventHandler<? super MouseDragEvent> |
getOnMouseDragEntered() |
EventHandler<? super MouseDragEvent> |
getOnMouseDragExited() |
EventHandler<? super MouseEvent> |
getOnMouseDragged() |
EventHandler<? super MouseDragEvent> |
getOnMouseDragOver() |
EventHandler<? super MouseDragEvent> |
getOnMouseDragReleased() |
EventHandler<? super MouseEvent> |
getOnMouseEntered() |
EventHandler<? super MouseEvent> |
getOnMouseExited() |
EventHandler<? super MouseEvent> |
getOnMouseMoved() |
EventHandler<? super MouseEvent> |
getOnMousePressed() |
EventHandler<? super MouseEvent> |
getOnMouseReleased() |
EventHandler<? super RotateEvent> |
getOnRotate() |
EventHandler<? super RotateEvent> |
getOnRotationFinished() |
EventHandler<? super RotateEvent> |
getOnRotationStarted() |
EventHandler<? super ScrollEvent> |
getOnScroll() |
EventHandler<? super ScrollEvent> |
getOnScrollFinished() |
EventHandler<? super ScrollEvent> |
getOnScrollStarted() |
EventHandler<? super SwipeEvent> |
getOnSwipeDown() |
EventHandler<? super SwipeEvent> |
getOnSwipeLeft() |
EventHandler<? super SwipeEvent> |
getOnSwipeRight() |
EventHandler<? super SwipeEvent> |
getOnSwipeUp() |
EventHandler<? super TouchEvent> |
getOnTouchMoved() |
EventHandler<? super TouchEvent> |
getOnTouchPressed() |
EventHandler<? super TouchEvent> |
getOnTouchReleased() |
EventHandler<? super TouchEvent> |
getOnTouchStationary() |
EventHandler<? super ZoomEvent> |
getOnZoom() |
EventHandler<? super ZoomEvent> |
getOnZoomFinished() |
EventHandler<? super ZoomEvent> |
getOnZoomStarted() |
double |
getOpacity() |
private Node |
getOrientationParent() |
Parent |
getParent() |
ObservableMap<java.lang.Object,java.lang.Object> |
getProperties()
Returns an observable map of properties on this node for use primarily
by application developers.
|
ObservableSet<PseudoClass> |
getPseudoClassStates()
Return the pseudo-class state of this Styleable.
|
double |
getRotate() |
Point3D |
getRotationAxis() |
double |
getScaleX() |
double |
getScaleY() |
double |
getScaleZ() |
Scene |
getScene() |
java.lang.String |
getStyle()
A string representation of the CSS style associated with this
specific
Node . |
Styleable |
getStyleableParent()
Return the parent of this Styleable, or null if there is no parent.
|
ObservableList<java.lang.String> |
getStyleClass()
A list of String identifiers which can be used to logically group
Nodes, specifically for an external style engine.
|
(package private) SubScene |
getSubScene() |
(package private) BaseBounds |
getTransformedBounds(BaseBounds bounds,
BaseTransform tx)
Loads the given bounds object with the transformed bounds relative to,
and based on, the given transform.
|
ObservableList<Transform> |
getTransforms()
Defines the ObservableList of
Transform objects
to be applied to this Node . |
double |
getTranslateX() |
double |
getTranslateY() |
double |
getTranslateZ() |
java.lang.String |
getTypeSelector()
The type of this
Styleable that is to be used in selector matching. |
java.lang.Object |
getUserData()
Returns a previously set Object property, or null if no such property
has been set using the
setUserData(java.lang.Object) method. |
(package private) boolean |
hasMirroring() |
boolean |
hasProperties()
Tests if Node has properties.
|
ReadOnlyBooleanProperty |
hoverProperty() |
private ReadOnlyBooleanWrapper |
hoverPropertyImpl() |
StringProperty |
idProperty() |
protected void |
impl_clearDirty(DirtyBits dirtyBit)
Deprecated.
This is an internal API that is not intended for use and will be removed in the next version
|
private double |
impl_computeAreaInScreen() |
protected abstract boolean |
impl_computeContains(double localX,
double localY)
Deprecated.
This is an internal API that is not intended for use and will be removed in the next version
|
abstract BaseBounds |
impl_computeGeomBounds(BaseBounds bounds,
BaseTransform tx)
Deprecated.
This is an internal API that is not intended for use and will be removed in the next version
|
protected boolean |
impl_computeIntersects(PickRay pickRay,
PickResultChooser pickResult)
Deprecated.
This is an internal API that is not intended for use and will be removed in the next version
|
protected Bounds |
impl_computeLayoutBounds()
Deprecated.
This is an internal API that is not intended for use and will be removed in the next version
|
protected abstract NGNode |
impl_createPeer()
Deprecated.
This is an internal API that is not intended for use and will be removed in the next version
|
protected Cursor |
impl_cssGetCursorInitialValue()
Deprecated.
|
protected java.lang.Boolean |
impl_cssGetFocusTraversableInitialValue()
Deprecated.
|
java.util.Map<StyleableProperty<?>,java.util.List<Style>> |
impl_findStyles(java.util.Map<StyleableProperty<?>,java.util.List<Style>> styleMap)
Deprecated.
This is an internal API that is not intended for use and will be removed in the next version
|
protected void |
impl_geomChanged()
Deprecated.
This is an internal API that is not intended for use and will be removed in the next version
|
BaseTransform |
impl_getLeafTransform()
Deprecated.
This is an internal API that is not intended for use and will be removed in the next version
|
static java.util.List<Style> |
impl_getMatchingStyles(CssMetaData cssMetaData,
Styleable styleable)
Deprecated.
This is an experimental API that is not intended for general use and is subject to change in future versions
|
<P extends NGNode> |
impl_getPeer()
Deprecated.
This is an internal API that is not intended for use and will be removed in the next version
|
double |
impl_getPivotX()
Deprecated.
This is an internal API that is not intended for use and will be removed in the next version
|
double |
impl_getPivotY()
Deprecated.
This is an internal API that is not intended for use and will be removed in the next version
|
double |
impl_getPivotZ()
Deprecated.
This is an internal API that is not intended for use and will be removed in the next version
|
ObservableMap<StyleableProperty<?>,java.util.List<Style>> |
impl_getStyleMap()
Deprecated.
This is an experimental API that is not intended for general use and is subject to change in future versions
|
boolean |
impl_hasTransforms()
Deprecated.
This is an internal API that is not intended for use and will be removed in the next version
|
protected boolean |
impl_intersects(PickRay pickRay,
PickResultChooser pickResult)
Deprecated.
This is an internal API that is not intended for use and will be removed in the next version
|
protected double |
impl_intersectsBounds(PickRay pickRay)
Deprecated.
This is an internal API that is not intended for use and will be removed in the next version
|
protected boolean |
impl_isDirty(DirtyBits dirtyBit)
Deprecated.
This is an internal API that is not intended for use and will be removed in the next version
|
protected boolean |
impl_isDirtyEmpty()
Deprecated.
This is an internal API that is not intended for use and will be removed in the next version
|
boolean |
impl_isShowMnemonics()
Deprecated.
This is an internal API that is not intended for use and will be removed in the next version
|
boolean |
impl_isTreeVisible()
Deprecated.
This is an internal API that is not intended for use and will be removed in the next version
|
protected void |
impl_layoutBoundsChanged()
Deprecated.
This is an internal API that is not intended for use and will be removed in the next version
|
protected void |
impl_markDirty(DirtyBits dirtyBit)
Deprecated.
This is an internal API that is not intended for use and will be removed in the next version
|
protected void |
impl_notifyLayoutBoundsChanged()
Deprecated.
This is an internal API that is not intended for use and will be removed in the next version
|
void |
impl_pickNode(PickRay pickRay,
PickResultChooser result)
Deprecated.
This is an internal API that is not intended for use and will be removed in the next version
|
protected void |
impl_pickNodeLocal(PickRay localPickRay,
PickResultChooser result)
Deprecated.
This is an internal API that is not intended for use and will be removed in the next version
|
void |
impl_processCSS(boolean reapply)
Deprecated.
This is an internal API that is not intended for use and will be removed in the next version
|
protected void |
impl_processCSS(WritableValue<java.lang.Boolean> unused)
Deprecated.
This is an internal API that is not intended for use and will be removed in the next version
|
abstract java.lang.Object |
impl_processMXNode(MXNodeAlgorithm alg,
MXNodeAlgorithmContext ctx)
Deprecated.
This is an internal API that is not intended for use and will be removed in the next version
|
void |
impl_reapplyCSS()
Deprecated.
This is an internal API that is not intended for use and will be removed in the next version
|
void |
impl_setShowMnemonics(boolean value)
Deprecated.
This is an internal API that is not intended for use and will be removed in the next version
|
void |
impl_setStyleMap(ObservableMap<StyleableProperty<?>,java.util.List<Style>> styleMap)
Deprecated.
This is an experimental API that is not intended for general use and is subject to change in future versions
|
BooleanProperty |
impl_showMnemonicsProperty()
Deprecated.
This is an internal API that is not intended for use and will be removed in the next version
|
void |
impl_syncPeer()
Deprecated.
This is an internal API that is not intended for use and will be removed in the next version
|
void |
impl_transformsChanged()
Deprecated.
This is an internal API that is not intended for use and will be removed in the next version
|
boolean |
impl_traverse(Direction dir)
Deprecated.
This is an internal API that is not intended for use and will be removed in the next version
|
protected BooleanExpression |
impl_treeVisibleProperty()
Deprecated.
This is an internal API that is not intended for use and will be removed in the next version
|
void |
impl_updatePeer()
Deprecated.
This is an internal API that is not intended for use and will be removed in the next version
|
(package private) java.lang.String |
indent() |
private void |
initializeInternalEventDispatcher() |
ObjectProperty<InputMethodRequests> |
inputMethodRequestsProperty()
Property holding InputMethodRequests.
|
boolean |
intersects(Bounds localBounds)
Returns
true if the given bounds (specified in the local
coordinate space of this Node ) intersects the shape of this
Node . |
boolean |
intersects(double localX,
double localY,
double localWidth,
double localHeight)
Returns
true if the given rectangle (specified in the local
coordinate space of this Node ) intersects the shape of this
Node . |
private void |
invalidateBoundsInLocal() |
private void |
invalidateBoundsInParent() |
private void |
invalidatedScenes(Scene oldScene,
SubScene oldSubScene) |
private void |
invalidateLocalToParentTransform() |
private void |
invalidateLocalToSceneTransform() |
boolean |
isCache() |
(package private) boolean |
isCanReceiveFocus() |
(package private) boolean |
isConnected()
Determines whether this node is connected anywhere in the scene graph.
|
(package private) boolean |
isDerivedDepthTest() |
boolean |
isDisable() |
boolean |
isDisabled() |
boolean |
isFocused() |
boolean |
isFocusTraversable() |
boolean |
isHover() |
boolean |
isManaged() |
boolean |
isMouseTransparent() |
boolean |
isPickOnBounds() |
boolean |
isPressed() |
boolean |
isResizable()
Indicates whether this node is a type which can be resized by its parent.
|
boolean |
isVisible() |
ReadOnlyObjectProperty<Bounds> |
layoutBoundsProperty() |
DoubleProperty |
layoutXProperty() |
DoubleProperty |
layoutYProperty() |
(package private) void |
localBoundsChanged()
Responds to changes in the local bounds by invalidating boundsInLocal
and notifying this node that its transformed bounds have changed.
|
Bounds |
localToParent(Bounds localBounds)
Transforms a bounds from the local coordinate space of this
Node into the coordinate space of its parent. |
Point2D |
localToParent(double localX,
double localY)
Transforms a point from the local coordinate space of this
Node
into the coordinate space of its parent. |
Point3D |
localToParent(double x,
double y,
double z)
Transforms a point from the local coordinate space of this
Node
into the coordinate space of its parent. |
Point2D |
localToParent(Point2D localPoint)
Transforms a point from the local coordinate space of this
Node
into the coordinate space of its parent. |
(package private) void |
localToParent(Point2D pt)
Transforms in place the specified point from local coords to parent
coords.
|
Point3D |
localToParent(Point3D localPoint)
Transforms a point from the local coordinate space of this
Node
into the coordinate space of its parent. |
(package private) void |
localToParent(Vec3d pt) |
ReadOnlyObjectProperty<Transform> |
localToParentTransformProperty()
An affine transform that holds the computed local-to-parent transform.
|
Bounds |
localToScene(Bounds localBounds)
Transforms a bounds from the local coordinate space of this
Node into the coordinate space of its scene. |
Bounds |
localToScene(Bounds localBounds,
boolean rootScene)
Transforms a bounds from the local coordinate space of this
Node
into the coordinate space of its scene. |
Point2D |
localToScene(double localX,
double localY)
Transforms a point from the local coordinate space of this
Node
into the coordinate space of its scene. |
Point2D |
localToScene(double x,
double y,
boolean rootScene)
Transforms a point from the local coordinate space of this
Node
into the coordinate space of its scene. |
Point3D |
localToScene(double x,
double y,
double z)
Transforms a point from the local coordinate space of this
Node
into the coordinate space of its scene. |
Point3D |
localToScene(double x,
double y,
double z,
boolean rootScene)
Transforms a point from the local coordinate space of this
Node
into the coordinate space of its scene. |
Point2D |
localToScene(Point2D localPoint)
Transforms a point from the local coordinate space of this
Node
into the coordinate space of its scene. |
(package private) void |
localToScene(Point2D pt) |
Point2D |
localToScene(Point2D localPoint,
boolean rootScene)
Transforms a point from the local coordinate space of this
Node
into the coordinate space of its scene. |
Point3D |
localToScene(Point3D localPoint)
Transforms a point from the local coordinate space of this
Node
into the coordinate space of its scene. |
Point3D |
localToScene(Point3D localPoint,
boolean rootScene)
Transforms a point from the local coordinate space of this
Node
into the coordinate space of its scene. |
(package private) void |
localToScene(Vec3d pt) |
ReadOnlyObjectProperty<Transform> |
localToSceneTransformProperty()
An affine transform that holds the computed local-to-scene transform.
|
Bounds |
localToScreen(Bounds localBounds)
Transforms a bounds from the local coordinate space of this
Node into the coordinate space of its Screen . |
Point2D |
localToScreen(double localX,
double localY)
Transforms a point from the local coordinate space of this
Node
into the coordinate space of its Screen . |
Point2D |
localToScreen(double localX,
double localY,
double localZ)
Transforms a point from the local coordinate space of this
Node
into the coordinate space of its Screen . |
Point2D |
localToScreen(Point2D localPoint)
Transforms a point from the local coordinate space of this
Node
into the coordinate space of its Screen . |
Point2D |
localToScreen(Point3D localPoint)
Transforms a point from the local coordinate space of this
Node
into the coordinate space of its Screen . |
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)
Used by Node and Parent for traversing the tree and adding all nodes which
match the given selector.
|
java.util.Set<Node> |
lookupAll(java.lang.String selector)
Finds all
Node s, including this one and any children, which match
the given CSS selector. |
BooleanProperty |
managedProperty() |
(package private) void |
markDirtyLayoutBranch() |
double |
maxHeight(double width)
Returns the node's maximum height for use in layout calculations.
|
double |
maxWidth(double height)
Returns the node's maximum width for use in layout calculations.
|
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.
|
BooleanProperty |
mouseTransparentProperty()
If
true , this node (together with all its children) is completely
transparent to mouse events. |
ObjectProperty<NodeOrientation> |
nodeOrientationProperty()
Property holding NodeOrientation.
|
(package private) void |
nodeResolvedOrientationChanged() |
(package private) void |
nodeResolvedOrientationInvalidated() |
void |
notifyAccessibleAttributeChanged(AccessibleAttribute attributes)
This method is called by the application to notify the assistive
technology that the value for an attribute has changed.
|
(package private) void |
notifyManagedChanged()
Called whenever the "managed" flag has changed.
|
(package private) void |
notifyParentOfBoundsChange()
Notifies both the real parent and the clip parent (if they exist) that
the bounds of the child has changed.
|
(package private) void |
notifyParentsOfInvalidatedCSS() |
ObjectProperty<EventHandler<? super ContextMenuEvent>> |
onContextMenuRequestedProperty()
Defines a function to be called when a context menu
has been requested on this
Node . |
ObjectProperty<EventHandler<? super MouseEvent>> |
onDragDetectedProperty()
Defines a function to be called when drag gesture has been
detected.
|
ObjectProperty<EventHandler<? super DragEvent>> |
onDragDoneProperty()
Defines a function to be called when this
Node is a
drag and drop gesture source after its data has
been dropped on a drop target. |
ObjectProperty<EventHandler<? super DragEvent>> |
onDragDroppedProperty()
Defines a function to be called when the mouse button is released
on this
Node during drag and drop gesture. |
ObjectProperty<EventHandler<? super DragEvent>> |
onDragEnteredProperty()
Defines a function to be called when drag gesture
enters this
Node . |
ObjectProperty<EventHandler<? super DragEvent>> |
onDragExitedProperty()
Defines a function to be called when drag gesture
exits this
Node . |
ObjectProperty<EventHandler<? super DragEvent>> |
onDragOverProperty()
Defines a function to be called when drag gesture progresses within
this
Node . |
ObjectProperty<EventHandler<? super InputMethodEvent>> |
onInputMethodTextChangedProperty()
Defines a function to be called when this
Node
has input focus and the input method text has changed. |
ObjectProperty<EventHandler<? super KeyEvent>> |
onKeyPressedProperty()
Defines a function to be called when this
Node or its child
Node has input focus and a key has been pressed. |
ObjectProperty<EventHandler<? super KeyEvent>> |
onKeyReleasedProperty()
Defines a function to be called when this
Node or its child
Node has input focus and a key has been released. |
ObjectProperty<EventHandler<? super KeyEvent>> |
onKeyTypedProperty()
Defines a function to be called when this
Node or its child
Node has input focus and a key has been typed. |
ObjectProperty<EventHandler<? super MouseEvent>> |
onMouseClickedProperty()
Defines a function to be called when a mouse button has been clicked
(pressed and released) on this
Node . |
ObjectProperty<EventHandler<? super MouseDragEvent>> |
onMouseDragEnteredProperty()
Defines a function to be called when a full press-drag-release gesture
enters this
Node . |
ObjectProperty<EventHandler<? super MouseDragEvent>> |
onMouseDragExitedProperty()
Defines a function to be called when a full press-drag-release gesture
leaves this
Node . |
ObjectProperty<EventHandler<? super MouseEvent>> |
onMouseDraggedProperty()
Defines a function to be called when a mouse button is pressed
on this
Node and then dragged. |
ObjectProperty<EventHandler<? super MouseDragEvent>> |
onMouseDragOverProperty()
Defines a function to be called when a full press-drag-release gesture
progresses within this
Node . |
ObjectProperty<EventHandler<? super MouseDragEvent>> |
onMouseDragReleasedProperty()
Defines a function to be called when a full press-drag-release gesture
ends (by releasing mouse button) within this
Node . |
ObjectProperty<EventHandler<? super MouseEvent>> |
onMouseEnteredProperty()
Defines a function to be called when the mouse enters this
Node . |
ObjectProperty<EventHandler<? super MouseEvent>> |
onMouseExitedProperty()
Defines a function to be called when the mouse exits this
Node . |
ObjectProperty<EventHandler<? super MouseEvent>> |
onMouseMovedProperty()
Defines a function to be called when mouse cursor moves within
this
Node but no buttons have been pushed. |
ObjectProperty<EventHandler<? super MouseEvent>> |
onMousePressedProperty()
Defines a function to be called when a mouse button
has been pressed on this
Node . |
ObjectProperty<EventHandler<? super MouseEvent>> |
onMouseReleasedProperty()
Defines a function to be called when a mouse button
has been released on this
Node . |
ObjectProperty<EventHandler<? super RotateEvent>> |
onRotateProperty()
Defines a function to be called when user performs a rotation action.
|
ObjectProperty<EventHandler<? super RotateEvent>> |
onRotationFinishedProperty()
Defines a function to be called when a rotation gesture ends.
|
ObjectProperty<EventHandler<? super RotateEvent>> |
onRotationStartedProperty()
Defines a function to be called when a rotation gesture is detected.
|
ObjectProperty<EventHandler<? super ScrollEvent>> |
onScrollFinishedProperty()
Defines a function to be called when a scrolling gesture ends.
|
ObjectProperty<EventHandler<? super ScrollEvent>> |
onScrollProperty()
Defines a function to be called when user performs a scrolling action.
|
ObjectProperty<EventHandler<? super ScrollEvent>> |
onScrollStartedProperty()
Defines a function to be called when a scrolling gesture is detected.
|
ObjectProperty<EventHandler<? super SwipeEvent>> |
onSwipeDownProperty()
Defines a function to be called when a downward swipe gesture
centered over this node happens.
|
ObjectProperty<EventHandler<? super SwipeEvent>> |
onSwipeLeftProperty()
Defines a function to be called when a leftward swipe gesture
centered over this node happens.
|
ObjectProperty<EventHandler<? super SwipeEvent>> |
onSwipeRightProperty()
Defines a function to be called when an rightward swipe gesture
centered over this node happens.
|
ObjectProperty<EventHandler<? super SwipeEvent>> |
onSwipeUpProperty()
Defines a function to be called when an upward swipe gesture
centered over this node happens.
|
ObjectProperty<EventHandler<? super TouchEvent>> |
onTouchMovedProperty()
Defines a function to be called when a touch point is moved.
|
ObjectProperty<EventHandler<? super TouchEvent>> |
onTouchPressedProperty()
Defines a function to be called when a new touch point is pressed.
|
ObjectProperty<EventHandler<? super TouchEvent>> |
onTouchReleasedProperty()
Defines a function to be called when a touch point is released.
|
ObjectProperty<EventHandler<? super TouchEvent>> |
onTouchStationaryProperty()
Defines a function to be called when a touch point stays pressed and
still.
|
ObjectProperty<EventHandler<? super ZoomEvent>> |
onZoomFinishedProperty()
Defines a function to be called when a zooming gesture ends.
|
ObjectProperty<EventHandler<? super ZoomEvent>> |
onZoomProperty()
Defines a function to be called when user performs a zooming action.
|
ObjectProperty<EventHandler<? super ZoomEvent>> |
onZoomStartedProperty()
Defines a function to be called when a zooming gesture is detected.
|
DoubleProperty |
opacityProperty() |
ReadOnlyObjectProperty<Parent> |
parentProperty() |
private ReadOnlyObjectWrapper<Parent> |
parentPropertyImpl() |
(package private) void |
parentResolvedOrientationInvalidated() |
Bounds |
parentToLocal(Bounds parentBounds)
Transforms a rectangle from the coordinate space of the parent into the
local coordinate space of this
Node . |
Point2D |
parentToLocal(double parentX,
double parentY)
Transforms a point from the coordinate space of the parent into the
local coordinate space of this
Node . |
Point3D |
parentToLocal(double parentX,
double parentY,
double parentZ)
Transforms a point from the coordinate space of the parent into the
local coordinate space of this
Node . |
Point2D |
parentToLocal(Point2D parentPoint)
Transforms a point from the coordinate space of the parent into the
local coordinate space of this
Node . |
(package private) void |
parentToLocal(Point2D pt)
Transforms in place the specified point from parent coords to local
coords.
|
Point3D |
parentToLocal(Point3D parentPoint)
Transforms a point from the coordinate space of the parent into the
local coordinate space of this
Node . |
(package private) void |
parentToLocal(Vec3d pt) |
BooleanProperty |
pickOnBoundsProperty() |
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.
|
private void |
preprocessMouseEvent(MouseEvent e) |
ReadOnlyBooleanProperty |
pressedProperty() |
private ReadOnlyBooleanWrapper |
pressedPropertyImpl() |
(package private) void |
processCSS() |
void |
pseudoClassStateChanged(PseudoClass pseudoClass,
boolean active)
Used to specify that a pseudo-class of this Node has changed.
|
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 |
reapplyCss() |
(package private) void |
releaseAccessible() |
void |
relocate(double x,
double y)
Sets the node's layoutX and layoutY translation properties in order to
relocate this node to the x,y location in the parent.
|
<T extends Event> |
removeEventFilter(EventType<T> eventType,
EventHandler<? super T> eventFilter)
Unregisters a previously registered event filter from this node.
|
<T extends Event> |
removeEventHandler(EventType<T> eventType,
EventHandler<? super T> eventHandler)
Unregisters a previously registered event handler from this node.
|
private void |
requestCssStateTransition()
Called when a CSS pseudo-class change would cause styles to be reapplied.
|
void |
requestFocus()
Requests that this
Node get the input focus, and that this
Node 's top-level ancestor become the focused window. |
void |
resize(double width,
double height)
If the node is resizable, will set its layout bounds to the specified
width and height.
|
void |
resizeRelocate(double x,
double y,
double width,
double height)
If the node is resizable, will set its layout bounds to the specified
width and height.
|
DoubleProperty |
rotateProperty()
Defines the angle of rotation about the
Node 's center, measured in
degrees. |
ObjectProperty<Point3D> |
rotationAxisProperty()
Defines the axis of rotation of this
Node . |
DoubleProperty |
scaleXProperty()
Defines the factor by which coordinates are scaled about the center of the
object along the X axis of this
Node . |
DoubleProperty |
scaleYProperty()
Defines the factor by which coordinates are scaled about the center of the
object along the Y axis of this
Node . |
DoubleProperty |
scaleZProperty()
Defines the factor by which coordinates are scaled about the center of the
object along the Z axis of this
Node . |
ReadOnlyObjectProperty<Scene> |
sceneProperty() |
(package private) void |
scenesChanged(Scene newScene,
SubScene newSubScene,
Scene oldScene,
SubScene oldSubScene)
Exists for Parent and LightBase
|
Bounds |
sceneToLocal(Bounds sceneBounds)
Transforms a rectangle from the coordinate space of the
scene into the local coordinate space of this
Node . |
Bounds |
sceneToLocal(Bounds bounds,
boolean rootScene)
Transforms a bounds from the coordinate space of the scene
into the local coordinate space of this
Node . |
Point2D |
sceneToLocal(double sceneX,
double sceneY)
Transforms a point from the coordinate space of the scene
into the local coordinate space of this
Node . |
Point2D |
sceneToLocal(double x,
double y,
boolean rootScene)
Transforms a point from the coordinate space of the scene
into the local coordinate space of this
Node . |
Point3D |
sceneToLocal(double sceneX,
double sceneY,
double sceneZ)
Transforms a point from the coordinate space of the scene
into the local coordinate space of this
Node . |
Point2D |
sceneToLocal(Point2D scenePoint)
Transforms a point from the coordinate space of the scene
into the local coordinate space of this
Node . |
(package private) void |
sceneToLocal(Point2D pt) |
Point2D |
sceneToLocal(Point2D point,
boolean rootScene)
Transforms a point from the coordinate space of the scene
into the local coordinate space of this
Node . |
Point3D |
sceneToLocal(Point3D scenePoint)
Transforms a point from the coordinate space of the scene
into the local coordinate space of this
Node . |
(package private) void |
sceneToLocal(Vec3d pt) |
private Point3D |
sceneToLocal0(double x,
double y,
double z)
Internal method to transform a point from scene to local coordinates.
|
Bounds |
screenToLocal(Bounds screenBounds)
Transforms a rectangle from the coordinate space of the
Screen into the local coordinate space of this
Node . |
Point2D |
screenToLocal(double screenX,
double screenY)
Transforms a point from the coordinate space of the
Screen
into the local coordinate space of this Node . |
Point2D |
screenToLocal(Point2D screenPoint)
Transforms a point from the coordinate space of the
Screen
into the local coordinate space of this Node . |
void |
setAccessibleHelp(java.lang.String value) |
void |
setAccessibleRole(AccessibleRole value) |
void |
setAccessibleRoleDescription(java.lang.String value) |
void |
setAccessibleText(java.lang.String value) |
void |
setBlendMode(BlendMode value) |
void |
setCache(boolean value) |
void |
setCacheHint(CacheHint value) |
private void |
setCanReceiveFocus(boolean value) |
void |
setClip(Node value) |
void |
setCursor(Cursor value) |
void |
setDepthTest(DepthTest value) |
(package private) void |
setDerivedDepthTest(boolean value) |
private void |
setDirty()
Set all dirty bits
|
void |
setDisable(boolean value) |
protected void |
setDisabled(boolean value) |
void |
setEffect(Effect value) |
void |
setEventDispatcher(EventDispatcher value) |
protected <T extends Event> |
setEventHandler(EventType<T> eventType,
EventHandler<? super T> eventHandler)
Sets the handler to use for this event type.
|
protected void |
setFocused(boolean value) |
void |
setFocusTraversable(boolean value) |
protected void |
setHover(boolean value) |
void |
setId(java.lang.String value) |
void |
setInputMethodRequests(InputMethodRequests value) |
void |
setLayoutX(double value) |
void |
setLayoutY(double value) |
void |
setManaged(boolean value) |
void |
setMouseTransparent(boolean value) |
void |
setNodeOrientation(NodeOrientation orientation) |
void |
setOnContextMenuRequested(EventHandler<? super ContextMenuEvent> value) |
void |
setOnDragDetected(EventHandler<? super MouseEvent> value) |
void |
setOnDragDone(EventHandler<? super DragEvent> value) |
void |
setOnDragDropped(EventHandler<? super DragEvent> value) |
void |
setOnDragEntered(EventHandler<? super DragEvent> value) |
void |
setOnDragExited(EventHandler<? super DragEvent> value) |
void |
setOnDragOver(EventHandler<? super DragEvent> value) |
void |
setOnInputMethodTextChanged(EventHandler<? super InputMethodEvent> value) |
void |
setOnKeyPressed(EventHandler<? super KeyEvent> value) |
void |
setOnKeyReleased(EventHandler<? super KeyEvent> value) |
void |
setOnKeyTyped(EventHandler<? super KeyEvent> value) |
void |
setOnMouseClicked(EventHandler<? super MouseEvent> value) |
void |
setOnMouseDragEntered(EventHandler<? super MouseDragEvent> value) |
void |
setOnMouseDragExited(EventHandler<? super MouseDragEvent> value) |
void |
setOnMouseDragged(EventHandler<? super MouseEvent> value) |
void |
setOnMouseDragOver(EventHandler<? super MouseDragEvent> value) |
void |
setOnMouseDragReleased(EventHandler<? super MouseDragEvent> value) |
void |
setOnMouseEntered(EventHandler<? super MouseEvent> value) |
void |
setOnMouseExited(EventHandler<? super MouseEvent> value) |
void |
setOnMouseMoved(EventHandler<? super MouseEvent> value) |
void |
setOnMousePressed(EventHandler<? super MouseEvent> value) |
void |
setOnMouseReleased(EventHandler<? super MouseEvent> value) |
void |
setOnRotate(EventHandler<? super RotateEvent> value) |
void |
setOnRotationFinished(EventHandler<? super RotateEvent> value) |
void |
setOnRotationStarted(EventHandler<? super RotateEvent> value) |
void |
setOnScroll(EventHandler<? super ScrollEvent> value) |
void |
setOnScrollFinished(EventHandler<? super ScrollEvent> value) |
void |
setOnScrollStarted(EventHandler<? super ScrollEvent> value) |
void |
setOnSwipeDown(EventHandler<? super SwipeEvent> value) |
void |
setOnSwipeLeft(EventHandler<? super SwipeEvent> value) |
void |
setOnSwipeRight(EventHandler<? super SwipeEvent> value) |
void |
setOnSwipeUp(EventHandler<? super SwipeEvent> value) |
void |
setOnTouchMoved(EventHandler<? super TouchEvent> value) |
void |
setOnTouchPressed(EventHandler<? super TouchEvent> value) |
void |
setOnTouchReleased(EventHandler<? super TouchEvent> value) |
void |
setOnTouchStationary(EventHandler<? super TouchEvent> value) |
void |
setOnZoom(EventHandler<? super ZoomEvent> value) |
void |
setOnZoomFinished(EventHandler<? super ZoomEvent> value) |
void |
setOnZoomStarted(EventHandler<? super ZoomEvent> value) |
void |
setOpacity(double value) |
(package private) void |
setParent(Parent value) |
void |
setPickOnBounds(boolean value) |
protected void |
setPressed(boolean value) |
void |
setRotate(double value) |
void |
setRotationAxis(Point3D value) |
void |
setScaleX(double value) |
void |
setScaleY(double value) |
void |
setScaleZ(double value) |
(package private) void |
setScenes(Scene newScene,
SubScene newSubScene) |
void |
setStyle(java.lang.String value)
A string representation of the CSS style associated with this
specific
Node . |
void |
setTranslateX(double value) |
void |
setTranslateY(double value) |
void |
setTranslateZ(double value) |
(package private) void |
setTreeVisible(boolean value) |
void |
setUserData(java.lang.Object value)
Convenience method for setting a single Object property that can be
retrieved at a later date.
|
void |
setVisible(boolean value) |
void |
snapshot(Callback<SnapshotResult,java.lang.Void> callback,
SnapshotParameters params,
WritableImage image)
Takes a snapshot of this node at the next frame and calls the
specified callback method when the image is ready.
|
WritableImage |
snapshot(SnapshotParameters params,
WritableImage image)
Takes a snapshot of this node and returns the rendered image when
it is ready.
|
Dragboard |
startDragAndDrop(TransferMode... transferModes)
Confirms a potential drag and drop gesture that is recognized over this
Node . |
void |
startFullDrag()
Starts a full press-drag-release gesture with this node as gesture
source.
|
StringProperty |
styleProperty() |
private static void |
syncAll(Node node)
Recursive function for synchronizing a node and all descendents
|
void |
toBack()
Moves this
Node to the back of its sibling nodes in terms of
z-order. |
void |
toFront()
Moves this
Node to the front of its sibling nodes in terms of
z-order. |
java.lang.String |
toString()
Returns a string representation for the object.
|
(package private) void |
transformedBoundsChanged()
Responds to changes in the transformed bounds by invalidating txBounds
and boundsInParent.
|
private ObservableList<Transform> |
transformsProperty() |
DoubleProperty |
translateXProperty()
Defines the x coordinate of the translation that is added to this
Node 's
transform. |
DoubleProperty |
translateYProperty()
Defines the y coordinate of the translation that is added to this
Node 's
transform. |
DoubleProperty |
translateZProperty()
Defines the Z coordinate of the translation that is added to the
transformed coordinates of this
Node . |
(package private) void |
updateBounds() |
private void |
updateCanReceiveFocus() |
private void |
updateDisabled() |
(package private) void |
updateGeomBounds()
If necessary, recomputes the cached geom bounds.
|
private void |
updateLocalBounds()
If necessary, recomputes the cached local bounds.
|
(package private) void |
updateLocalToParentTransform()
This helper function will update the transform matrix on the peer based
on the "complete" transform for this node.
|
private void |
updateTreeVisible(boolean parentChanged) |
(package private) void |
updateTxBounds()
If necessary, recomputes the cached transformed bounds.
|
boolean |
usesMirroring()
Determines whether a node should be mirrored when node orientation
is right-to-left.
|
BooleanProperty |
visibleProperty() |
(package private) boolean |
wouldCreateCycle(Node parent,
Node child)
Tests whether creating a parent-child relationship between these
nodes would cause a cycle.
|
private int dirtyBits
private BaseBounds _geomBounds
private BaseBounds _txBounds
private boolean pendingUpdateBounds
private static final java.lang.Object USER_DATA_KEY
private ObservableMap<java.lang.Object,java.lang.Object> properties
private ReadOnlyObjectWrapper<Parent> parent
Node
. If this Node
has not been added
to a scene graph, then parent will be null.private final InvalidationListener parentDisabledChangedListener
private final InvalidationListener parentTreeVisibleChangedListener
private SubScene subScene
private Node.ReadOnlyObjectWrapperManualFire<Scene> scene
Scene
that this Node
is part of. If the Node is not
part of a scene, then this variable will be null.private StringProperty id
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 analogous to the "id" attribute on an HTML element
(CSS ID Specification).
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");
.
private ObservableList<java.lang.String> styleClass
private StringProperty style
Node
. This is analogous to the "style" attribute of an
HTML element. Note that, like the HTML style attribute, this
variable contains style properties and values and not the
selector portion of a style rule.private BooleanProperty visible
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.private DoubleProperty opacity
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 Node
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 Node
s 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 are treated as 0, values greater than 1 are treated as 1.
On some platforms ImageView might not support opacity variable.
There is a known limitation of mixing opacity < 1.0 with a 3D Transform.
Opacity/Blending is essentially a 2D image operation. The result of
an opacity < 1.0 set on a Group
node with 3D transformed children
will cause its children to be rendered in order without Z-buffering
applied between those children.
private ObjectProperty<BlendMode> blendMode
BlendMode
used to blend this individual node
into the scene behind it. If this node happens to be a Group then all of the
children will be composited individually into a temporary buffer using their
own blend modes and then that temporary buffer will be composited into the
scene using the specified blend mode.
A value of null
is treated as pass-though this means no effect on a
parent such as a Group and the equivalent of SRC_OVER for a single Node.private boolean derivedDepthTest
private BooleanProperty pickOnBounds
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.private ReadOnlyBooleanWrapper disabled
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.
private Node clipParent
private NGNode peer
private BooleanProperty managed
layoutBounds
calculations and will lay it
out during the scene's layout pass. If a managed node's layoutBounds
changes, it will automatically trigger relayout up the scene-graph
to the nearest layout root (which is typically the scene's root node).
If the node is unmanaged, its parent will ignore the child in both preferred
size computations and layout. Changes in layoutBounds will not trigger
relayout above it. If an unmanaged node is of type Parent
,
it will act as a "layout root", meaning that calls to Parent.requestLayout()
beneath it will cause only the branch rooted by the node to be relayed out,
thereby isolating layout changes to that root and below. It's the application's
responsibility to set the size and position of an unmanaged node.
By default all nodes are managed.
private DoubleProperty layoutX
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.setLayoutX(finalX - textnode.getLayoutBounds().getMinX());
Failure to subtract layoutBounds minX
may result in misplacement
of the node. The relocate(x, y)
method will automatically do the
correct computation and should generally be used over setting layoutX directly.
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 Region
as its parent, then the layout region will set layoutX
according to its
own layout policy. If the node is unmanaged or parented by a Group
,
then the application may set layoutX
directly to position it.
relocate(double, double)
,
layoutBoundsProperty()
private DoubleProperty layoutY
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.setLayoutY(finalY - textnode.getLayoutBounds().getMinY());
Failure to subtract layoutBounds minY
may result in misplacement
of the node. The relocate(x, y)
method will automatically do the
correct computation and should generally be used over setting layoutY directly.
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 Region
as its parent, then the region will set layoutY
according to its
own layout policy. If the node is unmanaged or parented by a Group
,
then the application may set layoutY
directly to position it.
relocate(double, double)
,
layoutBoundsProperty()
public static final double BASELINE_OFFSET_SAME_AS_HEIGHT
getBaselineOffset()
.
This means that the Parent (layout Pane) of this Node should use the height of this Node as a baseline.private Node.LazyBoundsProperty layoutBounds
layoutBounds
may differ from the visual bounds
of the node and is computed differently depending on the node type.
If the node type is resizable (Region
,
Control
, or WebView
)
then the layoutBounds will always be 0,0 width x height
.
If the node type is not resizable (Shape
,
Text
, or Group
), then the layoutBounds
are computed based on the node's geometric properties and does not include the
node's clip, effect, or transforms. See individual class documentation
for details.
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.
The layoutBounds will never be null.
private BaseTransform localToParentTx
private boolean transformDirty
private BaseBounds txBounds
private BaseBounds geomBounds
private BaseBounds localBounds
boolean boundsChanged
To reduce confusion, although this variable is defined on Node, it really belongs to the Parent of the node and should *only* be modified by the parent.
private boolean geomBoundsInvalid
private boolean localBoundsInvalid
private boolean txBoundsInvalid
private static final double EPSILON_ABSOLUTE
private Node.NodeTransformation nodeTransformation
private static final double DEFAULT_TRANSLATE_X
private static final double DEFAULT_TRANSLATE_Y
private static final double DEFAULT_TRANSLATE_Z
private static final double DEFAULT_SCALE_X
private static final double DEFAULT_SCALE_Y
private static final double DEFAULT_SCALE_Z
private static final double DEFAULT_ROTATE
private static final Point3D DEFAULT_ROTATION_AXIS
private EventHandlerProperties eventHandlerProperties
private ObjectProperty<NodeOrientation> nodeOrientation
private Node.EffectiveOrientationProperty effectiveNodeOrientationProperty
private static final byte EFFECTIVE_ORIENTATION_LTR
private static final byte EFFECTIVE_ORIENTATION_RTL
private static final byte EFFECTIVE_ORIENTATION_MASK
private static final byte AUTOMATIC_ORIENTATION_LTR
private static final byte AUTOMATIC_ORIENTATION_RTL
private static final byte AUTOMATIC_ORIENTATION_MASK
private byte resolvedNodeOrientation
private Node.MiscProperties miscProperties
private static final boolean DEFAULT_CACHE
private static final CacheHint DEFAULT_CACHE_HINT
private static final Node DEFAULT_CLIP
private static final Cursor DEFAULT_CURSOR
private static final DepthTest DEFAULT_DEPTH_TEST
private static final boolean DEFAULT_DISABLE
private static final Effect DEFAULT_EFFECT
private static final InputMethodRequests DEFAULT_INPUT_METHOD_REQUESTS
private static final boolean DEFAULT_MOUSE_TRANSPARENT
private ReadOnlyBooleanWrapper hover
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 that 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.
private ReadOnlyBooleanWrapper pressed
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".private Node.FocusedProperty focused
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.requestFocus()
private BooleanProperty focusTraversable
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()
.requestFocus()
private boolean treeVisible
private Node.TreeVisiblePropertyReadOnly treeVisibleRO
private boolean canReceiveFocus
@Deprecated private BooleanProperty impl_showMnemonics
private Node labeledBy
private ObjectProperty<EventDispatcher> eventDispatcher
EventDispatcher
,
the new dispatcher should forward events to the replaced dispatcher
to maintain the node's default event handling behavior.private NodeEventDispatcher internalEventDispatcher
private EventDispatcher preprocessMouseEventDispatcher
CssFlags cssFlag
final ObservableSet<PseudoClass> pseudoClassStates
CssStyleHelper styleHelper
private static final PseudoClass HOVER_PSEUDOCLASS_STATE
private static final PseudoClass PRESSED_PSEUDOCLASS_STATE
private static final PseudoClass DISABLED_PSEUDOCLASS_STATE
private static final PseudoClass FOCUSED_PSEUDOCLASS_STATE
private static final PseudoClass SHOW_MNEMONICS_PSEUDOCLASS_STATE
private static final BoundsAccessor boundsAccessor
private ObjectProperty<AccessibleRole> accessibleRole
Node
.
The screen reader uses the role of a node to determine the attributes and actions that are supported.
AccessibleRole
Node.AccessibilityProperties accessibilityProperties
Accessible accessible
@Deprecated protected void impl_markDirty(DirtyBits dirtyBit)
private void addToSceneDirtyList()
@Deprecated protected final boolean impl_isDirty(DirtyBits dirtyBit)
@Deprecated protected final void impl_clearDirty(DirtyBits dirtyBit)
private void setDirty()
private void clearDirty()
@Deprecated protected final boolean impl_isDirtyEmpty()
@Deprecated public final void impl_syncPeer()
void updateBounds()
@Deprecated public void impl_updatePeer()
public final ObservableMap<java.lang.Object,java.lang.Object> getProperties()
public boolean hasProperties()
public void setUserData(java.lang.Object value)
getUserData()
.value
- The value to be stored - this can later be retrieved by calling
getUserData()
.public java.lang.Object getUserData()
setUserData(java.lang.Object)
method.final void setParent(Parent value)
public final Parent getParent()
public final ReadOnlyObjectProperty<Parent> parentProperty()
private ReadOnlyObjectWrapper<Parent> parentPropertyImpl()
final SubScene getSubScene()
public final Scene getScene()
public final ReadOnlyObjectProperty<Scene> sceneProperty()
void scenesChanged(Scene newScene, SubScene newSubScene, Scene oldScene, SubScene oldSubScene)
public final void setId(java.lang.String value)
public final java.lang.String getId()
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 analogous to the "id" attribute on an HTML element
(CSS ID Specification).getId
in interface Styleable
Node
using the setId
method or null
, if no id has been assigned.public final StringProperty idProperty()
public final ObservableList<java.lang.String> getStyleClass()
Styleable
getStyleClass
in interface Styleable
public final void setStyle(java.lang.String value)
Node
. This is analogous to the "style" attribute of an
HTML element. Note that, like the HTML style attribute, this
variable contains style properties and values and not the
selector portion of a style rule.value
- The inline CSS style to use for this Node
.
null
is implicitly converted to an empty String.public final java.lang.String getStyle()
Node
. This is analogous to the "style" attribute of an
HTML element. Note that, like the HTML style attribute, this
variable contains style properties and values and not the
selector portion of a style rule.getStyle
in interface Styleable
Node
.
If this Node
does not have an inline style,
an empty String is returned.public final StringProperty styleProperty()
public final void setVisible(boolean value)
public final boolean isVisible()
public final BooleanProperty visibleProperty()
public final void setCursor(Cursor value)
public final Cursor getCursor()
public final ObjectProperty<Cursor> cursorProperty()
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.public final void setOpacity(double value)
public final double getOpacity()
public final DoubleProperty opacityProperty()
public final void setBlendMode(BlendMode value)
public final BlendMode getBlendMode()
public final ObjectProperty<BlendMode> blendModeProperty()
public final void setClip(Node value)
public final Node getClip()
public final ObjectProperty<Node> clipProperty()
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 ImageView
Node as
a mask to represent the Clip. Or you could use one of the geometric shape
Nodes such as Rectangle
or
Circle
. Or you could use a
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 that this is a conditional feature. See
ConditionalFeature.SHAPE_CLIP
for more information.
There is a known limitation of mixing Clip with a 3D Transform.
Clipping is essentially a 2D image operation. The result of
a Clip set on a Group
node with 3D transformed children
will cause its children to be rendered in order without Z-buffering
applied between those children.
public final void setCache(boolean value)
public final boolean isCache()
public final BooleanProperty cacheProperty()
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 cacheHintProperty()
variable provides additional options for enabling
more aggressive bitmap caching.
Caching may be disabled for any node that has a 3D transform on itself, any of its ancestors, or any of its descendants.
cacheHintProperty()
public final void setCacheHint(CacheHint value)
public final CacheHint getCacheHint()
public final ObjectProperty<CacheHint> cacheHintProperty()
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.setCache(true);
expensiveNode.setCacheHint(CacheHint.QUALITY);
...
// Do an animation
expensiveNode.setCacheHint(CacheHint.SPEED);
new Timeline(
new KeyFrame(Duration.seconds(2),
new KeyValue(expensiveNode.scaleXProperty(), 2.0),
new KeyValue(expensiveNode.scaleYProperty(), 2.0),
new KeyValue(expensiveNode.rotateProperty(), 360),
new KeyValue(expensiveNode.cacheHintProperty(), 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.
Caching may be disabled for any node that has a 3D transform on itself,
any of its ancestors, or any of its descendants.
cacheProperty()
public final void setEffect(Effect value)
public final Effect getEffect()
public final ObjectProperty<Effect> effectProperty()
Node
.
Note that this is a conditional feature. See
ConditionalFeature.EFFECT
for more information.
There is a known limitation of mixing Effect with a 3D Transform. Effect is
essentially a 2D image operation. The result of an Effect set on
a Group
node with 3D transformed children will cause its children
to be rendered in order without Z-buffering applied between those
children.
public final void setDepthTest(DepthTest value)
public final DepthTest getDepthTest()
public final ObjectProperty<DepthTest> depthTestProperty()
DepthTest.DISABLE
, then depth testing
is disabled for this node.
If the depthTest flag is DepthTest.ENABLE
, then depth testing
is enabled for this node.
If the depthTest flag is DepthTest.INHERIT
, then depth testing
is enabled for this node if it is enabled for the parent node or the
parent node is null.
The depthTest flag is only used when the depthBuffer flag for
the Scene
is true (meaning that the
Scene
has an associated depth buffer)
Depth test comparison is only done among nodes with depthTest enabled. A node with depthTest disabled does not read, test, or write the depth buffer, that is to say its Z value will not be considered for depth testing with other nodes.
Note that this is a conditional feature. See
ConditionalFeature.SCENE3D
for more information.
See the constructor in Scene with depthBuffer as one of its input arguments.
Scene
void computeDerivedDepthTest()
void setDerivedDepthTest(boolean value)
boolean isDerivedDepthTest()
public final void setDisable(boolean value)
public final boolean isDisable()
public final BooleanProperty disableProperty()
Node
. Setting
disable
to true will cause this Node
and any subnodes to
become disabled. This property should be used only to set the disabled
state of a Node
. For querying the disabled state of a
Node
, the disabled
property 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
.public final void setPickOnBounds(boolean value)
public final boolean isPickOnBounds()
public final BooleanProperty pickOnBoundsProperty()
protected final void setDisabled(boolean value)
public final boolean isDisabled()
public final ReadOnlyBooleanProperty disabledProperty()
private ReadOnlyBooleanWrapper disabledPropertyImpl()
private void updateDisabled()
public Node lookup(java.lang.String selector)
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");
.
selector
- The css selector of the node to findNode
, which matches
the CSS selector
, null if none is found.public java.util.Set<Node> lookupAll(java.lang.String selector)
Node
s, including this one and any children, which match
the given CSS selector. If no matches are found, an empty unmodifiable set is
returned. The set is explicitly unordered.selector
- The css selector of the nodes to findNode
, which match
the CSS selector
. The returned set is always unordered and
unmodifiable, and never null.java.util.List<Node> lookupAll(Selector selector, java.util.List<Node> results)
selector
- The Selector. This will never be null.results
- The results. This will never be null.public void toBack()
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
ObservableList.
This function has no effect if this Node
is not part of a group.public void toFront()
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
ObservableList.
This function has no effect if this Node
is not part of a group.private void doCSSPass()
private static void syncAll(Node node)
private void doLayoutPass()
private void doCSSLayoutSyncForSnapshot()
private WritableImage doSnapshot(SnapshotParameters params, WritableImage img)
public WritableImage snapshot(SnapshotParameters params, WritableImage image)
Paint
specified by the SnapshotParameters. This node is then rendered to
the image.
If the viewport specified by the SnapshotParameters is null, the
upper-left pixel of the boundsInParent
of this
node, after first applying the transform specified by the
SnapshotParameters,
is mapped to the upper-left pixel (0,0) in the image.
If a non-null viewport is specified,
the upper-left pixel of the viewport is mapped to upper-left pixel
(0,0) in the image.
In both cases, this mapping to (0,0) of the image is done with an integer
translation. The portion of the node that is outside of the rendered
image will be clipped by the image.
When taking a snapshot of a scene that is being animated, either explicitly by the application or implicitly (such as chart animation), the snapshot will be rendered based on the state of the scene graph at the moment the snapshot is taken and will not reflect any subsequent animation changes.
NOTE: In order for CSS and layout to function correctly, the node must be part of a Scene (the Scene may be attached to a Stage, but need not be).
params
- the snapshot parameters containing attributes that
will control the rendering. If the SnapshotParameters object is null,
then the Scene's attributes will be used if this node is part of a scene,
or default attributes will be used if this node is not part of a scene.image
- the writable image that will be used to hold the rendered node.
It may be null in which case a new WritableImage will be constructed.
The new image is constructed using integer width and
height values that are derived either from the transformed bounds of this
Node or from the size of the viewport as specified in the
SnapShotParameters. These integer values are chosen such that the image
will wholly contain the bounds of this Node or the specified viewport.
If the image is non-null, the node will be rendered into the
existing image.
In this case, the width and height of the image determine the area
that is rendered instead of the width and height of the bounds or
viewport.java.lang.IllegalStateException
- if this method is called on a thread
other than the JavaFX Application Thread.public void snapshot(Callback<SnapshotResult,java.lang.Void> callback, SnapshotParameters params, WritableImage image)
Paint
specified by the SnapshotParameters. This node is then rendered to
the image.
If the viewport specified by the SnapshotParameters is null, the
upper-left pixel of the boundsInParent
of this
node, after first applying the transform specified by the
SnapshotParameters,
is mapped to the upper-left pixel (0,0) in the image.
If a non-null viewport is specified,
the upper-left pixel of the viewport is mapped to upper-left pixel
(0,0) in the image.
In both cases, this mapping to (0,0) of the image is done with an integer
translation. The portion of the node that is outside of the rendered
image will be clipped by the image.
This is an asynchronous call, which means that other events or animation might be processed before the node is rendered. If any such events modify the node, or any of its children, that modification will be reflected in the rendered image (just like it will also be reflected in the frame rendered to the Stage, if this node is part of a live scene graph).
When taking a snapshot of a node that is being animated, either explicitly by the application or implicitly (such as chart animation), the snapshot will be rendered based on the state of the scene graph at the moment the snapshot is taken and will not reflect any subsequent animation changes.
NOTE: In order for CSS and layout to function correctly, the node must be part of a Scene (the Scene may be attached to a Stage, but need not be).
callback
- a class whose call method will be called when the image
is ready. The SnapshotResult that is passed into the call method of
the callback will contain the rendered image, the source node
that was rendered, and a copy of the SnapshotParameters.
The callback parameter must not be null.params
- the snapshot parameters containing attributes that
will control the rendering. If the SnapshotParameters object is null,
then the Scene's attributes will be used if this node is part of a scene,
or default attributes will be used if this node is not part of a scene.image
- the writable image that will be used to hold the rendered node.
It may be null in which case a new WritableImage will be constructed.
The new image is constructed using integer width and
height values that are derived either from the transformed bounds of this
Node or from the size of the viewport as specified in the
SnapShotParameters. These integer values are chosen such that the image
will wholly contain the bounds of this Node or the specified viewport.
If the image is non-null, the node will be rendered into the
existing image.
In this case, the width and height of the image determine the area
that is rendered instead of the width and height of the bounds or
viewport.java.lang.IllegalStateException
- if this method is called on a thread
other than the JavaFX Application Thread.java.lang.NullPointerException
- if the callback parameter is null.public final void setOnDragEntered(EventHandler<? super DragEvent> value)
public final EventHandler<? super DragEvent> getOnDragEntered()
public final ObjectProperty<EventHandler<? super DragEvent>> onDragEnteredProperty()
Node
.public final void setOnDragExited(EventHandler<? super DragEvent> value)
public final EventHandler<? super DragEvent> getOnDragExited()
public final ObjectProperty<EventHandler<? super DragEvent>> onDragExitedProperty()
Node
.public final void setOnDragOver(EventHandler<? super DragEvent> value)
public final EventHandler<? super DragEvent> getOnDragOver()
public final ObjectProperty<EventHandler<? super DragEvent>> onDragOverProperty()
Node
.public final void setOnDragDropped(EventHandler<? super DragEvent> value)
public final EventHandler<? super DragEvent> getOnDragDropped()
public final ObjectProperty<EventHandler<? super DragEvent>> onDragDroppedProperty()
public final void setOnDragDone(EventHandler<? super DragEvent> value)
public final EventHandler<? super DragEvent> getOnDragDone()
public final ObjectProperty<EventHandler<? super DragEvent>> onDragDoneProperty()
Node
is a
drag and drop gesture source after its data has
been dropped on a drop target. The transferMode
of the
event shows what just happened at the drop target.
If transferMode
has the value MOVE
, then the source can
clear out its data. Clearing the source's data gives the appropriate
appearance to a user that the data has been moved by the drag and drop
gesture. A transferMode
that has the value NONE
indicates that no data was transferred during the drag and drop gesture.public Dragboard startDragAndDrop(TransferMode... transferModes)
Node
.
Can be called only from a DRAG_DETECTED event handler. The returned
Dragboard
is used to transfer data during
the drag and drop gesture. Placing this Node
's data on the
Dragboard
also identifies this Node
as the source of
the drag and drop gesture.
More detail about drag and drop gestures is described in the overivew
of DragEvent
.transferModes
- The supported TransferMode
(s) of this Node
Dragboard
to place this Node
's data onjava.lang.IllegalStateException
- if drag and drop cannot be started at this
moment (it's called outside of DRAG_DETECTED
event handling or
this node is not in scene).DragEvent
public void startFullDrag()
DRAG_DETECTED
mouse
event handler. More detail about dragging gestures can be found
in the overview of MouseEvent
and MouseDragEvent
.java.lang.IllegalStateException
- if the full press-drag-release gesture
cannot be started at this moment (it's called outside of
DRAG_DETECTED
event handling or this node is not in scene).MouseEvent
,
MouseDragEvent
final Node getClipParent()
boolean isConnected()
boolean wouldCreateCycle(Node parent, Node child)
@Deprecated public <P extends NGNode> P impl_getPeer()
@Deprecated protected abstract NGNode impl_createPeer()
public final void setManaged(boolean value)
public final boolean isManaged()
public final BooleanProperty managedProperty()
void notifyManagedChanged()
public final void setLayoutX(double value)
public final double getLayoutX()
public final DoubleProperty layoutXProperty()
public final void setLayoutY(double value)
public final double getLayoutY()
public final DoubleProperty layoutYProperty()
public void relocate(double x, double y)
This method does not alter translateX or translateY, which if also set will be added to layoutX and layoutY, adjusting the final location by corresponding amounts.
x
- the target x coordinate locationy
- the target y coordinate locationpublic boolean isResizable()
If this method returns false, then the parent cannot resize it during layout (resize() is a no-op) and it should return its layoutBounds for minimum, preferred, and maximum sizes. Group, Text, and all Shapes are not resizable and hence depend on the application to establish their sizing by setting appropriate properties (e.g. width/height for Rectangle, text on Text, and so on). Non-resizable nodes may still be relocated during layout.
getContentBias()
,
minWidth(double)
,
minHeight(double)
,
prefWidth(double)
,
prefHeight(double)
,
maxWidth(double)
,
maxHeight(double)
,
resize(double, double)
,
getLayoutBounds()
public Orientation getContentBias()
Resizable subclasses should override this method to return an appropriate value.
isResizable()
,
minWidth(double)
,
minHeight(double)
,
prefWidth(double)
,
prefHeight(double)
,
maxWidth(double)
,
maxHeight(double)
public double minWidth(double height)
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 maxWidth(double)
is lower than this number,
minWidth
takes precedence. This means the Node should never be resized below minWidth
.
height
- the height that should be used if minimum width depends on itisResizable()
,
getContentBias()
public double minHeight(double width)
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 maxHeight(double)
is lower than this number,
minHeight
takes precedence. This means the Node should never be resized below minHeight
.
width
- the width that should be used if minimum height depends on itisResizable()
,
getContentBias()
public double prefWidth(double height)
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).
height
- the height that should be used if preferred width depends on itisResizable()
,
getContentBias()
,
autosize()
public double prefHeight(double width)
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).
width
- the width that should be used if preferred height depends on itgetContentBias()
,
autosize()
public double maxWidth(double height)
If the node is not resizable, returns its layoutBounds width.
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 maximum 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 minWidth(double)
is greater, it should take precedence
over the maxWidth
. This means the Node should never be resized below minWidth
.
height
- the height that should be used if maximum width depends on itisResizable()
,
getContentBias()
public double maxHeight(double width)
If the node is not resizable, returns its layoutBounds height.
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 maximum 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 minHeight(double)
is greater, it should take precedence
over the maxHeight
. This means the Node should never be resized below minHeight
.
width
- the width that should be used if maximum height depends on itisResizable()
,
getContentBias()
public void resize(double width, double height)
This method should generally only be called by parent nodes from their layoutChildren() methods. All Parent classes will automatically resize resizable children, so resizing done directly by the application will be overridden by the node's parent, unless the child is unmanaged.
Parents are responsible for ensuring the width and height values fall within the resizable node's preferred range. The autosize() method may be used if the parent just needs to resize the node to its preferred size.
width
- the target layout bounds widthheight
- the target layout bounds heightisResizable()
,
getContentBias()
,
autosize()
,
minWidth(double)
,
minHeight(double)
,
prefWidth(double)
,
prefHeight(double)
,
maxWidth(double)
,
maxHeight(double)
,
getLayoutBounds()
public final void autosize()
This method automatically queries the node's content-bias and if it's horizontal, will pass in the node's preferred width to get the preferred height; if vertical, will pass in the node's preferred height to get the width, and if null, will compute the preferred width/height independently.
isResizable()
,
getContentBias()
double boundedSize(double value, double min, double max)
public void resizeRelocate(double x, double y, double width, double height)
Once the node has been resized (if resizable) then sets the node's layoutX and layoutY translation properties in order to relocate it to x,y in the parent's coordinate space.
This method should generally only be called by parent nodes from their layoutChildren() methods. All Parent classes will automatically resize resizable children, so resizing done directly by the application will be overridden by the node's parent, unless the child is unmanaged.
Parents are responsible for ensuring the width and height values fall within the resizable node's preferred range. The autosize() and relocate() methods may be used if the parent just needs to resize the node to its preferred size and reposition it.
x
- the target x coordinate locationy
- the target y coordinate locationwidth
- the target layout bounds widthheight
- the target layout bounds heightisResizable()
,
getContentBias()
,
autosize()
,
minWidth(double)
,
minHeight(double)
,
prefWidth(double)
,
prefHeight(double)
,
maxWidth(double)
,
maxHeight(double)
public double getBaselineOffset()
BASELINE_OFFSET_SAME_AS_HEIGHT
for resizable Nodes
and layoutBounds height for non-resizable. Subclasses
which contain text should override this method to return their actual text baseline offset.BASELINE_OFFSET_SAME_AS_HEIGHT
otherwisepublic double computeAreaInScreen()
Node
projected onto the
physical screen in pixel units.private double impl_computeAreaInScreen()
public final Bounds getBoundsInParent()
public final ReadOnlyObjectProperty<Bounds> boundsInParentProperty()
Node
which include its transforms.
boundsInParent
is calculated by
taking the local bounds (defined by boundsInLocal
) and applying
the transform created by setting the following additional variables
transforms
ObservableListscaleX
, scaleY
rotate
layoutX
, layoutY
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 computation is based on the geometry of this Node
only.
This property will always have a non-null value.
Note that boundsInParent is automatically recomputed whenever the geometry of a node changes, or when any of the following the change: transforms ObservableList, translateX, translateY, layoutX, layoutY, scaleX, scaleY, or the 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.
private void invalidateBoundsInParent()
public final Bounds getBoundsInLocal()
public final ReadOnlyObjectProperty<Bounds> boundsInLocalProperty()
Node
in the node's
untransformed local coordinate space. For nodes that extend
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 computation is based on the geometry of this Node
only.
This property will always have 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.
private void invalidateBoundsInLocal()
public final Bounds getLayoutBounds()
public final ReadOnlyObjectProperty<Bounds> layoutBoundsProperty()
@Deprecated protected Bounds impl_computeLayoutBounds()
@Deprecated protected final void impl_layoutBoundsChanged()
BaseBounds getTransformedBounds(BaseBounds bounds, BaseTransform tx)
BaseBounds getLocalBounds(BaseBounds bounds, BaseTransform tx)
BaseBounds getGeomBounds(BaseBounds bounds, BaseTransform tx)
@Deprecated public abstract BaseBounds impl_computeGeomBounds(BaseBounds bounds, BaseTransform tx)
void updateGeomBounds()
private BaseBounds computeLocalBounds(BaseBounds bounds, BaseTransform tx)
private void updateLocalBounds()
void updateTxBounds()
@Deprecated protected abstract boolean impl_computeContains(double localX, double localY)
@Deprecated protected void impl_geomChanged()
This function will also invalidate the cached geom bounds, and then invoke localBoundsChanged() which will eventually end up invoking a chain of functions up the tree to ensure that each parent of this Node is notified that its bounds may have also changed.
This function should be treated as though it were final. It is not intended to be overridden by subclasses.
void localBoundsChanged()
void transformedBoundsChanged()
@Deprecated protected void impl_notifyLayoutBoundsChanged()
void notifyParentOfBoundsChange()
public boolean contains(double localX, double localY)
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.@Deprecated protected boolean containsBounds(double localX, double localY)
Node
) is contained within the bounds,
clip and effect of this node.public boolean contains(Point2D localPoint)
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.public boolean intersects(double localX, double localY, double localWidth, double localHeight)
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.public boolean intersects(Bounds localBounds)
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.public Point2D screenToLocal(double screenX, double screenY)
Screen
into the local coordinate space of this Node
.screenX
- x coordinate of a point on a ScreenscreenY
- y coordinate of a point on a ScreenWindow
.
Null is also returned if the transformation from local to Scene is not invertible.public Point2D screenToLocal(Point2D screenPoint)
Screen
into the local coordinate space of this Node
.screenPoint
- a point on a ScreenWindow
.
Null is also returned if the transformation from local to Scene is not invertible.public Bounds screenToLocal(Bounds screenBounds)
Screen
into the local coordinate space of this
Node
. Returns reasonable result only in 2D space.screenBounds
- bounds on a ScreenWindow
.
Null is also returned if the transformation from local to Scene is not invertible.public Point2D sceneToLocal(double x, double y, boolean rootScene)
Node
.
If the Node does not have any SubScene
or rootScene
is set to true, the arguments are in Scene
coordinates
of the Node returned by getScene()
. Othwerwise, the subscene coordinates are used, which is equivalent to calling
sceneToLocal(double, double)
x
- the x coordinatey
- the y coordinaterootScene
- whether Scene coordinates should be used even if the Node is in a SubScenepublic Point2D sceneToLocal(Point2D point, boolean rootScene)
Node
.
If the Node does not have any SubScene
or rootScene
is set to true, the arguments are in Scene
coordinates
of the Node returned by getScene()
. Othwerwise, the subscene coordinates are used, which is equivalent to calling
sceneToLocal(javafx.geometry.Point2D)
point
- the pointrootScene
- whether Scene coordinates should be used even if the Node is in a SubScenepublic Bounds sceneToLocal(Bounds bounds, boolean rootScene)
Node
.
If the Node does not have any SubScene
or rootScene
is set to true, the arguments are in Scene
coordinates
of the Node returned by getScene()
. Othwerwise, the subscene coordinates are used, which is equivalent to calling
sceneToLocal(javafx.geometry.Bounds)
.
Since 3D bounds cannot be converted with rootScene
set to true
, trying to convert 3D bounds will yield null
.
bounds
- the boundsrootScene
- whether Scene coordinates should be used even if the Node is in a SubScenepublic Point2D sceneToLocal(double sceneX, double sceneY)
Node
.
Note that if this node is in a SubScene
, the arguments should be in the subscene coordinates,
not that of Scene
.sceneX
- x coordinate of a point on a ScenesceneY
- y coordinate of a point on a SceneWindow
.
Null is also returned if the transformation from local to Scene is not invertible.public Point2D sceneToLocal(Point2D scenePoint)
Node
.
Note that if this node is in a SubScene
, the arguments should be in the subscene coordinates,
not that of Scene
.scenePoint
- a point on a SceneWindow
.
Null is also returned if the transformation from local to Scene is not invertible.public Point3D sceneToLocal(Point3D scenePoint)
Node
.
Note that if this node is in a SubScene
, the arguments should be in the subscene coordinates,
not that of Scene
.scenePoint
- a point on a SceneWindow
.
Null is also returned if the transformation from local to Scene is not invertible.public Point3D sceneToLocal(double sceneX, double sceneY, double sceneZ)
Node
.
Note that if this node is in a SubScene
, the arguments should be in the subscene coordinates,
not that of Scene
.sceneX
- x coordinate of a point on a ScenesceneY
- y coordinate of a point on a ScenesceneZ
- z coordinate of a point on a SceneWindow
.
Null is also returned if the transformation from local to Scene is not invertible.private Point3D sceneToLocal0(double x, double y, double z) throws NoninvertibleTransformException
NoninvertibleTransformException
public Bounds sceneToLocal(Bounds sceneBounds)
Node
.
Note that if this node is in a SubScene
, the arguments should be in the subscene coordinates,
not that of Scene
.sceneBounds
- bounds on a SceneWindow
.
Null is also returned if the transformation from local to Scene is not invertible.public Point2D localToScreen(double localX, double localY)
Node
into the coordinate space of its Screen
.localX
- x coordinate of a point in Node's spacelocalY
- y coordinate of a point in Node's spaceWindow
public Point2D localToScreen(Point2D localPoint)
Node
into the coordinate space of its Screen
.localPoint
- a point in Node's spaceWindow
public Point2D localToScreen(double localX, double localY, double localZ)
Node
into the coordinate space of its Screen
.localX
- x coordinate of a point in Node's spacelocalY
- y coordinate of a point in Node's spacelocalZ
- z coordinate of a point in Node's spaceWindow
public Point2D localToScreen(Point3D localPoint)
Node
into the coordinate space of its Screen
.localPoint
- a point in Node's spaceWindow
public Bounds localToScreen(Bounds localBounds)
Node
into the coordinate space of its Screen
.localBounds
- bounds in Node's spaceWindow
public Point2D localToScene(double localX, double localY)
Node
into the coordinate space of its scene.
Note that if this node is in a SubScene
, the result is in the subscene coordinates,
not that of Scene
.localX
- x coordinate of a point in Node's spacelocalY
- y coordinate of a point in Node's spaceWindow
public Point2D localToScene(Point2D localPoint)
Node
into the coordinate space of its scene.
Note that if this node is in a SubScene
, the result is in the subscene coordinates,
not that of Scene
.localPoint
- a point in Node's spaceWindow
public Point3D localToScene(Point3D localPoint)
Node
into the coordinate space of its scene.
Note that if this node is in a SubScene
, the result is in the subscene coordinates,
not that of Scene
.localToScene(javafx.geometry.Point3D, boolean)
public Point3D localToScene(double x, double y, double z)
Node
into the coordinate space of its scene.
Note that if this node is in a SubScene
, the result is in the subscene coordinates,
not that of Scene
.localToScene(double, double, double, boolean)
public Point3D localToScene(Point3D localPoint, boolean rootScene)
Node
into the coordinate space of its scene.
If the Node does not have any SubScene
or rootScene
is set to true, the result point is in Scene
coordinates
of the Node returned by getScene()
. Othwerwise, the subscene coordinates are used, which is equivalent to calling
localToScene(javafx.geometry.Point3D)
localPoint
- the point in local coordinatesrootScene
- whether Scene coordinates should be used even if the Node is in a SubScenelocalToScene(javafx.geometry.Point3D)
public Point3D localToScene(double x, double y, double z, boolean rootScene)
Node
into the coordinate space of its scene.
If the Node does not have any SubScene
or rootScene
is set to true, the result point is in Scene
coordinates
of the Node returned by getScene()
. Othwerwise, the subscene coordinates are used, which is equivalent to calling
localToScene(double, double, double)
x
- the x coordinate of the point in local coordinatesy
- the y coordinate of the point in local coordinatesz
- the z coordinate of the point in local coordinatesrootScene
- whether Scene coordinates should be used even if the Node is in a SubScenelocalToScene(double, double, double)
public Point2D localToScene(Point2D localPoint, boolean rootScene)
Node
into the coordinate space of its scene.
If the Node does not have any SubScene
or rootScene
is set to true, the result point is in Scene
coordinates
of the Node returned by getScene()
. Othwerwise, the subscene coordinates are used, which is equivalent to calling
localToScene(javafx.geometry.Point2D)
localPoint
- the point in local coordinatesrootScene
- whether Scene coordinates should be used even if the Node is in a SubScenelocalToScene(javafx.geometry.Point2D)
public Point2D localToScene(double x, double y, boolean rootScene)
Node
into the coordinate space of its scene.
If the Node does not have any SubScene
or rootScene
is set to true, the result point is in Scene
coordinates
of the Node returned by getScene()
. Othwerwise, the subscene coordinates are used, which is equivalent to calling
localToScene(double, double)
x
- the x coordinate of the point in local coordinatesy
- the y coordinate of the point in local coordinatesrootScene
- whether Scene coordinates should be used even if the Node is in a SubScenelocalToScene(double, double)
public Bounds localToScene(Bounds localBounds, boolean rootScene)
Node
into the coordinate space of its scene.
If the Node does not have any SubScene
or rootScene
is set to true, the result bounds are in Scene
coordinates
of the Node returned by getScene()
. Othwerwise, the subscene coordinates are used, which is equivalent to calling
localToScene(javafx.geometry.Bounds)
localBounds
- the bounds in local coordinatesrootScene
- whether Scene coordinates should be used even if the Node is in a SubScenelocalToScene(javafx.geometry.Bounds)
public Bounds localToScene(Bounds localBounds)
Node
into the coordinate space of its scene.
Note that if this node is in a SubScene
, the result is in the subscene coordinates,
not that of Scene
.localBounds
- bounds in Node's spaceWindow
localToScene(javafx.geometry.Bounds, boolean)
public Point2D parentToLocal(double parentX, double parentY)
Node
.public Point2D parentToLocal(Point2D parentPoint)
Node
.public Point3D parentToLocal(Point3D parentPoint)
Node
.public Point3D parentToLocal(double parentX, double parentY, double parentZ)
Node
.public Bounds parentToLocal(Bounds parentBounds)
Node
.public Point2D localToParent(double localX, double localY)
Node
into the coordinate space of its parent.public Point2D localToParent(Point2D localPoint)
Node
into the coordinate space of its parent.public Point3D localToParent(Point3D localPoint)
Node
into the coordinate space of its parent.public Point3D localToParent(double x, double y, double z)
Node
into the coordinate space of its parent.public Bounds localToParent(Bounds localBounds)
Node
into the coordinate space of its parent.BaseTransform getLocalToParentTransform(BaseTransform tx)
@Deprecated public final BaseTransform impl_getLeafTransform()
@Deprecated public void impl_transformsChanged()
@Deprecated public final double impl_getPivotX()
@Deprecated public final double impl_getPivotY()
@Deprecated public final double impl_getPivotZ()
void updateLocalToParentTransform()
void parentToLocal(Point2D pt) throws NoninvertibleTransformException
NoninvertibleTransformException
void parentToLocal(Vec3d pt) throws NoninvertibleTransformException
NoninvertibleTransformException
void sceneToLocal(Point2D pt) throws NoninvertibleTransformException
NoninvertibleTransformException
void sceneToLocal(Vec3d pt) throws NoninvertibleTransformException
NoninvertibleTransformException
void localToScene(Point2D pt)
void localToScene(Vec3d pt)
void localToParent(Point2D pt)
void localToParent(Vec3d pt)
@Deprecated protected void impl_pickNodeLocal(PickRay localPickRay, PickResultChooser result)
@Deprecated public final void impl_pickNode(PickRay pickRay, PickResultChooser result)
@Deprecated protected final boolean impl_intersects(PickRay pickRay, PickResultChooser pickResult)
true
if the given ray (start, dir), 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 pickResult is updated if the found intersection is closer than the currently held one.
Note that this is a conditional feature. See
ConditionalFeature.SCENE3D
for more information.
@Deprecated protected boolean impl_computeIntersects(PickRay pickRay, PickResultChooser pickResult)
@Deprecated protected final double impl_intersectsBounds(PickRay pickRay)
pickRay
- The pick raystatic boolean almostZero(double a)
public final ObservableList<Transform> getTransforms()
Transform
objects
to be applied to this Node
. This ObservableList of transforms is applied
before translateX
, translateY
, scaleX
, and
scaleY
, rotate
transforms.private ObservableList<Transform> transformsProperty()
public final void setTranslateX(double value)
public final double getTranslateX()
public final DoubleProperty translateXProperty()
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.
public final void setTranslateY(double value)
public final double getTranslateY()
public final DoubleProperty translateYProperty()
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.
public final void setTranslateZ(double value)
public final double getTranslateZ()
public final DoubleProperty translateZProperty()
Node
. This value will be added
to any translation defined by the transforms
ObservableList 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 that this is a conditional feature. See
ConditionalFeature.SCENE3D
for more information.
public final void setScaleX(double value)
public final double getScaleX()
public final DoubleProperty scaleXProperty()
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
.
public final void setScaleY(double value)
public final double getScaleY()
public final DoubleProperty scaleYProperty()
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
.
public final void setScaleZ(double value)
public final double getScaleZ()
public final DoubleProperty scaleZProperty()
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
ObservableList.
Note that this is a conditional feature. See
ConditionalFeature.SCENE3D
for more information.
public final void setRotate(double value)
public final double getRotate()
public final DoubleProperty rotateProperty()
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
ObservableList, and add a Rotate
transform,
which has a user-specifiable pivot point.
public final void setRotationAxis(Point3D value)
public final Point3D getRotationAxis()
public final ObjectProperty<Point3D> rotationAxisProperty()
Node
.
Note that this is a conditional feature. See
ConditionalFeature.SCENE3D
for more information.
public final ReadOnlyObjectProperty<Transform> localToParentTransformProperty()
private void invalidateLocalToParentTransform()
public final Transform getLocalToParentTransform()
public final ReadOnlyObjectProperty<Transform> localToSceneTransformProperty()
SubScene
, this property represents
transforms up to the subscene, not the root scene.
Note that when you register a listener or a binding to this property, it needs to listen for invalidation on all its parents to the root node. This means that registering a listener on this property on many nodes may negatively affect performance of transformation changes in their common parents.
private void invalidateLocalToSceneTransform()
public final Transform getLocalToSceneTransform()
private Node.NodeTransformation getNodeTransformation()
@Deprecated public boolean impl_hasTransforms()
Transform getCurrentLocalToSceneTransformState()
private EventHandlerProperties getEventHandlerProperties()
public final void setNodeOrientation(NodeOrientation orientation)
public final NodeOrientation getNodeOrientation()
public final ObjectProperty<NodeOrientation> nodeOrientationProperty()
Node orientation describes the flow of visual data within a node. In the English speaking world, visual data normally flows from left-to-right. In an Arabic or Hebrew world, visual data flows from right-to-left. This is consistent with the reading order of text in both worlds. The default value is left-to-right.
public final NodeOrientation getEffectiveNodeOrientation()
public final ReadOnlyObjectProperty<NodeOrientation> effectiveNodeOrientationProperty()
public boolean usesMirroring()
When a node is mirrored, the origin is automatically moved to the
top right corner causing the node to layout children and draw from
right to left using a mirroring transformation. Some nodes may wish
to draw from right to left without using a transformation. These
nodes will will answer false
and implement right-to-left
orientation without using the automatic transformation.
final void parentResolvedOrientationInvalidated()
final void nodeResolvedOrientationInvalidated()
void nodeResolvedOrientationChanged()
private Node getMirroringOrientationParent()
private Node getOrientationParent()
private byte calcEffectiveNodeOrientation()
private byte calcAutomaticNodeOrientation()
final boolean hasMirroring()
private static byte getEffectiveOrientation(byte resolvedNodeOrientation)
private static byte getAutomaticOrientation(byte resolvedNodeOrientation)
private Node.MiscProperties getMiscProperties()
public final void setMouseTransparent(boolean value)
public final boolean isMouseTransparent()
public final BooleanProperty mouseTransparentProperty()
true
, this node (together with all its children) is completely
transparent to mouse events. When choosing target for mouse event, nodes
with mouseTransparent
set to true
and their subtrees
won't be taken into account.protected final void setHover(boolean value)
public final boolean isHover()
public final ReadOnlyBooleanProperty hoverProperty()
private ReadOnlyBooleanWrapper hoverPropertyImpl()
protected final void setPressed(boolean value)
public final boolean isPressed()
public final ReadOnlyBooleanProperty pressedProperty()
private ReadOnlyBooleanWrapper pressedPropertyImpl()
public final void setOnContextMenuRequested(EventHandler<? super ContextMenuEvent> value)
public final EventHandler<? super ContextMenuEvent> getOnContextMenuRequested()
public final ObjectProperty<EventHandler<? super ContextMenuEvent>> onContextMenuRequestedProperty()
Node
.public final void setOnMouseClicked(EventHandler<? super MouseEvent> value)
public final EventHandler<? super MouseEvent> getOnMouseClicked()
public final ObjectProperty<EventHandler<? super MouseEvent>> onMouseClickedProperty()
Node
.public final void setOnMouseDragged(EventHandler<? super MouseEvent> value)
public final EventHandler<? super MouseEvent> getOnMouseDragged()
public final ObjectProperty<EventHandler<? super MouseEvent>> onMouseDraggedProperty()
Node
and then dragged.public final void setOnMouseEntered(EventHandler<? super MouseEvent> value)
public final EventHandler<? super MouseEvent> getOnMouseEntered()
public final ObjectProperty<EventHandler<? super MouseEvent>> onMouseEnteredProperty()
Node
.public final void setOnMouseExited(EventHandler<? super MouseEvent> value)
public final EventHandler<? super MouseEvent> getOnMouseExited()
public final ObjectProperty<EventHandler<? super MouseEvent>> onMouseExitedProperty()
Node
.public final void setOnMouseMoved(EventHandler<? super MouseEvent> value)
public final EventHandler<? super MouseEvent> getOnMouseMoved()
public final ObjectProperty<EventHandler<? super MouseEvent>> onMouseMovedProperty()
Node
but no buttons have been pushed.public final void setOnMousePressed(EventHandler<? super MouseEvent> value)
public final EventHandler<? super MouseEvent> getOnMousePressed()
public final ObjectProperty<EventHandler<? super MouseEvent>> onMousePressedProperty()
Node
.public final void setOnMouseReleased(EventHandler<? super MouseEvent> value)
public final EventHandler<? super MouseEvent> getOnMouseReleased()
public final ObjectProperty<EventHandler<? super MouseEvent>> onMouseReleasedProperty()
Node
.public final void setOnDragDetected(EventHandler<? super MouseEvent> value)
public final EventHandler<? super MouseEvent> getOnDragDetected()
public final ObjectProperty<EventHandler<? super MouseEvent>> onDragDetectedProperty()
public final void setOnMouseDragOver(EventHandler<? super MouseDragEvent> value)
public final EventHandler<? super MouseDragEvent> getOnMouseDragOver()
public final ObjectProperty<EventHandler<? super MouseDragEvent>> onMouseDragOverProperty()
Node
.public final void setOnMouseDragReleased(EventHandler<? super MouseDragEvent> value)
public final EventHandler<? super MouseDragEvent> getOnMouseDragReleased()
public final ObjectProperty<EventHandler<? super MouseDragEvent>> onMouseDragReleasedProperty()
Node
.public final void setOnMouseDragEntered(EventHandler<? super MouseDragEvent> value)
public final EventHandler<? super MouseDragEvent> getOnMouseDragEntered()
public final ObjectProperty<EventHandler<? super MouseDragEvent>> onMouseDragEnteredProperty()
Node
.public final void setOnMouseDragExited(EventHandler<? super MouseDragEvent> value)
public final EventHandler<? super MouseDragEvent> getOnMouseDragExited()
public final ObjectProperty<EventHandler<? super MouseDragEvent>> onMouseDragExitedProperty()
Node
.public final void setOnScrollStarted(EventHandler<? super ScrollEvent> value)
public final EventHandler<? super ScrollEvent> getOnScrollStarted()
public final ObjectProperty<EventHandler<? super ScrollEvent>> onScrollStartedProperty()
public final void setOnScroll(EventHandler<? super ScrollEvent> value)
public final EventHandler<? super ScrollEvent> getOnScroll()
public final ObjectProperty<EventHandler<? super ScrollEvent>> onScrollProperty()
public final void setOnScrollFinished(EventHandler<? super ScrollEvent> value)
public final EventHandler<? super ScrollEvent> getOnScrollFinished()
public final ObjectProperty<EventHandler<? super ScrollEvent>> onScrollFinishedProperty()
public final void setOnRotationStarted(EventHandler<? super RotateEvent> value)
public final EventHandler<? super RotateEvent> getOnRotationStarted()
public final ObjectProperty<EventHandler<? super RotateEvent>> onRotationStartedProperty()
public final void setOnRotate(EventHandler<? super RotateEvent> value)
public final EventHandler<? super RotateEvent> getOnRotate()
public final ObjectProperty<EventHandler<? super RotateEvent>> onRotateProperty()
public final void setOnRotationFinished(EventHandler<? super RotateEvent> value)
public final EventHandler<? super RotateEvent> getOnRotationFinished()
public final ObjectProperty<EventHandler<? super RotateEvent>> onRotationFinishedProperty()
public final void setOnZoomStarted(EventHandler<? super ZoomEvent> value)
public final EventHandler<? super ZoomEvent> getOnZoomStarted()
public final ObjectProperty<EventHandler<? super ZoomEvent>> onZoomStartedProperty()
public final void setOnZoom(EventHandler<? super ZoomEvent> value)
public final EventHandler<? super ZoomEvent> getOnZoom()
public final ObjectProperty<EventHandler<? super ZoomEvent>> onZoomProperty()
public final void setOnZoomFinished(EventHandler<? super ZoomEvent> value)
public final EventHandler<? super ZoomEvent> getOnZoomFinished()
public final ObjectProperty<EventHandler<? super ZoomEvent>> onZoomFinishedProperty()
public final void setOnSwipeUp(EventHandler<? super SwipeEvent> value)
public final EventHandler<? super SwipeEvent> getOnSwipeUp()
public final ObjectProperty<EventHandler<? super SwipeEvent>> onSwipeUpProperty()
public final void setOnSwipeDown(EventHandler<? super SwipeEvent> value)
public final EventHandler<? super SwipeEvent> getOnSwipeDown()
public final ObjectProperty<EventHandler<? super SwipeEvent>> onSwipeDownProperty()
public final void setOnSwipeLeft(EventHandler<? super SwipeEvent> value)
public final EventHandler<? super SwipeEvent> getOnSwipeLeft()
public final ObjectProperty<EventHandler<? super SwipeEvent>> onSwipeLeftProperty()
public final void setOnSwipeRight(EventHandler<? super SwipeEvent> value)
public final EventHandler<? super SwipeEvent> getOnSwipeRight()
public final ObjectProperty<EventHandler<? super SwipeEvent>> onSwipeRightProperty()
public final void setOnTouchPressed(EventHandler<? super TouchEvent> value)
public final EventHandler<? super TouchEvent> getOnTouchPressed()
public final ObjectProperty<EventHandler<? super TouchEvent>> onTouchPressedProperty()
public final void setOnTouchMoved(EventHandler<? super TouchEvent> value)
public final EventHandler<? super TouchEvent> getOnTouchMoved()
public final ObjectProperty<EventHandler<? super TouchEvent>> onTouchMovedProperty()
public final void setOnTouchReleased(EventHandler<? super TouchEvent> value)
public final EventHandler<? super TouchEvent> getOnTouchReleased()
public final ObjectProperty<EventHandler<? super TouchEvent>> onTouchReleasedProperty()
public final void setOnTouchStationary(EventHandler<? super TouchEvent> value)
public final EventHandler<? super TouchEvent> getOnTouchStationary()
public final ObjectProperty<EventHandler<? super TouchEvent>> onTouchStationaryProperty()
public final void setOnKeyPressed(EventHandler<? super KeyEvent> value)
public final EventHandler<? super KeyEvent> getOnKeyPressed()
public final ObjectProperty<EventHandler<? super KeyEvent>> onKeyPressedProperty()
Node
or its child
Node
has input focus and a key has been pressed. The function
is called only if the event hasn't been already consumed during its
capturing or bubbling phase.public final void setOnKeyReleased(EventHandler<? super KeyEvent> value)
public final EventHandler<? super KeyEvent> getOnKeyReleased()
public final ObjectProperty<EventHandler<? super KeyEvent>> onKeyReleasedProperty()
Node
or its child
Node
has input focus and a key has been released. The function
is called only if the event hasn't been already consumed during its
capturing or bubbling phase.public final void setOnKeyTyped(EventHandler<? super KeyEvent> value)
public final EventHandler<? super KeyEvent> getOnKeyTyped()
public final ObjectProperty<EventHandler<? super KeyEvent>> onKeyTypedProperty()
Node
or its child
Node
has input focus and a key has been typed. The function
is called only if the event hasn't been already consumed during its
capturing or bubbling phase.public final void setOnInputMethodTextChanged(EventHandler<? super InputMethodEvent> value)
public final EventHandler<? super InputMethodEvent> getOnInputMethodTextChanged()
public final ObjectProperty<EventHandler<? super InputMethodEvent>> onInputMethodTextChangedProperty()
Node
has input focus and the input method text has changed. If this
function is not defined in this Node
, then it
receives the result string of the input method composition as a
series of onKeyTyped
function calls.
When the Node
loses the input focus, the JavaFX runtime
automatically commits the existing composed text if any.public final void setInputMethodRequests(InputMethodRequests value)
public final InputMethodRequests getInputMethodRequests()
public final ObjectProperty<InputMethodRequests> inputMethodRequestsProperty()
protected final void setFocused(boolean value)
public final boolean isFocused()
public final ReadOnlyBooleanProperty focusedProperty()
private Node.FocusedProperty focusedPropertyImpl()
public final void setFocusTraversable(boolean value)
public final boolean isFocusTraversable()
public final BooleanProperty focusTraversableProperty()
private void focusSetDirty(Scene s)
public void requestFocus()
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.@Deprecated public final boolean impl_traverse(Direction dir)
public java.lang.String toString()
toString
in class java.lang.Object
private void preprocessMouseEvent(MouseEvent e)
void markDirtyLayoutBranch()
private void updateTreeVisible(boolean parentChanged)
final void setTreeVisible(boolean value)
@Deprecated public final boolean impl_isTreeVisible()
@Deprecated protected final BooleanExpression impl_treeVisibleProperty()
private void setCanReceiveFocus(boolean value)
final boolean isCanReceiveFocus()
private void updateCanReceiveFocus()
java.lang.String indent()
@Deprecated public final void impl_setShowMnemonics(boolean value)
@Deprecated public final boolean impl_isShowMnemonics()
@Deprecated public final BooleanProperty impl_showMnemonicsProperty()
public final void setEventDispatcher(EventDispatcher value)
public final EventDispatcher getEventDispatcher()
public final ObjectProperty<EventDispatcher> eventDispatcherProperty()
public final <T extends Event> void addEventHandler(EventType<T> eventType, EventHandler<? super T> eventHandler)
Event
of the specified type during the bubbling
phase of event delivery.T
- the specific event class of the handlereventType
- the type of the events to receive by the handlereventHandler
- the handler to registerjava.lang.NullPointerException
- if the event type or handler is nullpublic final <T extends Event> void removeEventHandler(EventType<T> eventType, EventHandler<? super T> eventHandler)
T
- the specific event class of the handlereventType
- the event type from which to unregistereventHandler
- the handler to unregisterjava.lang.NullPointerException
- if the event type or handler is nullpublic final <T extends Event> void addEventFilter(EventType<T> eventType, EventHandler<? super T> eventFilter)
Event
of the specified type during the capturing
phase of event delivery.T
- the specific event class of the filtereventType
- the type of the events to receive by the filtereventFilter
- the filter to registerjava.lang.NullPointerException
- if the event type or filter is nullpublic final <T extends Event> void removeEventFilter(EventType<T> eventType, EventHandler<? super T> eventFilter)
T
- the specific event class of the filtereventType
- the event type from which to unregistereventFilter
- the filter to unregisterjava.lang.NullPointerException
- if the event type or filter is nullprotected final <T extends Event> void setEventHandler(EventType<T> eventType, EventHandler<? super T> eventHandler)
addEventHandler(javafx.event.EventType, javafx.event.EventHandler)
.
This is used for registering the user-defined onFoo event handlers.T
- the specific event class of the handlereventType
- the event type to associate with the given eventHandlereventHandler
- the handler to register, or null to unregisterjava.lang.NullPointerException
- if the event type is nullprivate NodeEventDispatcher getInternalEventDispatcher()
private void initializeInternalEventDispatcher()
private NodeEventDispatcher createInternalEventDispatcher()
public EventDispatchChain buildEventDispatchChain(EventDispatchChain tail)
buildEventDispatchChain
in interface EventTarget
tail
- the initial chain to build frompublic final void fireEvent(Event event)
This method must be called on the FX user thread.
event
- the event to firepublic java.lang.String getTypeSelector()
Styleable
that is to be used in selector matching.
This is analogous to an "element" in HTML.
(CSS Type Selector).getTypeSelector
in interface Styleable
getClass().getName()
without the package namepublic Styleable getStyleableParent()
getStyleableParent
in interface Styleable
getParent()
@Deprecated protected java.lang.Boolean impl_cssGetFocusTraversableInitialValue()
@Deprecated protected Cursor impl_cssGetCursorInitialValue()
public static java.util.List<CssMetaData<? extends Styleable,?>> getClassCssMetaData()
public java.util.List<CssMetaData<? extends Styleable,?>> getCssMetaData()
getClassCssMetaData()
so that
a Node's CssMetaData can be accessed without the need for reflection.getCssMetaData
in interface Styleable
@Deprecated public static java.util.List<Style> impl_getMatchingStyles(CssMetaData cssMetaData, Styleable styleable)
@Deprecated public final ObservableMap<StyleableProperty<?>,java.util.List<Style>> impl_getStyleMap()
@Deprecated public final void impl_setStyleMap(ObservableMap<StyleableProperty<?>,java.util.List<Style>> styleMap)
@Deprecated public java.util.Map<StyleableProperty<?>,java.util.List<Style>> impl_findStyles(java.util.Map<StyleableProperty<?>,java.util.List<Style>> styleMap)
styleMap
- A Map to be populated with the styles. If null, a new Map will be allocated.final CssFlags getCSSFlags()
private void requestCssStateTransition()
public final void pseudoClassStateChanged(PseudoClass pseudoClass, boolean active)
invalidated
method of a property that is used as a pseudo-class. For example:
private static final PseudoClass MY_PSEUDO_CLASS_STATE = PseudoClass.getPseudoClass("my-state");
BooleanProperty myPseudoClassState = new BooleanPropertyBase(false) {
@Override public void invalidated() {
pseudoClassStateChanged(MY_PSEUDO_CLASS_STATE, get());
}
@Override public Object getBean() {
return MyControl.this;
}
@Override public String getName() {
return "myPseudoClassState";
}
};
pseudoClass
- the pseudo-class that has changed stateactive
- whether or not the state is activepublic final ObservableSet<PseudoClass> getPseudoClassStates()
Styleable
getPseudoClassStates
in interface Styleable
final void notifyParentsOfInvalidatedCSS()
@Deprecated public final void impl_reapplyCSS()
private void reapplyCss()
void processCSS()
@Deprecated public final void impl_processCSS(boolean reapply)
applyCss()
public final void applyCss()
Parent.layout()
to size a Node before the
next pulse, or if the Scene
is not in a Stage
.
Provided that the Node's Scene
is not null, CSS is applied to this Node regardless
of whether this Node's CSS state is clean. CSS styles are applied from the top‑most parent
of this Node whose CSS state is other than clean, which may affect the styling of other nodes.
This method is a no-op if the Node is not in a Scene. The Scene does not have to be in a Stage.
This method does not invoke the Parent.layout()
method. Typically, the caller will use the
following sequence of operations.
parentNode.applyCss();
parentNode.layout();
As a more complete example, the following code uses applyCss()
and layout()
to find
the width and height of the Button before the Stage has been shown. If either the call to applyCss()
or the call to layout()
is commented out, the calls to getWidth()
and getHeight()
will return zero (until some time after the Stage is shown).
@Override
public void start(Stage stage) throws Exception {
Group root = new Group();
Scene scene = new Scene(root);
Button button = new Button("Hello World");
root.getChildren().add(button);
root.applyCss();
root.layout();
double width = button.getWidth();
double height = button.getHeight();
System.out.println(width + ", " + height);
stage.setScene(scene);
stage.show();
}
@Deprecated protected void impl_processCSS(WritableValue<java.lang.Boolean> unused)
super.impl_processCSS()
to ensure that
this Node's CSS state is properly updated.
Note that the difference between this method and impl_processCSS(boolean)
is that this method
updates styles for this node on down; whereas, impl_processCSS(boolean)
invokes
applyCss()
which will look for the top-most ancestor that needs CSS update and apply styles
from that node on down.
The WritableValue<Boolean> parameter is no longer used.@Deprecated public abstract java.lang.Object impl_processMXNode(MXNodeAlgorithm alg, MXNodeAlgorithmContext ctx)
alg
- current algorithm to process this nodectx
- current contextpublic final void setAccessibleRole(AccessibleRole value)
public final AccessibleRole getAccessibleRole()
public final ObjectProperty<AccessibleRole> accessibleRoleProperty()
public final void setAccessibleRoleDescription(java.lang.String value)
public final java.lang.String getAccessibleRoleDescription()
public final ObjectProperty<java.lang.String> accessibleRoleDescriptionProperty()
Node
.
Noramlly, when a role is provided for a node, the screen reader speaks the role as well as the contents of the node. When this value is set, it is possbile to override the default. This is useful because the set of roles is predefined. For example, it is possible to set the role of a node to be a button, but have the role description be arbitrary text.
public final void setAccessibleText(java.lang.String value)
public final java.lang.String getAccessibleText()
public final ObjectProperty<java.lang.String> accessibleTextProperty()
Node
.
This property is used to set the text that the screen reader will speak. If a node normally speaks text, that text is overriden. For example, a button usually speaks using the text in the control but will no longer do this when this value is set.
public final void setAccessibleHelp(java.lang.String value)
public final java.lang.String getAccessibleHelp()
public final ObjectProperty<java.lang.String> accessibleHelpProperty()
Node
.
The help text provides a more detailed description of the accessible text for a node. By default, if the node has a tool tip, this text is used.
private Node.AccessibilityProperties getAccessibilityProperties()
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 super class implementation
must be called.
attribute
- the requested attributeparameters
- optional list of parametersAccessibleAttribute
public void executeAccessibleAction(AccessibleAction action, java.lang.Object... parameters)
This method is commonly overridden by subclasses to implement
action that are required for a specific role.
If a particular action is not handled, the super class implementation
must be called.
action
- the action to executeparameters
- optional list of parametersAccessibleAction
public final void notifyAccessibleAttributeChanged(AccessibleAttribute attributes)
notification
- the attribute whose value has changedAccessibleAttribute
Accessible getAccessible()
void releaseAccessible()