public class Scene
extends java.lang.Object
Scene
class is the container for all content in a scene graph.
The background of the scene is filled as specified by the fill
property.
The application must specify the root Node
for the scene graph by setting
the root
property. If a Group
is used as the root, the
contents of the scene graph will be clipped by the scene's width and height and
changes to the scene's size (if user resizes the stage) will not alter the
layout of the scene graph. If a resizable node (layout Region
or
Control
is set as the root, then the root's size will track the
scene's size, causing the contents to be relayed out as necessary.
The scene's size may be initialized by the application during construction. If no size is specified, the scene will automatically compute its initial size based on the preferred size of its content. If only one dimension is specified, the other dimension is computed using the specified dimension, respecting content bias of a root.
An application may request depth buffer support or scene anti-aliasing
support at the creation of a Scene
. A scene with only 2D shapes and
without any 3D transforms does not need a depth buffer nor scene
anti-aliasing support. A scene containing 3D shapes or 2D shapes with 3D
transforms may use depth buffer support for proper depth sorted rendering; to
avoid depth fighting (also known as Z fighting), disable depth testing on 2D
shapes that have no 3D transforms. See
depthTest
for more information. A scene with
3D shapes may enable scene anti-aliasing to improve its rendering quality.
The depthBuffer and antiAliasing flags are conditional features. With the
respective default values of: false and SceneAntialiasing.DISABLED
.
See ConditionalFeature.SCENE3D
for more information.
A default headlight will be added to a scene that contains one or more
Shape3D
nodes, but no light nodes. This light source is a
Color.WHITE
PointLight
placed at the camera position.
A Scene
may be created and modified on any thread until it is attached
to a Window
that is showing
.
After that, it must be modified only on the JavaFX Application Thread.
Note that Scene
is not thread-safe; modifying a Scene
on
multiple threads at the same time will lead to unpredictable results and
must be avoided.
The JavaFX Application Thread is created as part of the startup process for
the JavaFX runtime. See the javafx.application.Application
class and
the Platform#startup(Runnable)
method for more information.
Example:
import javafx.scene.*; import javafx.scene.paint.*; import javafx.scene.shape.*; Group root = new Group(); Scene s = new Scene(root, 300, 300, Color.BLACK); Rectangle r = new Rectangle(25,25,250,250); r.setFill(Color.BLUE); root.getChildren().add(r);
Type | Property and Description |
---|---|
<any> |
camera
Specifies the type of camera use for rendering this
Scene . |
<any> |
cursor
Defines the mouse cursor for this
Scene . |
<any> |
effectiveNodeOrientation
The effective node orientation of a scene resolves the inheritance of
node orientation, returning either left-to-right or right-to-left.
|
<any> |
eventDispatcher
Specifies the event dispatcher for this scene.
|
<any> |
fill
Defines the background fill of this
Scene . |
<any> |
focusOwner
The scene's current focus owner node.
|
ReadOnlyDoubleProperty |
height
The height of this
Scene |
<any> |
nodeOrientation
Property holding NodeOrientation.
|
<any> |
onContextMenuRequested
Defines a function to be called when a mouse button has been clicked
(pressed and released) on this
Scene . |
<any> |
onDragDetected
Defines a function to be called when drag gesture has been
detected.
|
<any> |
onDragDone
Defines a function to be called when this
Scene is a
drag and drop gesture source after its data has
been dropped on a drop target. |
<any> |
onDragDropped
Defines a function to be called when the mouse button is released
on this
Scene during drag and drop gesture. |
<any> |
onDragEntered
Defines a function to be called when drag gesture
enters this
Scene . |
<any> |
onDragExited
Defines a function to be called when drag gesture
exits this
Scene . |
<any> |
onDragOver
Defines a function to be called when drag gesture progresses
within this
Scene . |
<any> |
onInputMethodTextChanged
Defines a function to be called when this
Node
has input focus and the input method text has changed. |
<any> |
onKeyPressed
Defines a function to be called when some
Node of this
Scene has input focus and a key has been pressed. |
<any> |
onKeyReleased
Defines a function to be called when some
Node of this
Scene has input focus and a key has been released. |
<any> |
onKeyTyped
Defines a function to be called when some
Node of this
Scene has input focus and a key has been typed. |
<any> |
onMouseClicked
Defines a function to be called when a mouse button has been clicked
(pressed and released) on this
Scene . |
<any> |
onMouseDragEntered
Defines a function to be called when a full press-drag-release gesture
enters this
Scene . |
<any> |
onMouseDragExited
Defines a function to be called when a full press-drag-release gesture
exits this
Scene . |
<any> |
onMouseDragged
Defines a function to be called when a mouse button is pressed
on this
Scene and then dragged. |
<any> |
onMouseDragOver
Defines a function to be called when a full press-drag-release gesture
progresses within this
Scene . |
<any> |
onMouseDragReleased
Defines a function to be called when a full press-drag-release gesture
ends within this
Scene . |
<any> |
onMouseEntered
Defines a function to be called when the mouse enters this
Scene . |
<any> |
onMouseExited
Defines a function to be called when the mouse exits this
Scene . |
<any> |
onMouseMoved
Defines a function to be called when mouse cursor moves within
this
Scene but no buttons have been pushed. |
<any> |
onMousePressed
Defines a function to be called when a mouse button
has been pressed on this
Scene . |
<any> |
onMouseReleased
Defines a function to be called when a mouse button
has been released on this
Scene . |
<any> |
onRotate
Defines a function to be called when user performs a rotating action.
|
<any> |
onRotationFinished
Defines a function to be called when a rotating gesture ends.
|
<any> |
onRotationStarted
Defines a function to be called when a rotating gesture is detected.
|
<any> |
onScrollFinished
Defines a function to be called when a scrolling gesture ends.
|
<any> |
onScroll
Defines a function to be called when user performs a scrolling action.
|
<any> |
onScrollStarted
Defines a function to be called when a scrolling gesture is detected.
|
<any> |
onSwipeDown
Defines a function to be called when an downward swipe gesture
happens in this scene.
|
<any> |
onSwipeLeft
Defines a function to be called when an leftward swipe gesture
happens in this scene.
|
<any> |
onSwipeRight
Defines a function to be called when an rightward swipe gesture
happens in this scene.
|
<any> |
onSwipeUp
Defines a function to be called when an upward swipe gesture
happens in this scene.
|
<any> |
onTouchMoved
Defines a function to be called when a touch point is moved.
|
<any> |
onTouchPressed
Defines a function to be called when a new touch point is pressed.
|
<any> |
onTouchReleased
Defines a function to be called when a new touch point is pressed.
|
<any> |
onTouchStationary
Defines a function to be called when a touch point stays pressed and
still.
|
<any> |
onZoomFinished
Defines a function to be called when a zooming gesture ends.
|
<any> |
onZoom
Defines a function to be called when user performs a zooming action.
|
<any> |
onZoomStarted
Defines a function to be called when a zooming gesture is detected.
|
<any> |
root
Defines the root
Node of the scene graph. |
<any> |
userAgentStylesheet |
ReadOnlyDoubleProperty |
width
The width of this
Scene |
<any> |
window
The
Window for this Scene |
ReadOnlyDoubleProperty |
x
The horizontal location of this
Scene on the Window . |
ReadOnlyDoubleProperty |
y
The vertical location of this
Scene on the Window . |
Modifier and Type | Class and Description |
---|---|
(package private) static class |
Scene.ClickCounter
*
Mouse Event Handling *
*
|
(package private) static class |
Scene.ClickGenerator |
private static class |
Scene.DirtyBits |
(package private) class |
Scene.DnDGesture
A Drag and Drop gesture has a lifespan that lasts from mouse
PRESSED event to mouse RELEASED event.
|
private static class |
Scene.DragDetectedState
State of a drag gesture with regards to DRAG_DETECTED event.
|
(package private) class |
Scene.DragGestureListener |
(package private) class |
Scene.DragSourceListener |
(package private) class |
Scene.DropTargetListener
*
Drag and Drop *
*
|
private class |
Scene.EffectiveOrientationProperty |
(package private) class |
Scene.InputMethodRequestsDelegate |
(package private) class |
Scene.KeyHandler
*
Key Event Handling *
*
|
(package private) class |
Scene.MouseHandler |
(package private) class |
Scene.ScenePeerListener
*
Scene Peer Listener *
*
|
private class |
Scene.ScenePeerPaintListener |
(package private) class |
Scene.ScenePulseListener
*
Scene Pulse Listener *
*
|
private static class |
Scene.TargetWrapper |
private static class |
Scene.TouchGesture |
private static class |
Scene.TouchMap |
Modifier and Type | Field and Description |
---|---|
(package private) java.security.AccessControlContext |
acc |
private Accessible |
accessible |
private java.util.Map<Node,Accessible> |
accMap |
private static boolean |
allowPGAccess |
private SceneAntialiasing |
antiAliasing |
private <any> |
camera
Specifies the type of camera use for rendering this
Scene . |
private Scene.ClickGenerator |
clickGenerator |
private <any> |
cursor
Defines the mouse cursor for this
Scene . |
private Point2D |
cursorScenePos |
private Point2D |
cursorScreenPos |
private Camera |
defaultCamera |
private static NodeOrientation |
defaultNodeOrientation
*
Component Orientation Properties *
*
|
private boolean |
depthBuffer |
private int |
dirtyBits |
private Node[] |
dirtyNodes
Set of dirty nodes; processed once per frame by the synchronizer.
|
private int |
dirtyNodesSize |
(package private) Scene.DnDGesture |
dndGesture |
(package private) Scene.DragGestureListener |
dragGestureListener |
private NodeOrientation |
effectiveNodeOrientation |
private Scene.EffectiveOrientationProperty |
effectiveNodeOrientationProperty |
private <any> |
eventDispatcher
Specifies the event dispatcher for this scene.
|
private <any> |
fill
Defines the background fill of this
Scene . |
private boolean |
focusDirty
Set to true if something has happened to the focused node that makes
it no longer eligible to have the focus.
|
private <any> |
focusOwner
The scene's current focus owner node.
|
private ReadOnlyDoubleWrapper |
height
The height of this
Scene |
private double |
heightSetByUser |
private static boolean |
inMousePick |
private static boolean |
inSynchronizer |
private SceneEventDispatcher |
internalEventDispatcher |
private Scene.KeyHandler |
keyHandler
*
Key Events and Focus Traversal *
*
|
private java.util.List<LightBase> |
lights |
private static int |
MIN_DIRTY_CAPACITY |
private Scene.MouseHandler |
mouseHandler |
private TouchEvent |
nextTouchEvent |
private <any> |
nodeOrientation |
private Node |
oldFocusOwner |
(package private) Parent |
oldRoot |
private <any> |
onContextMenuRequested
Defines a function to be called when a mouse button has been clicked
(pressed and released) on this
Scene . |
private <any> |
onDragDetected
Defines a function to be called when drag gesture has been
detected.
|
private <any> |
onDragDone |
private <any> |
onDragDropped |
private <any> |
onDragEntered
*
Drag and Drop Handling *
*
|
private <any> |
onDragExited |
private <any> |
onDragOver |
private <any> |
onInputMethodTextChanged
Defines a function to be called when this
Node
has input focus and the input method text has changed. |
private <any> |
onKeyPressed
Defines a function to be called when some
Node of this
Scene has input focus and a key has been pressed. |
private <any> |
onKeyReleased
Defines a function to be called when some
Node of this
Scene has input focus and a key has been released. |
private <any> |
onKeyTyped
Defines a function to be called when some
Node of this
Scene has input focus and a key has been typed. |
private <any> |
onMouseClicked
Defines a function to be called when a mouse button has been clicked
(pressed and released) on this
Scene . |
private <any> |
onMouseDragEntered
Defines a function to be called when a full press-drag-release gesture
enters this
Scene . |
private <any> |
onMouseDragExited
Defines a function to be called when a full press-drag-release gesture
exits this
Scene . |
private <any> |
onMouseDragged
Defines a function to be called when a mouse button is pressed
on this
Scene and then dragged. |
private <any> |
onMouseDragOver
Defines a function to be called when a full press-drag-release gesture
progresses within this
Scene . |
private <any> |
onMouseDragReleased
Defines a function to be called when a full press-drag-release gesture
ends within this
Scene . |
private <any> |
onMouseEntered
Defines a function to be called when the mouse enters this
Scene . |
private <any> |
onMouseExited
Defines a function to be called when the mouse exits this
Scene . |
private <any> |
onMouseMoved
Defines a function to be called when mouse cursor moves within
this
Scene but no buttons have been pushed. |
private <any> |
onMousePressed
Defines a function to be called when a mouse button
has been pressed on this
Scene . |
private <any> |
onMouseReleased
Defines a function to be called when a mouse button
has been released on this
Scene . |
private <any> |
onRotate
Defines a function to be called when user performs a rotating action.
|
private <any> |
onRotationFinished
Defines a function to be called when a rotating gesture ends.
|
private <any> |
onRotationStarted
Defines a function to be called when a rotating gesture is detected.
|
private <any> |
onScroll
Defines a function to be called when user performs a scrolling action.
|
private <any> |
onScrollFinished
Defines a function to be called when a scrolling gesture ends.
|
private <any> |
onScrollStarted
Defines a function to be called when a scrolling gesture is detected.
|
private <any> |
onSwipeDown
Defines a function to be called when an downward swipe gesture
happens in this scene.
|
private <any> |
onSwipeLeft
Defines a function to be called when an leftward swipe gesture
happens in this scene.
|
private <any> |
onSwipeRight
Defines a function to be called when an rightward swipe gesture
happens in this scene.
|
private <any> |
onSwipeUp
Defines a function to be called when an upward swipe gesture
happens in this scene.
|
private <any> |
onTouchMoved
Defines a function to be called when a touch point is moved.
|
private <any> |
onTouchPressed
Defines a function to be called when a new touch point is pressed.
|
private <any> |
onTouchReleased
Defines a function to be called when a new touch point is pressed.
|
private <any> |
onTouchStationary
Defines a function to be called when a touch point stays pressed and
still.
|
private <any> |
onZoom
Defines a function to be called when user performs a zooming action.
|
private <any> |
onZoomFinished
Defines a function to be called when a zooming gesture ends.
|
private <any> |
onZoomStarted
Defines a function to be called when a zooming gesture is detected.
|
private TKScene |
peer
The peer of this scene
|
private static int |
pgAccessCount |
private static boolean |
PLATFORM_DRAG_GESTURE_INITIATION
If true, use the platform's drag gesture detection
else use Scene-level detection as per DnDGesture.process(MouseEvent, List)
|
private java.util.List<java.lang.Runnable> |
postLayoutPulseListeners |
private java.util.List<java.lang.Runnable> |
preLayoutPulseListeners |
private <any> |
properties |
private <any> |
root
Defines the root
Node of the scene graph. |
private Scene.TouchGesture |
rotateGesture |
(package private) Scene.ScenePulseListener |
scenePulseListener
The scene pulse listener that gets called on toolkit pulses
|
private Scene.TouchGesture |
scrollGesture |
private boolean |
sizeInitialized |
private static TKPulseListener |
snapshotPulseListener |
private static java.util.List<java.lang.Runnable> |
snapshotRunnableList |
private static java.util.List<java.lang.Runnable> |
snapshotRunnableListA |
private static java.util.List<java.lang.Runnable> |
snapshotRunnableListB |
private <any> |
stylesheets
A ObservableList of string URLs linking to the stylesheets to use with this scene's
contents.
|
private Scene.TouchGesture |
swipeGesture |
(package private) java.lang.Runnable |
testPulseListener
A listener for pulses, used for testing.
|
private Scene.TargetWrapper |
tmpTargetWrapper |
private int |
touchEventSetId |
private Scene.TouchMap |
touchMap |
private int |
touchPointIndex |
private TouchPoint[] |
touchPoints |
private java.util.Map<java.lang.Integer,EventTarget> |
touchTargets |
private PerformanceTracker |
tracker |
private static java.lang.Object |
trackerMonitor |
private Node |
transientFocusContainer
A node that is temporarily responsible for the FOCUS_NODE
accessibility attribute.
|
private TopMostTraversalEngine |
traversalEngine |
private static java.lang.Object |
USER_DATA_KEY
*
*
*
|
private <any> |
userAgentStylesheet |
private ReadOnlyDoubleWrapper |
width
The width of this
Scene |
private double |
widthSetByUser |
private <any> |
window
The
Window for this Scene |
private ReadOnlyDoubleWrapper |
x
The horizontal location of this
Scene on the Window . |
private ReadOnlyDoubleWrapper |
y
The vertical location of this
Scene on the Window . |
private Scene.TouchGesture |
zoomGesture |
Modifier | Constructor and Description |
---|---|
|
Scene(Parent root)
Creates a Scene for a specific root Node.
|
|
Scene(Parent root,
double width,
double height)
Creates a Scene for a specific root Node with a specific size.
|
|
Scene(Parent root,
double width,
double height,
boolean depthBuffer,
SceneAntialiasing antiAliasing)
Constructs a scene consisting of a root, with a dimension of width and
height, specifies whether a depth buffer is created for this scene and
specifies whether scene anti-aliasing is requested.
|
|
Scene(Parent root,
double width,
double height,
Paint fill)
Creates a Scene for a specific root Node with a specific size and fill.
|
private |
Scene(Parent root,
double width,
double height,
Paint fill,
boolean depthBuffer,
SceneAntialiasing antiAliasing) |
|
Scene(Parent root,
Paint fill)
Creates a Scene for a specific root Node with a fill.
|
Modifier and Type | Method and Description |
---|---|
(package private) void |
addAccessible(Node node,
Accessible acc) |
<T extends Event> |
addEventFilter(<any> eventType,
<any> eventFilter)
Registers an event filter to this scene.
|
<T extends Event> |
addEventHandler(<any> eventType,
<any> eventHandler)
Registers an event handler to this scene.
|
(package private) void |
addLight(LightBase light) |
void |
addMnemonic(Mnemonic m)
Registers the specified mnemonic.
|
void |
addPostLayoutPulseListener(java.lang.Runnable r)
Adds a new scene post layout pulse listener to this scene.
|
void |
addPreLayoutPulseListener(java.lang.Runnable r)
Adds a new scene pre layout pulse listener to this scene.
|
(package private) static void |
addSnapshotRunnable(java.lang.Runnable runnable) |
(package private) void |
addToDirtyList(Node n)
Add the specified node to this scene's dirty list.
|
EventDispatchChain |
buildEventDispatchChain(EventDispatchChain tail)
Construct an event dispatch chain for this scene.
|
private NodeOrientation |
calcEffectiveNodeOrientation() |
<any> |
cameraProperty()
Specifies the type of camera use for rendering this
Scene . |
private void |
clearDirty()
Clear all dirty bits
|
(package private) void |
clearNodeMnemonics(Node node) |
private SceneEventDispatcher |
createInternalEventDispatcher() |
<any> |
cursorProperty()
Defines the mouse cursor for this
Scene . |
private void |
disposeAccessibles() |
void |
disposePeer() |
(package private) void |
doCSSLayoutSyncForSnapshot(Node node) |
private void |
doCSSPass() |
(package private) void |
doLayoutPass() |
(package private) static WritableImage |
doSnapshot(Scene scene,
double x,
double y,
double w,
double h,
Node root,
BaseTransform transform,
boolean depthBuffer,
Paint fill,
Camera camera,
WritableImage wimg) |
private WritableImage |
doSnapshot(WritableImage img)
Implementation method for snapshot
|
<any> |
effectiveNodeOrientationProperty()
The effective node orientation of a scene resolves the inheritance of
node orientation, returning either left-to-right or right-to-left.
|
void |
enableInputMethodEvents(boolean enable) |
<any> |
eventDispatcherProperty()
Specifies the event dispatcher for this scene.
|
<any> |
fillProperty()
Defines the background fill of this
Scene . |
(package private) void |
focusCleanup() |
private void |
focusIneligible(Node node)
Moves the focus to a reasonble location "near" the given node.
|
private void |
focusInitial()
Moves the focus to a reasonable initial location.
|
<any> |
focusOwnerProperty()
The scene's current focus owner node.
|
(package private) void |
generateMouseExited(Node removing)
Generates mouse exited event for a node which is going to be removed
and its children, where appropriate.
|
<any> |
getAccelerators()
Gets the list of accelerators for this
Scene . |
(package private) Accessible |
getAccessible() |
SceneAntialiasing |
getAntiAliasing()
Return the defined
SceneAntialiasing for this Scene . |
private boolean |
getAntiAliasingInternal() |
Camera |
getCamera()
Gets the value of the property camera.
|
Cursor |
getCursor()
Gets the value of the property cursor.
|
(package private) Camera |
getEffectiveCamera() |
NodeOrientation |
getEffectiveNodeOrientation()
Gets the value of the property effectiveNodeOrientation.
|
EventDispatcher |
getEventDispatcher()
Gets the value of the property eventDispatcher.
|
Paint |
getFill()
Gets the value of the property fill.
|
Node |
getFocusOwner()
Gets the value of the property focusOwner.
|
double |
getHeight()
Gets the value of the property height.
|
private SceneEventDispatcher |
getInternalEventDispatcher() |
private Scene.KeyHandler |
getKeyHandler() |
<any> |
getMnemonics()
Gets the list of mnemonics for this
Scene . |
NodeOrientation |
getNodeOrientation()
Gets the value of the property nodeOrientation.
|
<any> |
getOnContextMenuRequested()
Gets the value of the property onContextMenuRequested.
|
<any> |
getOnDragDetected()
Gets the value of the property onDragDetected.
|
<any> |
getOnDragDone()
Gets the value of the property onDragDone.
|
<any> |
getOnDragDropped()
Gets the value of the property onDragDropped.
|
<any> |
getOnDragEntered()
Gets the value of the property onDragEntered.
|
<any> |
getOnDragExited()
Gets the value of the property onDragExited.
|
<any> |
getOnDragOver()
Gets the value of the property onDragOver.
|
<any> |
getOnInputMethodTextChanged()
Gets the value of the property onInputMethodTextChanged.
|
<any> |
getOnKeyPressed()
Gets the value of the property onKeyPressed.
|
<any> |
getOnKeyReleased()
Gets the value of the property onKeyReleased.
|
<any> |
getOnKeyTyped()
Gets the value of the property onKeyTyped.
|
<any> |
getOnMouseClicked()
Gets the value of the property onMouseClicked.
|
<any> |
getOnMouseDragEntered()
Gets the value of the property onMouseDragEntered.
|
<any> |
getOnMouseDragExited()
Gets the value of the property onMouseDragExited.
|
<any> |
getOnMouseDragged()
Gets the value of the property onMouseDragged.
|
<any> |
getOnMouseDragOver()
Gets the value of the property onMouseDragOver.
|
<any> |
getOnMouseDragReleased()
Gets the value of the property onMouseDragReleased.
|
<any> |
getOnMouseEntered()
Gets the value of the property onMouseEntered.
|
<any> |
getOnMouseExited()
Gets the value of the property onMouseExited.
|
<any> |
getOnMouseMoved()
Gets the value of the property onMouseMoved.
|
<any> |
getOnMousePressed()
Gets the value of the property onMousePressed.
|
<any> |
getOnMouseReleased()
Gets the value of the property onMouseReleased.
|
<any> |
getOnRotate()
Gets the value of the property onRotate.
|
<any> |
getOnRotationFinished()
Gets the value of the property onRotationFinished.
|
<any> |
getOnRotationStarted()
Gets the value of the property onRotationStarted.
|
<any> |
getOnScroll()
Gets the value of the property onScroll.
|
<any> |
getOnScrollFinished()
Gets the value of the property onScrollFinished.
|
<any> |
getOnScrollStarted()
Gets the value of the property onScrollStarted.
|
<any> |
getOnSwipeDown()
Gets the value of the property onSwipeDown.
|
<any> |
getOnSwipeLeft()
Gets the value of the property onSwipeLeft.
|
<any> |
getOnSwipeRight()
Gets the value of the property onSwipeRight.
|
<any> |
getOnSwipeUp()
Gets the value of the property onSwipeUp.
|
<any> |
getOnTouchMoved()
Gets the value of the property onTouchMoved.
|
<any> |
getOnTouchPressed()
Gets the value of the property onTouchPressed.
|
<any> |
getOnTouchReleased()
Gets the value of the property onTouchReleased.
|
<any> |
getOnTouchStationary()
Gets the value of the property onTouchStationary.
|
<any> |
getOnZoom()
Gets the value of the property onZoom.
|
<any> |
getOnZoomFinished()
Gets the value of the property onZoomFinished.
|
<any> |
getOnZoomStarted()
Gets the value of the property onZoomStarted.
|
(package private) TKScene |
getPeer() |
private static double |
getPreferredHeight(Parent root,
double forcedHeight,
double width) |
private static double |
getPreferredWidth(Parent root,
double forcedWidth,
double height) |
<any> |
getProperties()
Returns an observable map of properties on this node for use primarily
by application developers.
|
Parent |
getRoot()
Gets the value of the property root.
|
<any> |
getStylesheets()
Gets an observable list of string URLs linking to the stylesheets to use
with this scene's contents.
|
java.lang.String |
getUserAgentStylesheet()
Get the URL of the user-agent stylesheet that will be used by this Scene.
|
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. |
double |
getWidth()
Gets the value of the property width.
|
Window |
getWindow()
Gets the value of the property window.
|
double |
getX()
Gets the value of the property x.
|
double |
getY()
Gets the value of the property y.
|
boolean |
hasProperties()
Tests if Scene has properties.
|
ReadOnlyDoubleProperty |
heightProperty()
The height of this
Scene |
private ReadOnlyDoubleWrapper |
heightPropertyImpl() |
private void |
init() |
private void |
init(double width,
double height) |
(package private) void |
initializeInternalEventDispatcher() |
(package private) void |
initPeer() |
boolean |
isDepthBuffer()
Retrieves the depth buffer attribute for this scene.
|
(package private) boolean |
isDepthBufferInternal() |
private boolean |
isDirty(Scene.DirtyBits dirtyBit)
Test the specified dirty bit
|
private boolean |
isDirtyEmpty()
Test whether the dirty bits are empty
|
(package private) boolean |
isFocusDirty() |
private boolean |
isInScene(double x,
double y) |
(package private) static boolean |
isPGAccessAllowed()
Used for debugging purposes.
|
(package private) boolean |
isQuiescent()
Returns true if this scene is quiescent, i.e.
|
Node |
lookup(java.lang.String selector)
Looks for any node within the scene graph based on the specified CSS selector.
|
(package private) void |
markCameraDirty() |
(package private) void |
markCursorDirty() |
private void |
markDirty(Scene.DirtyBits dirtyBit)
Set the specified dirty bit and mark the peer as dirty
|
<any> |
nodeOrientationProperty()
Property holding NodeOrientation.
|
<any> |
onContextMenuRequestedProperty()
Defines a function to be called when a mouse button has been clicked
(pressed and released) on this
Scene . |
<any> |
onDragDetectedProperty()
Defines a function to be called when drag gesture has been
detected.
|
<any> |
onDragDoneProperty()
Defines a function to be called when this
Scene is a
drag and drop gesture source after its data has
been dropped on a drop target. |
<any> |
onDragDroppedProperty()
Defines a function to be called when the mouse button is released
on this
Scene during drag and drop gesture. |
<any> |
onDragEnteredProperty()
Defines a function to be called when drag gesture
enters this
Scene . |
<any> |
onDragExitedProperty()
Defines a function to be called when drag gesture
exits this
Scene . |
<any> |
onDragOverProperty()
Defines a function to be called when drag gesture progresses
within this
Scene . |
<any> |
onInputMethodTextChangedProperty()
Defines a function to be called when this
Node
has input focus and the input method text has changed. |
<any> |
onKeyPressedProperty()
Defines a function to be called when some
Node of this
Scene has input focus and a key has been pressed. |
<any> |
onKeyReleasedProperty()
Defines a function to be called when some
Node of this
Scene has input focus and a key has been released. |
<any> |
onKeyTypedProperty()
Defines a function to be called when some
Node of this
Scene has input focus and a key has been typed. |
<any> |
onMouseClickedProperty()
Defines a function to be called when a mouse button has been clicked
(pressed and released) on this
Scene . |
<any> |
onMouseDragEnteredProperty()
Defines a function to be called when a full press-drag-release gesture
enters this
Scene . |
<any> |
onMouseDragExitedProperty()
Defines a function to be called when a full press-drag-release gesture
exits this
Scene . |
<any> |
onMouseDraggedProperty()
Defines a function to be called when a mouse button is pressed
on this
Scene and then dragged. |
<any> |
onMouseDragOverProperty()
Defines a function to be called when a full press-drag-release gesture
progresses within this
Scene . |
<any> |
onMouseDragReleasedProperty()
Defines a function to be called when a full press-drag-release gesture
ends within this
Scene . |
<any> |
onMouseEnteredProperty()
Defines a function to be called when the mouse enters this
Scene . |
<any> |
onMouseExitedProperty()
Defines a function to be called when the mouse exits this
Scene . |
<any> |
onMouseMovedProperty()
Defines a function to be called when mouse cursor moves within
this
Scene but no buttons have been pushed. |
<any> |
onMousePressedProperty()
Defines a function to be called when a mouse button
has been pressed on this
Scene . |
<any> |
onMouseReleasedProperty()
Defines a function to be called when a mouse button
has been released on this
Scene . |
<any> |
onRotateProperty()
Defines a function to be called when user performs a rotating action.
|
<any> |
onRotationFinishedProperty()
Defines a function to be called when a rotating gesture ends.
|
<any> |
onRotationStartedProperty()
Defines a function to be called when a rotating gesture is detected.
|
<any> |
onScrollFinishedProperty()
Defines a function to be called when a scrolling gesture ends.
|
<any> |
onScrollProperty()
Defines a function to be called when user performs a scrolling action.
|
<any> |
onScrollStartedProperty()
Defines a function to be called when a scrolling gesture is detected.
|
<any> |
onSwipeDownProperty()
Defines a function to be called when an downward swipe gesture
happens in this scene.
|
<any> |
onSwipeLeftProperty()
Defines a function to be called when an leftward swipe gesture
happens in this scene.
|
<any> |
onSwipeRightProperty()
Defines a function to be called when an rightward swipe gesture
happens in this scene.
|
<any> |
onSwipeUpProperty()
Defines a function to be called when an upward swipe gesture
happens in this scene.
|
<any> |
onTouchMovedProperty()
Defines a function to be called when a touch point is moved.
|
<any> |
onTouchPressedProperty()
Defines a function to be called when a new touch point is pressed.
|
<any> |
onTouchReleasedProperty()
Defines a function to be called when a new touch point is pressed.
|
<any> |
onTouchStationaryProperty()
Defines a function to be called when a touch point stays pressed and
still.
|
<any> |
onZoomFinishedProperty()
Defines a function to be called when a zooming gesture ends.
|
<any> |
onZoomProperty()
Defines a function to be called when user performs a zooming action.
|
<any> |
onZoomStartedProperty()
Defines a function to be called when a zooming gesture is detected.
|
private void |
parentEffectiveOrientationInvalidated() |
private PickResult |
pick(double x,
double y) |
private void |
pick(Scene.TargetWrapper target,
double x,
double y) |
(package private) void |
preferredSize() |
private void |
processGestureEvent(GestureEvent e,
Scene.TouchGesture gesture) |
private void |
processInputMethodEvent(InputMethodEvent e) |
void |
processKeyEvent(KeyEvent e) |
private void |
processMenuEvent(double x2,
double y2,
double xAbs,
double yAbs,
boolean isKeyboardTrigger) |
(package private) void |
processMouseEvent(MouseEvent e) |
private void |
processTouchEvent(TouchEvent e,
TouchPoint[] touchPoints) |
(package private) Accessible |
removeAccessible(Node node) |
<T extends Event> |
removeEventFilter(<any> eventType,
<any> eventFilter)
Unregisters a previously registered event filter from this scene.
|
<T extends Event> |
removeEventHandler(<any> eventType,
<any> eventHandler)
Unregisters a previously registered event handler from this scene.
|
(package private) void |
removeLight(LightBase light) |
void |
removeMnemonic(Mnemonic m)
Unregisters the specified mnemonic.
|
void |
removePostLayoutPulseListener(java.lang.Runnable r)
Removes a previously registered scene post layout pulse listener from listening to
pulses in this scene.
|
void |
removePreLayoutPulseListener(java.lang.Runnable r)
Removes a previously registered scene pre layout pulse listener from listening to
pulses in this scene.
|
(package private) void |
requestFocus(Node node) |
(package private) void |
resizeRootOnSceneSizeChange(double newWidth,
double newHeight) |
(package private) void |
resizeRootToPreferredSize(Parent root) |
<any> |
rootProperty()
Defines the root
Node of the scene graph. |
private void |
sceneEffectiveOrientationInvalidated() |
(package private) static void |
setAllowPGAccess(boolean flag) |
void |
setCamera(Camera value)
Sets the value of the property camera.
|
void |
setCursor(Cursor value)
Sets the value of the property cursor.
|
private void |
setDirty(Scene.DirtyBits dirtyBit)
Set the specified dirty bit
|
void |
setEventDispatcher(EventDispatcher value)
Sets the value of the property eventDispatcher.
|
protected <T extends Event> |
setEventHandler(<any> eventType,
<any> eventHandler)
Sets the handler to use for this event type.
|
void |
setFill(Paint value)
Sets the value of the property fill.
|
(package private) void |
setFocusDirty(boolean value) |
private void |
setHeight(double value) |
(package private) void |
setNeedsRepaint() |
void |
setNodeOrientation(NodeOrientation orientation)
Sets the value of the property nodeOrientation.
|
void |
setOnContextMenuRequested(<any> value)
Sets the value of the property onContextMenuRequested.
|
void |
setOnDragDetected(<any> value)
Sets the value of the property onDragDetected.
|
void |
setOnDragDone(<any> value)
Sets the value of the property onDragDone.
|
void |
setOnDragDropped(<any> value)
Sets the value of the property onDragDropped.
|
void |
setOnDragEntered(<any> value)
Sets the value of the property onDragEntered.
|
void |
setOnDragExited(<any> value)
Sets the value of the property onDragExited.
|
void |
setOnDragOver(<any> value)
Sets the value of the property onDragOver.
|
void |
setOnInputMethodTextChanged(<any> value)
Sets the value of the property onInputMethodTextChanged.
|
void |
setOnKeyPressed(<any> value)
Sets the value of the property onKeyPressed.
|
void |
setOnKeyReleased(<any> value)
Sets the value of the property onKeyReleased.
|
void |
setOnKeyTyped(<any> value)
Sets the value of the property onKeyTyped.
|
void |
setOnMouseClicked(<any> value)
Sets the value of the property onMouseClicked.
|
void |
setOnMouseDragEntered(<any> value)
Sets the value of the property onMouseDragEntered.
|
void |
setOnMouseDragExited(<any> value)
Sets the value of the property onMouseDragExited.
|
void |
setOnMouseDragged(<any> value)
Sets the value of the property onMouseDragged.
|
void |
setOnMouseDragOver(<any> value)
Sets the value of the property onMouseDragOver.
|
void |
setOnMouseDragReleased(<any> value)
Sets the value of the property onMouseDragReleased.
|
void |
setOnMouseEntered(<any> value)
Sets the value of the property onMouseEntered.
|
void |
setOnMouseExited(<any> value)
Sets the value of the property onMouseExited.
|
void |
setOnMouseMoved(<any> value)
Sets the value of the property onMouseMoved.
|
void |
setOnMousePressed(<any> value)
Sets the value of the property onMousePressed.
|
void |
setOnMouseReleased(<any> value)
Sets the value of the property onMouseReleased.
|
void |
setOnRotate(<any> value)
Sets the value of the property onRotate.
|
void |
setOnRotationFinished(<any> value)
Sets the value of the property onRotationFinished.
|
void |
setOnRotationStarted(<any> value)
Sets the value of the property onRotationStarted.
|
void |
setOnScroll(<any> value)
Sets the value of the property onScroll.
|
void |
setOnScrollFinished(<any> value)
Sets the value of the property onScrollFinished.
|
void |
setOnScrollStarted(<any> value)
Sets the value of the property onScrollStarted.
|
void |
setOnSwipeDown(<any> value)
Sets the value of the property onSwipeDown.
|
void |
setOnSwipeLeft(<any> value)
Sets the value of the property onSwipeLeft.
|
void |
setOnSwipeRight(<any> value)
Sets the value of the property onSwipeRight.
|
void |
setOnSwipeUp(<any> value)
Sets the value of the property onSwipeUp.
|
void |
setOnTouchMoved(<any> value)
Sets the value of the property onTouchMoved.
|
void |
setOnTouchPressed(<any> value)
Sets the value of the property onTouchPressed.
|
void |
setOnTouchReleased(<any> value)
Sets the value of the property onTouchReleased.
|
void |
setOnTouchStationary(<any> value)
Sets the value of the property onTouchStationary.
|
void |
setOnZoom(<any> value)
Sets the value of the property onZoom.
|
void |
setOnZoomFinished(<any> value)
Sets the value of the property onZoomFinished.
|
void |
setOnZoomStarted(<any> value)
Sets the value of the property onZoomStarted.
|
void |
setRoot(Parent value)
Sets the value of the property root.
|
void |
setUserAgentStylesheet(java.lang.String url)
Set the URL of the user-agent stylesheet that will be used by this Scene in place of the
the platform-default user-agent stylesheet.
|
void |
setUserData(java.lang.Object value)
Convenience method for setting a single Object property that can be
retrieved at a later date.
|
private void |
setWidth(double value) |
(package private) void |
setWindow(Window value) |
private void |
setX(double value) |
private void |
setY(double value) |
void |
snapshot(<any> callback,
WritableImage image)
Takes a snapshot of this scene at the next frame and calls the
specified callback method when the image is ready.
|
WritableImage |
snapshot(WritableImage image)
Takes a snapshot of this scene and returns the rendered image when
it is ready.
|
(package private) Dragboard |
startDragAndDrop(EventTarget source,
TransferMode... transferModes) |
Dragboard |
startDragAndDrop(TransferMode... transferModes)
Confirms a potential drag and drop gesture that is recognized over this
Scene . |
void |
startFullDrag()
Starts a full press-drag-release gesture with this scene as gesture
source.
|
(package private) void |
startFullDrag(EventTarget source) |
private void |
syncLights()
PG Light synchronizer.
|
(package private) Node |
test_pick(double x,
double y)
Note: The only user of this method is in unit test: PickAndContainTest.
|
(package private) boolean |
traverse(Node node,
Direction dir)
Traverses focus from the given node in the given direction.
|
<any> |
userAgentStylesheetProperty() |
ReadOnlyDoubleProperty |
widthProperty()
The width of this
Scene |
private ReadOnlyDoubleWrapper |
widthPropertyImpl() |
<any> |
windowProperty()
The
Window for this Scene |
private <any> |
windowPropertyImpl() |
ReadOnlyDoubleProperty |
xProperty()
The horizontal location of this
Scene on the Window . |
private ReadOnlyDoubleWrapper |
xPropertyImpl() |
ReadOnlyDoubleProperty |
yProperty()
The vertical location of this
Scene on the Window . |
private ReadOnlyDoubleWrapper |
yPropertyImpl() |
public final <any> windowProperty
Window
for this Scene
getWindow()
public final ReadOnlyDoubleProperty xProperty
Scene
on the Window
.getX()
public final ReadOnlyDoubleProperty yProperty
Scene
on the Window
.getY()
public final ReadOnlyDoubleProperty widthProperty
Scene
getWidth()
public final ReadOnlyDoubleProperty heightProperty
Scene
getHeight()
public final <any> cameraProperty
Scene
.
If camera
is null, a parallel camera is used for rendering.
It is illegal to set a camera that belongs to other Scene
or SubScene
.
Note: this is a conditional feature. See
ConditionalFeature.SCENE3D
for more information.
getCamera()
,
setCamera(Camera)
public final <any> fillProperty
Scene
. Both a null
value meaning 'paint no background' and a javafx.scene.paint.Paint
with transparency are supported. The default fill of the Scene is
Color#WHITE
, but it is more commonly the case that the initial
color shown to users is the background fill of the
root node
of the Scene
, as it typically is
stretched to take up all available space in the Scene
. The
root node of the Scene
is given the CSS style class 'root', and
the default user agent stylesheets that ship with JavaFX (presently
Caspian and Modena) apply styling on to this root style class. In the
case of Caspian this does not impact the background fill color of the
root node, but in the case of Modena the default fill is set to be a
light gray color.getFill()
,
setFill(Paint)
public final <any> rootProperty
Node
of the scene graph.
If a Group
is used as the root, the
contents of the scene graph will be clipped by the scene's width and height and
changes to the scene's size (if user resizes the stage) will not alter the
layout of the scene graph. If a resizable node (layout Region
or
Control
) is set as the root, then the root's size will track the
scene's size, causing the contents to be relayed out as necessary.
Scene doesn't accept null root.getRoot()
,
setRoot(Parent)
public final <any> cursorProperty
Scene
.getCursor()
,
setCursor(Cursor)
public final <any> userAgentStylesheetProperty
getUserAgentStylesheet()
,
setUserAgentStylesheet(String)
public final <any> focusOwnerProperty
getFocusOwner()
public final <any> eventDispatcherProperty
EventDispatcher
, the new dispatcher should forward
events to the replaced dispatcher to keep the scene's default event
handling behavior.public final <any> onContextMenuRequestedProperty
Scene
.getOnContextMenuRequested()
,
#setOnContextMenuRequested()
public final <any> onMouseClickedProperty
Scene
.getOnMouseClicked()
,
#setOnMouseClicked()
public final <any> onMouseDraggedProperty
Scene
and then dragged.getOnMouseDragged()
,
#setOnMouseDragged()
public final <any> onMouseEnteredProperty
Scene
.getOnMouseEntered()
,
#setOnMouseEntered()
public final <any> onMouseExitedProperty
Scene
.getOnMouseExited()
,
#setOnMouseExited()
public final <any> onMouseMovedProperty
Scene
but no buttons have been pushed.getOnMouseMoved()
,
#setOnMouseMoved()
public final <any> onMousePressedProperty
Scene
.getOnMousePressed()
,
#setOnMousePressed()
public final <any> onMouseReleasedProperty
Scene
.getOnMouseReleased()
,
#setOnMouseReleased()
public final <any> onDragDetectedProperty
getOnDragDetected()
,
#setOnDragDetected()
public final <any> onMouseDragOverProperty
Scene
.getOnMouseDragOver()
,
#setOnMouseDragOver()
public final <any> onMouseDragReleasedProperty
Scene
.getOnMouseDragReleased()
,
#setOnMouseDragReleased()
public final <any> onMouseDragEnteredProperty
Scene
.getOnMouseDragEntered()
,
#setOnMouseDragEntered()
public final <any> onMouseDragExitedProperty
Scene
.getOnMouseDragExited()
,
#setOnMouseDragExited()
public final <any> onScrollStartedProperty
getOnScrollStarted()
,
#setOnScrollStarted()
public final <any> onScrollProperty
getOnScroll()
,
#setOnScroll()
public final <any> onScrollFinishedProperty
getOnScrollFinished()
,
#setOnScrollFinished()
public final <any> onRotationStartedProperty
getOnRotationStarted()
,
#setOnRotationStarted()
public final <any> onRotateProperty
getOnRotate()
,
#setOnRotate()
public final <any> onRotationFinishedProperty
getOnRotationFinished()
,
#setOnRotationFinished()
public final <any> onZoomStartedProperty
getOnZoomStarted()
,
#setOnZoomStarted()
public final <any> onZoomProperty
getOnZoom()
,
#setOnZoom()
public final <any> onZoomFinishedProperty
getOnZoomFinished()
,
#setOnZoomFinished()
public final <any> onSwipeUpProperty
getOnSwipeUp()
,
#setOnSwipeUp()
public final <any> onSwipeDownProperty
getOnSwipeDown()
,
#setOnSwipeDown()
public final <any> onSwipeLeftProperty
getOnSwipeLeft()
,
#setOnSwipeLeft()
public final <any> onSwipeRightProperty
getOnSwipeRight()
,
#setOnSwipeRight()
public final <any> onTouchPressedProperty
getOnTouchPressed()
,
#setOnTouchPressed()
public final <any> onTouchMovedProperty
getOnTouchMoved()
,
#setOnTouchMoved()
public final <any> onTouchReleasedProperty
getOnTouchReleased()
,
#setOnTouchReleased()
public final <any> onTouchStationaryProperty
getOnTouchStationary()
,
#setOnTouchStationary()
public final <any> onDragEnteredProperty
Scene
.public final <any> onDragExitedProperty
Scene
.getOnDragExited()
,
#setOnDragExited()
public final <any> onDragOverProperty
Scene
.getOnDragOver()
,
#setOnDragOver()
public final <any> onDragDroppedProperty
Scene
during drag and drop gesture. Transfer of data from
the DragEvent
's dragboard
should
happen in this function.getOnDragDropped()
,
#setOnDragDropped()
public final <any> onDragDoneProperty
Scene
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.
Positional data for the DragEvent
is invalid. Valid positional
data for the DragEvent
is presented in the
onDragDropped
event handler.getOnDragDone()
,
#setOnDragDone()
public final <any> onKeyPressedProperty
Node
of this
Scene
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.getOnKeyPressed()
,
#setOnKeyPressed()
public final <any> onKeyReleasedProperty
Node
of this
Scene
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.getOnKeyReleased()
,
#setOnKeyReleased()
public final <any> onKeyTypedProperty
Node
of this
Scene
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.getOnKeyTyped()
,
#setOnKeyTyped()
public final <any> 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.
getOnInputMethodTextChanged()
,
#setOnInputMethodTextChanged()
public final <any> 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.
getNodeOrientation()
,
setNodeOrientation(NodeOrientation)
public final <any> effectiveNodeOrientationProperty
getEffectiveNodeOrientation()
private double widthSetByUser
private double heightSetByUser
private boolean sizeInitialized
private final boolean depthBuffer
private final SceneAntialiasing antiAliasing
private int dirtyBits
final java.security.AccessControlContext acc
private Camera defaultCamera
private Node transientFocusContainer
private static final int MIN_DIRTY_CAPACITY
private static boolean inSynchronizer
private static boolean inMousePick
private static boolean allowPGAccess
private static int pgAccessCount
private static final boolean PLATFORM_DRAG_GESTURE_INITIATION
private Node[] dirtyNodes
Because at initialization time every node in the scene graph is dirty, we have a special state and special code path during initialization that does not involve adding each node to the dirtyNodes list. When dirtyNodes is null, that means this Scene has not yet been synchronized. A good default size is then created for the dirtyNodes list.
We double-buffer the set so that we can add new nodes to the set while processing the existing set. This avoids our having to take a snapshot of the set (e.g., with toArray()) and reduces garbage.
private int dirtyNodesSize
private TKScene peer
Scene.ScenePulseListener scenePulseListener
private java.util.List<java.lang.Runnable> preLayoutPulseListeners
private java.util.List<java.lang.Runnable> postLayoutPulseListeners
private <any> window
Window
for this Scene
Scene.DnDGesture dndGesture
Scene.DragGestureListener dragGestureListener
private ReadOnlyDoubleWrapper x
Scene
on the Window
.private ReadOnlyDoubleWrapper y
Scene
on the Window
.private ReadOnlyDoubleWrapper width
Scene
private ReadOnlyDoubleWrapper height
Scene
private Scene.TargetWrapper tmpTargetWrapper
private <any> camera
Scene
.
If camera
is null, a parallel camera is used for rendering.
It is illegal to set a camera that belongs to other Scene
or SubScene
.
Note: this is a conditional feature. See
ConditionalFeature.SCENE3D
for more information.
private <any> fill
Scene
. Both a null
value meaning 'paint no background' and a javafx.scene.paint.Paint
with transparency are supported. The default fill of the Scene is
Color#WHITE
, but it is more commonly the case that the initial
color shown to users is the background fill of the
root node
of the Scene
, as it typically is
stretched to take up all available space in the Scene
. The
root node of the Scene
is given the CSS style class 'root', and
the default user agent stylesheets that ship with JavaFX (presently
Caspian and Modena) apply styling on to this root style class. In the
case of Caspian this does not impact the background fill color of the
root node, but in the case of Modena the default fill is set to be a
light gray color.private <any> root
Node
of the scene graph.
If a Group
is used as the root, the
contents of the scene graph will be clipped by the scene's width and height and
changes to the scene's size (if user resizes the stage) will not alter the
layout of the scene graph. If a resizable node (layout Region
or
Control
) is set as the root, then the root's size will track the
scene's size, causing the contents to be relayed out as necessary.
Scene doesn't accept null root.Parent oldRoot
private static TKPulseListener snapshotPulseListener
private static java.util.List<java.lang.Runnable> snapshotRunnableListA
private static java.util.List<java.lang.Runnable> snapshotRunnableListB
private static java.util.List<java.lang.Runnable> snapshotRunnableList
private <any> cursor
Scene
.private final <any> stylesheets
private <any> userAgentStylesheet
private PerformanceTracker tracker
private static final java.lang.Object trackerMonitor
private Scene.MouseHandler mouseHandler
private Scene.ClickGenerator clickGenerator
private Point2D cursorScreenPos
private Point2D cursorScenePos
private final Scene.TouchGesture scrollGesture
private final Scene.TouchGesture zoomGesture
private final Scene.TouchGesture rotateGesture
private final Scene.TouchGesture swipeGesture
private Scene.TouchMap touchMap
private TouchEvent nextTouchEvent
private TouchPoint[] touchPoints
private int touchEventSetId
private int touchPointIndex
private java.util.Map<java.lang.Integer,EventTarget> touchTargets
private Scene.KeyHandler keyHandler
private boolean focusDirty
private TopMostTraversalEngine traversalEngine
private Node oldFocusOwner
private <any> focusOwner
java.lang.Runnable testPulseListener
private java.util.List<LightBase> lights
private <any> eventDispatcher
EventDispatcher
, the new dispatcher should forward
events to the replaced dispatcher to keep the scene's default event
handling behavior.private SceneEventDispatcher internalEventDispatcher
private <any> onContextMenuRequested
Scene
.private <any> onMouseClicked
Scene
.private <any> onMouseDragged
Scene
and then dragged.private <any> onMouseEntered
Scene
.private <any> onMouseExited
Scene
.private <any> onMouseMoved
Scene
but no buttons have been pushed.private <any> onMousePressed
Scene
.private <any> onMouseReleased
Scene
.private <any> onDragDetected
private <any> onMouseDragOver
Scene
.private <any> onMouseDragReleased
Scene
.private <any> onMouseDragEntered
Scene
.private <any> onMouseDragExited
Scene
.private <any> onScrollStarted
private <any> onScroll
private <any> onScrollFinished
private <any> onRotationStarted
private <any> onRotate
private <any> onRotationFinished
private <any> onZoomStarted
private <any> onZoom
private <any> onZoomFinished
private <any> onSwipeUp
private <any> onSwipeDown
private <any> onSwipeLeft
private <any> onSwipeRight
private <any> onTouchPressed
private <any> onTouchMoved
private <any> onTouchReleased
private <any> onTouchStationary
private <any> onDragEntered
private <any> onDragExited
private <any> onDragOver
private <any> onDragDropped
private <any> onDragDone
private <any> onKeyPressed
Node
of this
Scene
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.private <any> onKeyReleased
Node
of this
Scene
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.private <any> onKeyTyped
Node
of this
Scene
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.private <any> onInputMethodTextChanged
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.
private static final java.lang.Object USER_DATA_KEY
private <any> properties
private static final NodeOrientation defaultNodeOrientation
private <any> nodeOrientation
private Scene.EffectiveOrientationProperty effectiveNodeOrientationProperty
private NodeOrientation effectiveNodeOrientation
private java.util.Map<Node,Accessible> accMap
private Accessible accessible
public Scene(Parent root)
root
- The root node of the scene graphjava.lang.NullPointerException
- if root is nullpublic Scene(Parent root, double width, double height)
root
- The root node of the scene graphwidth
- The width of the sceneheight
- The height of the scenejava.lang.NullPointerException
- if root is nullpublic Scene(Parent root, Paint fill)
root
- The parentfill
- The filljava.lang.NullPointerException
- if root is nullpublic Scene(Parent root, double width, double height, Paint fill)
root
- The root node of the scene graphwidth
- The width of the sceneheight
- The height of the scenefill
- The filljava.lang.NullPointerException
- if root is nullpublic Scene(Parent root, double width, double height, boolean depthBuffer, SceneAntialiasing antiAliasing)
A scene with only 2D shapes and without any 3D transforms does not need a
depth buffer nor scene anti-aliasing support. A scene containing 3D
shapes or 2D shapes with 3D transforms may use depth buffer support for
proper depth sorted rendering; to avoid depth fighting (also known as Z
fighting), disable depth testing on 2D shapes that have no 3D transforms.
See depthTest
for more information. A
scene with 3D shapes may enable scene anti-aliasing to improve its
rendering quality.
root
- The root node of the scene graphwidth
- The width of the sceneheight
- The height of the scenedepthBuffer
- The depth buffer flagantiAliasing
- The scene anti-aliasing attribute. A value of
null
is treated as DISABLED.
The depthBuffer and antiAliasing are conditional features. With the
respective default values of: false and SceneAntialiasing.DISABLED
. See
ConditionalFeature.SCENE3D
for more information.
java.lang.NullPointerException
- if root is nullNode.setDepthTest(DepthTest)
private Scene(Parent root, double width, double height, Paint fill, boolean depthBuffer, SceneAntialiasing antiAliasing)
static boolean isPGAccessAllowed()
static void setAllowPGAccess(boolean flag)
void addToDirtyList(Node n)
private void doCSSPass()
void doLayoutPass()
TKScene getPeer()
public final void addPreLayoutPulseListener(java.lang.Runnable r)
r
- The Runnable to be called when the pulse occurs.java.lang.IllegalStateException
- if this method is called on a thread
other than the JavaFX Application Thread.java.lang.NullPointerException
- if the provided Runnable is null.public final void removePreLayoutPulseListener(java.lang.Runnable r)
r
- The Runnable that should no longer be called when the pulse
occurs for this scene.java.lang.IllegalStateException
- if this method is called on a thread
other than the JavaFX Application Thread.public final void addPostLayoutPulseListener(java.lang.Runnable r)
addPreLayoutPulseListener(Runnable)
API or the the
javafx.animation.AnimationTimer
API.
This method must be called on the JavaFX Application thread.r
- The Runnable to be called when the pulse occurs.java.lang.IllegalStateException
- if this method is called on a thread
other than the JavaFX Application Thread.java.lang.NullPointerException
- if the provided Runnable is null.public final void removePostLayoutPulseListener(java.lang.Runnable r)
r
- The Runnable that should no longer be called when the pulse
occurs for this scene.java.lang.IllegalStateException
- if this method is called on a thread
other than the JavaFX Application Thread.public final SceneAntialiasing getAntiAliasing()
SceneAntialiasing
for this Scene
.
Note: this is a conditional feature. See
ConditionalFeature.SCENE3D
and SceneAntialiasing
for more information.
private boolean getAntiAliasingInternal()
void setWindow(Window value)
public final Window getWindow()
public final <any> windowProperty()
Window
for this Scene
getWindow()
private <any> windowPropertyImpl()
void initPeer()
public void disposePeer()
private final void setX(double value)
public final double getX()
public final ReadOnlyDoubleProperty xProperty()
Scene
on the Window
.getX()
private ReadOnlyDoubleWrapper xPropertyImpl()
private final void setY(double value)
public final double getY()
public final ReadOnlyDoubleProperty yProperty()
Scene
on the Window
.getY()
private ReadOnlyDoubleWrapper yPropertyImpl()
private final void setWidth(double value)
public final double getWidth()
public final ReadOnlyDoubleProperty widthProperty()
Scene
getWidth()
private ReadOnlyDoubleWrapper widthPropertyImpl()
private final void setHeight(double value)
public final double getHeight()
public final ReadOnlyDoubleProperty heightProperty()
Scene
getHeight()
private ReadOnlyDoubleWrapper heightPropertyImpl()
void resizeRootOnSceneSizeChange(double newWidth, double newHeight)
public final void setCamera(Camera value)
public final Camera getCamera()
public final <any> cameraProperty()
Scene
.
If camera
is null, a parallel camera is used for rendering.
It is illegal to set a camera that belongs to other Scene
or SubScene
.
Note: this is a conditional feature. See
ConditionalFeature.SCENE3D
for more information.
getCamera()
,
setCamera(Camera)
Camera getEffectiveCamera()
void markCameraDirty()
void markCursorDirty()
public final void setFill(Paint value)
public final Paint getFill()
public final <any> fillProperty()
Scene
. Both a null
value meaning 'paint no background' and a javafx.scene.paint.Paint
with transparency are supported. The default fill of the Scene is
Color#WHITE
, but it is more commonly the case that the initial
color shown to users is the background fill of the
root node
of the Scene
, as it typically is
stretched to take up all available space in the Scene
. The
root node of the Scene
is given the CSS style class 'root', and
the default user agent stylesheets that ship with JavaFX (presently
Caspian and Modena) apply styling on to this root style class. In the
case of Caspian this does not impact the background fill color of the
root node, but in the case of Modena the default fill is set to be a
light gray color.getFill()
,
setFill(Paint)
public final void setRoot(Parent value)
public final Parent getRoot()
public final <any> rootProperty()
Node
of the scene graph.
If a Group
is used as the root, the
contents of the scene graph will be clipped by the scene's width and height and
changes to the scene's size (if user resizes the stage) will not alter the
layout of the scene graph. If a resizable node (layout Region
or
Control
) is set as the root, then the root's size will track the
scene's size, causing the contents to be relayed out as necessary.
Scene doesn't accept null root.getRoot()
,
setRoot(Parent)
void setNeedsRepaint()
void doCSSLayoutSyncForSnapshot(Node node)
static WritableImage doSnapshot(Scene scene, double x, double y, double w, double h, Node root, BaseTransform transform, boolean depthBuffer, Paint fill, Camera camera, WritableImage wimg)
private WritableImage doSnapshot(WritableImage img)
static void addSnapshotRunnable(java.lang.Runnable runnable)
public WritableImage snapshot(WritableImage image)
Paint
of this scene. The nodes in the scene are then rendered to the image.
The point (0,0) in scene coordinates is mapped to (0,0) in the image.
If the image is smaller than the size of the scene, then the rendering
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.
image
- the writable image that will be used to hold the rendered scene.
It may be null in which case a new WritableImage will be constructed.
If the image is non-null, the scene 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 scene.java.lang.IllegalStateException
- if this method is called on a thread
other than the JavaFX Application Thread.public void snapshot(<any> callback, WritableImage image)
Paint
of this scene. The nodes in the scene are then rendered to the image.
The point (0,0) in scene coordinates is mapped to (0,0) in the image.
If the image is smaller than the size of the scene, then the rendering
will be clipped by the image.
This is an asynchronous call, which means that other events or animation might be processed before the scene is rendered. If any such events modify a node in the scene that modification will be reflected in the rendered image (as it will also be reflected in the frame rendered to the Stage).
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.
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 and the source scene
that was rendered. The callback parameter must not be null.image
- the writable image that will be used to hold the rendered scene.
It may be null in which case a new WritableImage will be constructed.
If the image is non-null, the scene 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 scene.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 setCursor(Cursor value)
public final Cursor getCursor()
public final <any> cursorProperty()
Scene
.getCursor()
,
setCursor(Cursor)
public Node lookup(java.lang.String selector)
selector
- The css selector to look upNode
in the scene which matches the CSS selector
,
or null
if none is found.public final <any> getStylesheets()
The URL is a hierarchical URI of the form [scheme:][//authority][path]. If the URL does not have a [scheme:] component, the URL is considered to be the [path] component only. Any leading '/' character of the [path] is ignored and the [path] is treated as a path relative to the root of the application's classpath.
package com.example.javafx.app;
import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.stage.Stage;
public class MyApp extends Application {
@Override public void start(Stage stage) {
Scene scene = new Scene(new Group());
scene.getStylesheets().add("/com/example/javafx/app/mystyles.css");
stage.setScene(scene);
stage.show();
}
public static void main(String[] args) {
launch(args);
}
}
For additional information about using CSS with the scene graph,
see the CSS Reference Guide.public final <any> userAgentStylesheetProperty()
getUserAgentStylesheet()
,
setUserAgentStylesheet(String)
public final java.lang.String getUserAgentStylesheet()
For additional information about using CSS with the scene graph, see the CSS Reference Guide.
public final void setUserAgentStylesheet(java.lang.String url)
For additional information about using CSS with the scene graph, see the CSS Reference Guide.
url
- The URL is a hierarchical URI of the form [scheme:][//authority][path]. If the URL
does not have a [scheme:] component, the URL is considered to be the [path] component only.
Any leading '/' character of the [path] is ignored and the [path] is treated as a path relative to
the root of the application's classpath.public final boolean isDepthBuffer()
boolean isDepthBufferInternal()
private void init(double width, double height)
private void init()
void preferredSize()
final void resizeRootToPreferredSize(Parent root)
private static double getPreferredWidth(Parent root, double forcedWidth, double height)
private static double getPreferredHeight(Parent root, double forcedHeight, double width)
void processMouseEvent(MouseEvent e)
private void processMenuEvent(double x2, double y2, double xAbs, double yAbs, boolean isKeyboardTrigger)
private void processGestureEvent(GestureEvent e, Scene.TouchGesture gesture)
private void processTouchEvent(TouchEvent e, TouchPoint[] touchPoints)
Node test_pick(double x, double y)
private PickResult pick(double x, double y)
private boolean isInScene(double x, double y)
private void pick(Scene.TargetWrapper target, double x, double y)
private Scene.KeyHandler getKeyHandler()
final void setFocusDirty(boolean value)
final boolean isFocusDirty()
boolean traverse(Node node, Direction dir)
private void focusInitial()
private void focusIneligible(Node node)
public void processKeyEvent(KeyEvent e)
void requestFocus(Node node)
public final Node getFocusOwner()
public final <any> focusOwnerProperty()
getFocusOwner()
void focusCleanup()
private void processInputMethodEvent(InputMethodEvent e)
public void enableInputMethodEvents(boolean enable)
boolean isQuiescent()
private void markDirty(Scene.DirtyBits dirtyBit)
private void setDirty(Scene.DirtyBits dirtyBit)
private boolean isDirty(Scene.DirtyBits dirtyBit)
private boolean isDirtyEmpty()
private void clearDirty()
final void addLight(LightBase light)
final void removeLight(LightBase light)
private void syncLights()
void generateMouseExited(Node removing)
removing
- Node which is going to be removedpublic final void setEventDispatcher(EventDispatcher value)
public final EventDispatcher getEventDispatcher()
public final <any> eventDispatcherProperty()
EventDispatcher
, the new dispatcher should forward
events to the replaced dispatcher to keep the scene's default event
handling behavior.public final <T extends Event> void addEventHandler(<any> eventType, <any> 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(<any> eventType, <any> 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(<any> eventType, <any> 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(<any> eventType, <any> 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(<any> eventType, <any> eventHandler)
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 SceneEventDispatcher getInternalEventDispatcher()
final void initializeInternalEventDispatcher()
private SceneEventDispatcher createInternalEventDispatcher()
public void addMnemonic(Mnemonic m)
m
- The mnemonicpublic void removeMnemonic(Mnemonic m)
m
- The mnemonicfinal void clearNodeMnemonics(Node node)
public <any> getMnemonics()
Scene
.public <any> getAccelerators()
Scene
.public EventDispatchChain buildEventDispatchChain(EventDispatchChain tail)
tail
- the initial chain to build frompublic final void setOnContextMenuRequested(<any> value)
public final <any> getOnContextMenuRequested()
public final <any> onContextMenuRequestedProperty()
Scene
.getOnContextMenuRequested()
,
#setOnContextMenuRequested()
public final void setOnMouseClicked(<any> value)
public final <any> getOnMouseClicked()
public final <any> onMouseClickedProperty()
Scene
.getOnMouseClicked()
,
#setOnMouseClicked()
public final void setOnMouseDragged(<any> value)
public final <any> getOnMouseDragged()
public final <any> onMouseDraggedProperty()
Scene
and then dragged.getOnMouseDragged()
,
#setOnMouseDragged()
public final void setOnMouseEntered(<any> value)
public final <any> getOnMouseEntered()
public final <any> onMouseEnteredProperty()
Scene
.getOnMouseEntered()
,
#setOnMouseEntered()
public final void setOnMouseExited(<any> value)
public final <any> getOnMouseExited()
public final <any> onMouseExitedProperty()
Scene
.getOnMouseExited()
,
#setOnMouseExited()
public final void setOnMouseMoved(<any> value)
public final <any> getOnMouseMoved()
public final <any> onMouseMovedProperty()
Scene
but no buttons have been pushed.getOnMouseMoved()
,
#setOnMouseMoved()
public final void setOnMousePressed(<any> value)
public final <any> getOnMousePressed()
public final <any> onMousePressedProperty()
Scene
.getOnMousePressed()
,
#setOnMousePressed()
public final void setOnMouseReleased(<any> value)
public final <any> getOnMouseReleased()
public final <any> onMouseReleasedProperty()
Scene
.getOnMouseReleased()
,
#setOnMouseReleased()
public final void setOnDragDetected(<any> value)
public final <any> getOnDragDetected()
public final <any> onDragDetectedProperty()
getOnDragDetected()
,
#setOnDragDetected()
public final void setOnMouseDragOver(<any> value)
public final <any> getOnMouseDragOver()
public final <any> onMouseDragOverProperty()
Scene
.getOnMouseDragOver()
,
#setOnMouseDragOver()
public final void setOnMouseDragReleased(<any> value)
public final <any> getOnMouseDragReleased()
public final <any> onMouseDragReleasedProperty()
Scene
.getOnMouseDragReleased()
,
#setOnMouseDragReleased()
public final void setOnMouseDragEntered(<any> value)
public final <any> getOnMouseDragEntered()
public final <any> onMouseDragEnteredProperty()
Scene
.getOnMouseDragEntered()
,
#setOnMouseDragEntered()
public final void setOnMouseDragExited(<any> value)
public final <any> getOnMouseDragExited()
public final <any> onMouseDragExitedProperty()
Scene
.getOnMouseDragExited()
,
#setOnMouseDragExited()
public final void setOnScrollStarted(<any> value)
public final <any> getOnScrollStarted()
public final <any> onScrollStartedProperty()
getOnScrollStarted()
,
#setOnScrollStarted()
public final void setOnScroll(<any> value)
public final <any> getOnScroll()
public final <any> onScrollProperty()
getOnScroll()
,
#setOnScroll()
public final void setOnScrollFinished(<any> value)
public final <any> getOnScrollFinished()
public final <any> onScrollFinishedProperty()
getOnScrollFinished()
,
#setOnScrollFinished()
public final void setOnRotationStarted(<any> value)
public final <any> getOnRotationStarted()
public final <any> onRotationStartedProperty()
getOnRotationStarted()
,
#setOnRotationStarted()
public final void setOnRotate(<any> value)
public final <any> getOnRotate()
public final <any> onRotateProperty()
getOnRotate()
,
#setOnRotate()
public final void setOnRotationFinished(<any> value)
public final <any> getOnRotationFinished()
public final <any> onRotationFinishedProperty()
getOnRotationFinished()
,
#setOnRotationFinished()
public final void setOnZoomStarted(<any> value)
public final <any> getOnZoomStarted()
public final <any> onZoomStartedProperty()
getOnZoomStarted()
,
#setOnZoomStarted()
public final void setOnZoom(<any> value)
public final <any> getOnZoom()
public final <any> onZoomProperty()
getOnZoom()
,
#setOnZoom()
public final void setOnZoomFinished(<any> value)
public final <any> getOnZoomFinished()
public final <any> onZoomFinishedProperty()
getOnZoomFinished()
,
#setOnZoomFinished()
public final void setOnSwipeUp(<any> value)
public final <any> getOnSwipeUp()
public final <any> onSwipeUpProperty()
getOnSwipeUp()
,
#setOnSwipeUp()
public final void setOnSwipeDown(<any> value)
public final <any> getOnSwipeDown()
public final <any> onSwipeDownProperty()
getOnSwipeDown()
,
#setOnSwipeDown()
public final void setOnSwipeLeft(<any> value)
public final <any> getOnSwipeLeft()
public final <any> onSwipeLeftProperty()
getOnSwipeLeft()
,
#setOnSwipeLeft()
public final void setOnSwipeRight(<any> value)
public final <any> getOnSwipeRight()
public final <any> onSwipeRightProperty()
getOnSwipeRight()
,
#setOnSwipeRight()
public final void setOnTouchPressed(<any> value)
public final <any> getOnTouchPressed()
public final <any> onTouchPressedProperty()
getOnTouchPressed()
,
#setOnTouchPressed()
public final void setOnTouchMoved(<any> value)
public final <any> getOnTouchMoved()
public final <any> onTouchMovedProperty()
getOnTouchMoved()
,
#setOnTouchMoved()
public final void setOnTouchReleased(<any> value)
public final <any> getOnTouchReleased()
public final <any> onTouchReleasedProperty()
getOnTouchReleased()
,
#setOnTouchReleased()
public final void setOnTouchStationary(<any> value)
public final <any> getOnTouchStationary()
public final <any> onTouchStationaryProperty()
getOnTouchStationary()
,
#setOnTouchStationary()
public final void setOnDragEntered(<any> value)
public final <any> getOnDragEntered()
public final <any> onDragEnteredProperty()
Scene
.public final void setOnDragExited(<any> value)
public final <any> getOnDragExited()
public final <any> onDragExitedProperty()
Scene
.getOnDragExited()
,
#setOnDragExited()
public final void setOnDragOver(<any> value)
public final <any> getOnDragOver()
public final <any> onDragOverProperty()
Scene
.getOnDragOver()
,
#setOnDragOver()
public final void setOnDragDropped(<any> value)
public final <any> getOnDragDropped()
public final <any> onDragDroppedProperty()
Scene
during drag and drop gesture. Transfer of data from
the DragEvent
's dragboard
should
happen in this function.getOnDragDropped()
,
#setOnDragDropped()
public final void setOnDragDone(<any> value)
public final <any> getOnDragDone()
public final <any> onDragDoneProperty()
Scene
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.
Positional data for the DragEvent
is invalid. Valid positional
data for the DragEvent
is presented in the
onDragDropped
event handler.getOnDragDone()
,
#setOnDragDone()
public Dragboard startDragAndDrop(TransferMode... transferModes)
Scene
.
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 Scene
's data on the
Dragboard
also identifies this Scene
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 Scene
's data onjava.lang.IllegalStateException
- if drag and drop cannot be started at this
moment (it's called outside of DRAG_DETECTED
event handling).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).MouseEvent
,
MouseDragEvent
Dragboard startDragAndDrop(EventTarget source, TransferMode... transferModes)
void startFullDrag(EventTarget source)
public final void setOnKeyPressed(<any> value)
public final <any> getOnKeyPressed()
public final <any> onKeyPressedProperty()
Node
of this
Scene
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.getOnKeyPressed()
,
#setOnKeyPressed()
public final void setOnKeyReleased(<any> value)
public final <any> getOnKeyReleased()
public final <any> onKeyReleasedProperty()
Node
of this
Scene
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.getOnKeyReleased()
,
#setOnKeyReleased()
public final void setOnKeyTyped(<any> value)
public final <any> getOnKeyTyped()
public final <any> onKeyTypedProperty()
Node
of this
Scene
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.getOnKeyTyped()
,
#setOnKeyTyped()
public final void setOnInputMethodTextChanged(<any> value)
public final <any> getOnInputMethodTextChanged()
public final <any> 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.
getOnInputMethodTextChanged()
,
#setOnInputMethodTextChanged()
public final <any> 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.public final void setNodeOrientation(NodeOrientation orientation)
public final NodeOrientation getNodeOrientation()
public final <any> 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.
getNodeOrientation()
,
setNodeOrientation(NodeOrientation)
public final NodeOrientation getEffectiveNodeOrientation()
public final <any> effectiveNodeOrientationProperty()
getEffectiveNodeOrientation()
private void parentEffectiveOrientationInvalidated()
private void sceneEffectiveOrientationInvalidated()
private NodeOrientation calcEffectiveNodeOrientation()
Accessible removeAccessible(Node node)
void addAccessible(Node node, Accessible acc)
private void disposeAccessibles()
Accessible getAccessible()