- All Implemented Interfaces:
- EventTarget
@DefaultProperty("root") public class Scene extends Object implements EventTarget
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 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);
- Since:
- JavaFX 2.0
- 
Property SummaryProperties Type Property Description ObjectProperty<Camera>cameraSpecifies the type of camera use for rendering thisScene.ObjectProperty<Cursor>cursorDefines the mouse cursor for thisScene.ReadOnlyObjectProperty<NodeOrientation>effectiveNodeOrientationThe effective node orientation of a scene resolves the inheritance of node orientation, returning either left-to-right or right-to-left.ObjectProperty<EventDispatcher>eventDispatcherSpecifies the event dispatcher for this scene.ObjectProperty<Paint>fillDefines the background fill of thisScene.ReadOnlyObjectProperty<Node>focusOwnerThe scene's current focus owner node.ReadOnlyDoublePropertyheightThe height of thisSceneObjectProperty<NodeOrientation>nodeOrientationProperty holding NodeOrientation.ObjectProperty<EventHandler<? super ContextMenuEvent>>onContextMenuRequestedDefines a function to be called when a mouse button has been clicked (pressed and released) on thisScene.ObjectProperty<EventHandler<? super MouseEvent>>onDragDetectedDefines a function to be called when drag gesture has been detected.ObjectProperty<EventHandler<? super DragEvent>>onDragDoneDefines a function to be called when thisSceneis a drag and drop gesture source after its data has been dropped on a drop target.ObjectProperty<EventHandler<? super DragEvent>>onDragDroppedDefines a function to be called when the mouse button is released on thisSceneduring drag and drop gesture.ObjectProperty<EventHandler<? super DragEvent>>onDragEnteredDefines a function to be called when drag gesture enters thisScene.ObjectProperty<EventHandler<? super DragEvent>>onDragExitedDefines a function to be called when drag gesture exits thisScene.ObjectProperty<EventHandler<? super DragEvent>>onDragOverDefines a function to be called when drag gesture progresses within thisScene.ObjectProperty<EventHandler<? super InputMethodEvent>>onInputMethodTextChangedDefines a function to be called when thisNodehas input focus and the input method text has changed.ObjectProperty<EventHandler<? super KeyEvent>>onKeyPressedDefines a function to be called when someNodeof thisScenehas input focus and a key has been pressed.ObjectProperty<EventHandler<? super KeyEvent>>onKeyReleasedDefines a function to be called when someNodeof thisScenehas input focus and a key has been released.ObjectProperty<EventHandler<? super KeyEvent>>onKeyTypedDefines a function to be called when someNodeof thisScenehas input focus and a key has been typed.ObjectProperty<EventHandler<? super MouseEvent>>onMouseClickedDefines a function to be called when a mouse button has been clicked (pressed and released) on thisScene.ObjectProperty<EventHandler<? super MouseDragEvent>>onMouseDragEnteredDefines a function to be called when a full press-drag-release gesture enters thisScene.ObjectProperty<EventHandler<? super MouseDragEvent>>onMouseDragExitedDefines a function to be called when a full press-drag-release gesture exits thisScene.ObjectProperty<EventHandler<? super MouseEvent>>onMouseDraggedDefines a function to be called when a mouse button is pressed on thisSceneand then dragged.ObjectProperty<EventHandler<? super MouseDragEvent>>onMouseDragOverDefines a function to be called when a full press-drag-release gesture progresses within thisScene.ObjectProperty<EventHandler<? super MouseDragEvent>>onMouseDragReleasedDefines a function to be called when a full press-drag-release gesture ends within thisScene.ObjectProperty<EventHandler<? super MouseEvent>>onMouseEnteredDefines a function to be called when the mouse enters thisScene.ObjectProperty<EventHandler<? super MouseEvent>>onMouseExitedDefines a function to be called when the mouse exits thisScene.ObjectProperty<EventHandler<? super MouseEvent>>onMouseMovedDefines a function to be called when mouse cursor moves within thisScenebut no buttons have been pushed.ObjectProperty<EventHandler<? super MouseEvent>>onMousePressedDefines a function to be called when a mouse button has been pressed on thisScene.ObjectProperty<EventHandler<? super MouseEvent>>onMouseReleasedDefines a function to be called when a mouse button has been released on thisScene.ObjectProperty<EventHandler<? super RotateEvent>>onRotateDefines a function to be called when user performs a rotating action.ObjectProperty<EventHandler<? super RotateEvent>>onRotationFinishedDefines a function to be called when a rotating gesture ends.ObjectProperty<EventHandler<? super RotateEvent>>onRotationStartedDefines a function to be called when a rotating gesture is detected.ObjectProperty<EventHandler<? super ScrollEvent>>onScrollFinishedDefines a function to be called when a scrolling gesture ends.ObjectProperty<EventHandler<? super ScrollEvent>>onScrollDefines a function to be called when user performs a scrolling action.ObjectProperty<EventHandler<? super ScrollEvent>>onScrollStartedDefines a function to be called when a scrolling gesture is detected.ObjectProperty<EventHandler<? super SwipeEvent>>onSwipeDownDefines a function to be called when an downward swipe gesture happens in this scene.ObjectProperty<EventHandler<? super SwipeEvent>>onSwipeLeftDefines a function to be called when an leftward swipe gesture happens in this scene.ObjectProperty<EventHandler<? super SwipeEvent>>onSwipeRightDefines a function to be called when an rightward swipe gesture happens in this scene.ObjectProperty<EventHandler<? super SwipeEvent>>onSwipeUpDefines a function to be called when an upward swipe gesture happens in this scene.ObjectProperty<EventHandler<? super TouchEvent>>onTouchMovedDefines a function to be called when a touch point is moved.ObjectProperty<EventHandler<? super TouchEvent>>onTouchPressedDefines a function to be called when a new touch point is pressed.ObjectProperty<EventHandler<? super TouchEvent>>onTouchReleasedDefines a function to be called when a new touch point is pressed.ObjectProperty<EventHandler<? super TouchEvent>>onTouchStationaryDefines a function to be called when a touch point stays pressed and still.ObjectProperty<EventHandler<? super ZoomEvent>>onZoomFinishedDefines a function to be called when a zooming gesture ends.ObjectProperty<EventHandler<? super ZoomEvent>>onZoomDefines a function to be called when user performs a zooming action.ObjectProperty<EventHandler<? super ZoomEvent>>onZoomStartedDefines a function to be called when a zooming gesture is detected.ObjectProperty<Parent>rootDefines the rootNodeof the scene graph.ObjectProperty<String>userAgentStylesheetReadOnlyDoublePropertywidthThe width of thisSceneReadOnlyObjectProperty<Window>windowTheWindowfor thisSceneReadOnlyDoublePropertyxThe horizontal location of thisSceneon theWindow.ReadOnlyDoublePropertyyThe vertical location of thisSceneon theWindow.
- 
Constructor SummaryConstructors Constructor 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)Constructs a scene consisting of a root, with a dimension of width and height, and specifies whether a depth buffer is created for this scene.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.Scene(Parent root, Paint fill)Creates a Scene for a specific root Node with a fill.
- 
Method SummaryModifier and Type Method Description <T extends Event>
 voidaddEventFilter(EventType<T> eventType, EventHandler<? super T> eventFilter)Registers an event filter to this scene.<T extends Event>
 voidaddEventHandler(EventType<T> eventType, EventHandler<? super T> eventHandler)Registers an event handler to this scene.voidaddMnemonic(Mnemonic m)Registers the specified mnemonic.voidaddPostLayoutPulseListener(Runnable r)Adds a new scene post layout pulse listener to this scene.voidaddPreLayoutPulseListener(Runnable r)Adds a new scene pre layout pulse listener to this scene.EventDispatchChainbuildEventDispatchChain(EventDispatchChain tail)Construct an event dispatch chain for this scene.ObjectProperty<Camera>cameraProperty()Specifies the type of camera use for rendering thisScene.ObjectProperty<Cursor>cursorProperty()Defines the mouse cursor for thisScene.ReadOnlyObjectProperty<NodeOrientation>effectiveNodeOrientationProperty()The effective node orientation of a scene resolves the inheritance of node orientation, returning either left-to-right or right-to-left.ObjectProperty<EventDispatcher>eventDispatcherProperty()Specifies the event dispatcher for this scene.ObjectProperty<Paint>fillProperty()Defines the background fill of thisScene.ReadOnlyObjectProperty<Node>focusOwnerProperty()The scene's current focus owner node.ObservableMap<KeyCombination,Runnable>getAccelerators()Gets the list of accelerators for thisScene.SceneAntialiasinggetAntiAliasing()Return the definedSceneAntialiasingfor thisScene.CameragetCamera()Gets the value of the property camera.CursorgetCursor()Gets the value of the property cursor.NodeOrientationgetEffectiveNodeOrientation()Gets the value of the property effectiveNodeOrientation.EventDispatchergetEventDispatcher()Gets the value of the property eventDispatcher.PaintgetFill()Gets the value of the property fill.NodegetFocusOwner()Gets the value of the property focusOwner.doublegetHeight()Gets the value of the property height.ObservableMap<KeyCombination,ObservableList<Mnemonic>>getMnemonics()Gets the list of mnemonics for thisScene.NodeOrientationgetNodeOrientation()Gets the value of the property nodeOrientation.EventHandler<? super ContextMenuEvent>getOnContextMenuRequested()Gets the value of the property onContextMenuRequested.EventHandler<? super MouseEvent>getOnDragDetected()Gets the value of the property onDragDetected.EventHandler<? super DragEvent>getOnDragDone()Gets the value of the property onDragDone.EventHandler<? super DragEvent>getOnDragDropped()Gets the value of the property onDragDropped.EventHandler<? super DragEvent>getOnDragEntered()Gets the value of the property onDragEntered.EventHandler<? super DragEvent>getOnDragExited()Gets the value of the property onDragExited.EventHandler<? super DragEvent>getOnDragOver()Gets the value of the property onDragOver.EventHandler<? super InputMethodEvent>getOnInputMethodTextChanged()Gets the value of the property onInputMethodTextChanged.EventHandler<? super KeyEvent>getOnKeyPressed()Gets the value of the property onKeyPressed.EventHandler<? super KeyEvent>getOnKeyReleased()Gets the value of the property onKeyReleased.EventHandler<? super KeyEvent>getOnKeyTyped()Gets the value of the property onKeyTyped.EventHandler<? super MouseEvent>getOnMouseClicked()Gets the value of the property onMouseClicked.EventHandler<? super MouseDragEvent>getOnMouseDragEntered()Gets the value of the property onMouseDragEntered.EventHandler<? super MouseDragEvent>getOnMouseDragExited()Gets the value of the property onMouseDragExited.EventHandler<? super MouseEvent>getOnMouseDragged()Gets the value of the property onMouseDragged.EventHandler<? super MouseDragEvent>getOnMouseDragOver()Gets the value of the property onMouseDragOver.EventHandler<? super MouseDragEvent>getOnMouseDragReleased()Gets the value of the property onMouseDragReleased.EventHandler<? super MouseEvent>getOnMouseEntered()Gets the value of the property onMouseEntered.EventHandler<? super MouseEvent>getOnMouseExited()Gets the value of the property onMouseExited.EventHandler<? super MouseEvent>getOnMouseMoved()Gets the value of the property onMouseMoved.EventHandler<? super MouseEvent>getOnMousePressed()Gets the value of the property onMousePressed.EventHandler<? super MouseEvent>getOnMouseReleased()Gets the value of the property onMouseReleased.EventHandler<? super RotateEvent>getOnRotate()Gets the value of the property onRotate.EventHandler<? super RotateEvent>getOnRotationFinished()Gets the value of the property onRotationFinished.EventHandler<? super RotateEvent>getOnRotationStarted()Gets the value of the property onRotationStarted.EventHandler<? super ScrollEvent>getOnScroll()Gets the value of the property onScroll.EventHandler<? super ScrollEvent>getOnScrollFinished()Gets the value of the property onScrollFinished.EventHandler<? super ScrollEvent>getOnScrollStarted()Gets the value of the property onScrollStarted.EventHandler<? super SwipeEvent>getOnSwipeDown()Gets the value of the property onSwipeDown.EventHandler<? super SwipeEvent>getOnSwipeLeft()Gets the value of the property onSwipeLeft.EventHandler<? super SwipeEvent>getOnSwipeRight()Gets the value of the property onSwipeRight.EventHandler<? super SwipeEvent>getOnSwipeUp()Gets the value of the property onSwipeUp.EventHandler<? super TouchEvent>getOnTouchMoved()Gets the value of the property onTouchMoved.EventHandler<? super TouchEvent>getOnTouchPressed()Gets the value of the property onTouchPressed.EventHandler<? super TouchEvent>getOnTouchReleased()Gets the value of the property onTouchReleased.EventHandler<? super TouchEvent>getOnTouchStationary()Gets the value of the property onTouchStationary.EventHandler<? super ZoomEvent>getOnZoom()Gets the value of the property onZoom.EventHandler<? super ZoomEvent>getOnZoomFinished()Gets the value of the property onZoomFinished.EventHandler<? super ZoomEvent>getOnZoomStarted()Gets the value of the property onZoomStarted.ObservableMap<Object,Object>getProperties()Returns an observable map of properties on this node for use primarily by application developers.ParentgetRoot()Gets the value of the property root.ObservableList<String>getStylesheets()Gets an observable list of string URLs linking to the stylesheets to use with this scene's contents.StringgetUserAgentStylesheet()Get the URL of the user-agent stylesheet that will be used by this Scene.ObjectgetUserData()Returns a previously set Object property, or null if no such property has been set using thesetUserData(java.lang.Object)method.doublegetWidth()Gets the value of the property width.WindowgetWindow()Gets the value of the property window.doublegetX()Gets the value of the property x.doublegetY()Gets the value of the property y.booleanhasProperties()Tests if Scene has properties.ReadOnlyDoublePropertyheightProperty()The height of thisScenebooleanisDepthBuffer()Retrieves the depth buffer attribute for this scene.Nodelookup(String selector)Looks for any node within the scene graph based on the specified CSS selector.ObjectProperty<NodeOrientation>nodeOrientationProperty()Property holding NodeOrientation.ObjectProperty<EventHandler<? super ContextMenuEvent>>onContextMenuRequestedProperty()Defines a function to be called when a mouse button has been clicked (pressed and released) on thisScene.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 thisSceneis 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 thisSceneduring drag and drop gesture.ObjectProperty<EventHandler<? super DragEvent>>onDragEnteredProperty()Defines a function to be called when drag gesture enters thisScene.ObjectProperty<EventHandler<? super DragEvent>>onDragExitedProperty()Defines a function to be called when drag gesture exits thisScene.ObjectProperty<EventHandler<? super DragEvent>>onDragOverProperty()Defines a function to be called when drag gesture progresses within thisScene.ObjectProperty<EventHandler<? super InputMethodEvent>>onInputMethodTextChangedProperty()Defines a function to be called when thisNodehas input focus and the input method text has changed.ObjectProperty<EventHandler<? super KeyEvent>>onKeyPressedProperty()Defines a function to be called when someNodeof thisScenehas input focus and a key has been pressed.ObjectProperty<EventHandler<? super KeyEvent>>onKeyReleasedProperty()Defines a function to be called when someNodeof thisScenehas input focus and a key has been released.ObjectProperty<EventHandler<? super KeyEvent>>onKeyTypedProperty()Defines a function to be called when someNodeof thisScenehas 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 thisScene.ObjectProperty<EventHandler<? super MouseDragEvent>>onMouseDragEnteredProperty()Defines a function to be called when a full press-drag-release gesture enters thisScene.ObjectProperty<EventHandler<? super MouseDragEvent>>onMouseDragExitedProperty()Defines a function to be called when a full press-drag-release gesture exits thisScene.ObjectProperty<EventHandler<? super MouseEvent>>onMouseDraggedProperty()Defines a function to be called when a mouse button is pressed on thisSceneand then dragged.ObjectProperty<EventHandler<? super MouseDragEvent>>onMouseDragOverProperty()Defines a function to be called when a full press-drag-release gesture progresses within thisScene.ObjectProperty<EventHandler<? super MouseDragEvent>>onMouseDragReleasedProperty()Defines a function to be called when a full press-drag-release gesture ends within thisScene.ObjectProperty<EventHandler<? super MouseEvent>>onMouseEnteredProperty()Defines a function to be called when the mouse enters thisScene.ObjectProperty<EventHandler<? super MouseEvent>>onMouseExitedProperty()Defines a function to be called when the mouse exits thisScene.ObjectProperty<EventHandler<? super MouseEvent>>onMouseMovedProperty()Defines a function to be called when mouse cursor moves within thisScenebut no buttons have been pushed.ObjectProperty<EventHandler<? super MouseEvent>>onMousePressedProperty()Defines a function to be called when a mouse button has been pressed on thisScene.ObjectProperty<EventHandler<? super MouseEvent>>onMouseReleasedProperty()Defines a function to be called when a mouse button has been released on thisScene.ObjectProperty<EventHandler<? super RotateEvent>>onRotateProperty()Defines a function to be called when user performs a rotating action.ObjectProperty<EventHandler<? super RotateEvent>>onRotationFinishedProperty()Defines a function to be called when a rotating gesture ends.ObjectProperty<EventHandler<? super RotateEvent>>onRotationStartedProperty()Defines a function to be called when a rotating 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 an downward swipe gesture happens in this scene.ObjectProperty<EventHandler<? super SwipeEvent>>onSwipeLeftProperty()Defines a function to be called when an leftward swipe gesture happens in this scene.ObjectProperty<EventHandler<? super SwipeEvent>>onSwipeRightProperty()Defines a function to be called when an rightward swipe gesture happens in this scene.ObjectProperty<EventHandler<? super SwipeEvent>>onSwipeUpProperty()Defines a function to be called when an upward swipe gesture happens in this scene.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 new touch point is pressed.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.<T extends Event>
 voidremoveEventFilter(EventType<T> eventType, EventHandler<? super T> eventFilter)Unregisters a previously registered event filter from this scene.<T extends Event>
 voidremoveEventHandler(EventType<T> eventType, EventHandler<? super T> eventHandler)Unregisters a previously registered event handler from this scene.voidremoveMnemonic(Mnemonic m)Unregisters the specified mnemonic.voidremovePostLayoutPulseListener(Runnable r)Removes a previously registered scene post layout pulse listener from listening to pulses in this scene.voidremovePreLayoutPulseListener(Runnable r)Removes a previously registered scene pre layout pulse listener from listening to pulses in this scene.ObjectProperty<Parent>rootProperty()Defines the rootNodeof the scene graph.voidsetCamera(Camera value)Sets the value of the property camera.voidsetCursor(Cursor value)Sets the value of the property cursor.voidsetEventDispatcher(EventDispatcher value)Sets the value of the property eventDispatcher.protected <T extends Event>
 voidsetEventHandler(EventType<T> eventType, EventHandler<? super T> eventHandler)Sets the handler to use for this event type.voidsetFill(Paint value)Sets the value of the property fill.voidsetNodeOrientation(NodeOrientation orientation)Sets the value of the property nodeOrientation.voidsetOnContextMenuRequested(EventHandler<? super ContextMenuEvent> value)Sets the value of the property onContextMenuRequested.voidsetOnDragDetected(EventHandler<? super MouseEvent> value)Sets the value of the property onDragDetected.voidsetOnDragDone(EventHandler<? super DragEvent> value)Sets the value of the property onDragDone.voidsetOnDragDropped(EventHandler<? super DragEvent> value)Sets the value of the property onDragDropped.voidsetOnDragEntered(EventHandler<? super DragEvent> value)Sets the value of the property onDragEntered.voidsetOnDragExited(EventHandler<? super DragEvent> value)Sets the value of the property onDragExited.voidsetOnDragOver(EventHandler<? super DragEvent> value)Sets the value of the property onDragOver.voidsetOnInputMethodTextChanged(EventHandler<? super InputMethodEvent> value)Sets the value of the property onInputMethodTextChanged.voidsetOnKeyPressed(EventHandler<? super KeyEvent> value)Sets the value of the property onKeyPressed.voidsetOnKeyReleased(EventHandler<? super KeyEvent> value)Sets the value of the property onKeyReleased.voidsetOnKeyTyped(EventHandler<? super KeyEvent> value)Sets the value of the property onKeyTyped.voidsetOnMouseClicked(EventHandler<? super MouseEvent> value)Sets the value of the property onMouseClicked.voidsetOnMouseDragEntered(EventHandler<? super MouseDragEvent> value)Sets the value of the property onMouseDragEntered.voidsetOnMouseDragExited(EventHandler<? super MouseDragEvent> value)Sets the value of the property onMouseDragExited.voidsetOnMouseDragged(EventHandler<? super MouseEvent> value)Sets the value of the property onMouseDragged.voidsetOnMouseDragOver(EventHandler<? super MouseDragEvent> value)Sets the value of the property onMouseDragOver.voidsetOnMouseDragReleased(EventHandler<? super MouseDragEvent> value)Sets the value of the property onMouseDragReleased.voidsetOnMouseEntered(EventHandler<? super MouseEvent> value)Sets the value of the property onMouseEntered.voidsetOnMouseExited(EventHandler<? super MouseEvent> value)Sets the value of the property onMouseExited.voidsetOnMouseMoved(EventHandler<? super MouseEvent> value)Sets the value of the property onMouseMoved.voidsetOnMousePressed(EventHandler<? super MouseEvent> value)Sets the value of the property onMousePressed.voidsetOnMouseReleased(EventHandler<? super MouseEvent> value)Sets the value of the property onMouseReleased.voidsetOnRotate(EventHandler<? super RotateEvent> value)Sets the value of the property onRotate.voidsetOnRotationFinished(EventHandler<? super RotateEvent> value)Sets the value of the property onRotationFinished.voidsetOnRotationStarted(EventHandler<? super RotateEvent> value)Sets the value of the property onRotationStarted.voidsetOnScroll(EventHandler<? super ScrollEvent> value)Sets the value of the property onScroll.voidsetOnScrollFinished(EventHandler<? super ScrollEvent> value)Sets the value of the property onScrollFinished.voidsetOnScrollStarted(EventHandler<? super ScrollEvent> value)Sets the value of the property onScrollStarted.voidsetOnSwipeDown(EventHandler<? super SwipeEvent> value)Sets the value of the property onSwipeDown.voidsetOnSwipeLeft(EventHandler<? super SwipeEvent> value)Sets the value of the property onSwipeLeft.voidsetOnSwipeRight(EventHandler<? super SwipeEvent> value)Sets the value of the property onSwipeRight.voidsetOnSwipeUp(EventHandler<? super SwipeEvent> value)Sets the value of the property onSwipeUp.voidsetOnTouchMoved(EventHandler<? super TouchEvent> value)Sets the value of the property onTouchMoved.voidsetOnTouchPressed(EventHandler<? super TouchEvent> value)Sets the value of the property onTouchPressed.voidsetOnTouchReleased(EventHandler<? super TouchEvent> value)Sets the value of the property onTouchReleased.voidsetOnTouchStationary(EventHandler<? super TouchEvent> value)Sets the value of the property onTouchStationary.voidsetOnZoom(EventHandler<? super ZoomEvent> value)Sets the value of the property onZoom.voidsetOnZoomFinished(EventHandler<? super ZoomEvent> value)Sets the value of the property onZoomFinished.voidsetOnZoomStarted(EventHandler<? super ZoomEvent> value)Sets the value of the property onZoomStarted.voidsetRoot(Parent value)Sets the value of the property root.voidsetUserAgentStylesheet(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.voidsetUserData(Object value)Convenience method for setting a single Object property that can be retrieved at a later date.WritableImagesnapshot(WritableImage image)Takes a snapshot of this scene and returns the rendered image when it is ready.voidsnapshot(Callback<SnapshotResult,Void> callback, WritableImage image)Takes a snapshot of this scene at the next frame and calls the specified callback method when the image is ready.DragboardstartDragAndDrop(TransferMode... transferModes)Confirms a potential drag and drop gesture that is recognized over thisScene.voidstartFullDrag()Starts a full press-drag-release gesture with this scene as gesture source.ObjectProperty<String>userAgentStylesheetProperty()ReadOnlyDoublePropertywidthProperty()The width of thisSceneReadOnlyObjectProperty<Window>windowProperty()TheWindowfor thisSceneReadOnlyDoublePropertyxProperty()The horizontal location of thisSceneon theWindow.ReadOnlyDoublePropertyyProperty()The vertical location of thisSceneon theWindow.
- 
Property Details- 
windowTheWindowfor thisScene- See Also:
- getWindow()
 
- 
xThe horizontal location of thisSceneon theWindow.- See Also:
- getX()
 
- 
yThe vertical location of thisSceneon theWindow.- See Also:
- getY()
 
- 
widthThe width of thisScene- See Also:
- getWidth()
 
- 
heightThe height of thisScene- See Also:
- getHeight()
 
- 
cameraSpecifies the type of camera use for rendering thisScene. Ifcamerais null, a parallel camera is used for rendering. It is illegal to set a camera that belongs to otherSceneorSubScene.Note: this is a conditional feature. See ConditionalFeature.SCENE3Dfor more information.- Default value:
- null
- See Also:
- getCamera(),- setCamera(Camera)
 
- 
fillDefines the background fill of thisScene. Both anullvalue meaning 'paint no background' and aPaintwith transparency are supported. The default fill of the Scene isColor.WHITE, but it is more commonly the case that the initial color shown to users is the background fill of theroot nodeof theScene, as it typically is stretched to take up all available space in theScene. The root node of theSceneis 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.- Default value:
- WHITE
- See Also:
- getFill(),- setFill(Paint)
 
- 
rootDefines the rootNodeof the scene graph. If aGroupis 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 (layoutRegionorControl) 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.- See Also:
- getRoot(),- setRoot(Parent)
 
- 
cursorDefines the mouse cursor for thisScene.- See Also:
- getCursor(),- setCursor(Cursor)
 
- 
userAgentStylesheet- Since:
- JavaFX 8u20
- See Also:
- getUserAgentStylesheet(),- setUserAgentStylesheet(String)
 
- 
focusOwnerThe scene's current focus owner node. This node's "focused" variable might be false if this scene has no window, or if the window is inactive (window.focused == false).- Since:
- JavaFX 2.2
- See Also:
- getFocusOwner()
 
- 
eventDispatcherSpecifies the event dispatcher for this scene. When replacing the value with a newEventDispatcher, the new dispatcher should forward events to the replaced dispatcher to keep the scene's default event handling behavior.
- 
onContextMenuRequestedDefines a function to be called when a mouse button has been clicked (pressed and released) on thisScene.- Since:
- JavaFX 2.1
- See Also:
- getOnContextMenuRequested(),- setOnContextMenuRequested(EventHandler)
 
- 
onMouseClickedDefines a function to be called when a mouse button has been clicked (pressed and released) on thisScene.
- 
onMouseDraggedDefines a function to be called when a mouse button is pressed on thisSceneand then dragged.
- 
onMouseEnteredDefines a function to be called when the mouse enters thisScene.
- 
onMouseExitedDefines a function to be called when the mouse exits thisScene.- See Also:
- getOnMouseExited(),- setOnMouseExited(EventHandler)
 
- 
onMouseMovedDefines a function to be called when mouse cursor moves within thisScenebut no buttons have been pushed.- See Also:
- getOnMouseMoved(),- setOnMouseMoved(EventHandler)
 
- 
onMousePressedDefines a function to be called when a mouse button has been pressed on thisScene.
- 
onMouseReleasedDefines a function to be called when a mouse button has been released on thisScene.
- 
onDragDetectedDefines a function to be called when drag gesture has been detected. This is the right place to start drag and drop operation.
- 
onMouseDragOverDefines a function to be called when a full press-drag-release gesture progresses within thisScene.- Since:
- JavaFX 2.1
- See Also:
- getOnMouseDragOver(),- setOnMouseDragOver(EventHandler)
 
- 
onMouseDragReleasedDefines a function to be called when a full press-drag-release gesture ends within thisScene.- Since:
- JavaFX 2.1
- See Also:
- getOnMouseDragReleased(),- setOnMouseDragReleased(EventHandler)
 
- 
onMouseDragEnteredDefines a function to be called when a full press-drag-release gesture enters thisScene.- Since:
- JavaFX 2.1
- See Also:
- getOnMouseDragEntered(),- setOnMouseDragEntered(EventHandler)
 
- 
onMouseDragExitedDefines a function to be called when a full press-drag-release gesture exits thisScene.- Since:
- JavaFX 2.1
- See Also:
- getOnMouseDragExited(),- setOnMouseDragExited(EventHandler)
 
- 
onScrollStartedDefines a function to be called when a scrolling gesture is detected.- Since:
- JavaFX 2.2
- See Also:
- getOnScrollStarted(),- setOnScrollStarted(EventHandler)
 
- 
onScrollDefines a function to be called when user performs a scrolling action.- See Also:
- getOnScroll(),- setOnScroll(EventHandler)
 
- 
onScrollFinishedDefines a function to be called when a scrolling gesture ends.- Since:
- JavaFX 2.2
- See Also:
- getOnScrollFinished(),- setOnScrollFinished(EventHandler)
 
- 
onRotationStartedDefines a function to be called when a rotating gesture is detected.- Since:
- JavaFX 2.2
- See Also:
- getOnRotationStarted(),- setOnRotationStarted(EventHandler)
 
- 
onRotateDefines a function to be called when user performs a rotating action.- Since:
- JavaFX 2.2
- See Also:
- getOnRotate(),- setOnRotate(EventHandler)
 
- 
onRotationFinishedDefines a function to be called when a rotating gesture ends.- Since:
- JavaFX 2.2
- See Also:
- getOnRotationFinished(),- setOnRotationFinished(EventHandler)
 
- 
onZoomStartedDefines a function to be called when a zooming gesture is detected.- Since:
- JavaFX 2.2
- See Also:
- getOnZoomStarted(),- setOnZoomStarted(EventHandler)
 
- 
onZoomDefines a function to be called when user performs a zooming action.- Since:
- JavaFX 2.2
- See Also:
- getOnZoom(),- setOnZoom(EventHandler)
 
- 
onZoomFinishedDefines a function to be called when a zooming gesture ends.- Since:
- JavaFX 2.2
- See Also:
- getOnZoomFinished(),- setOnZoomFinished(EventHandler)
 
- 
onSwipeUpDefines a function to be called when an upward swipe gesture happens in this scene.- Since:
- JavaFX 2.2
- See Also:
- getOnSwipeUp(),- setOnSwipeUp(EventHandler)
 
- 
onSwipeDownDefines a function to be called when an downward swipe gesture happens in this scene.- Since:
- JavaFX 2.2
- See Also:
- getOnSwipeDown(),- setOnSwipeDown(EventHandler)
 
- 
onSwipeLeftDefines a function to be called when an leftward swipe gesture happens in this scene.- Since:
- JavaFX 2.2
- See Also:
- getOnSwipeLeft(),- setOnSwipeLeft(EventHandler)
 
- 
onSwipeRightDefines a function to be called when an rightward swipe gesture happens in this scene.- Since:
- JavaFX 2.2
- See Also:
- getOnSwipeRight(),- setOnSwipeRight(EventHandler)
 
- 
onTouchPressedDefines a function to be called when a new touch point is pressed.- Since:
- JavaFX 2.2
- See Also:
- getOnTouchPressed(),- setOnTouchPressed(EventHandler)
 
- 
onTouchMovedDefines a function to be called when a touch point is moved.- Since:
- JavaFX 2.2
- See Also:
- getOnTouchMoved(),- setOnTouchMoved(EventHandler)
 
- 
onTouchReleasedDefines a function to be called when a new touch point is pressed.- Since:
- JavaFX 2.2
- See Also:
- getOnTouchReleased(),- setOnTouchReleased(EventHandler)
 
- 
onTouchStationaryDefines a function to be called when a touch point stays pressed and still.- Since:
- JavaFX 2.2
- See Also:
- getOnTouchStationary(),- setOnTouchStationary(EventHandler)
 
- 
onDragEnteredDefines a function to be called when drag gesture enters thisScene.- See Also:
- getOnDragEntered(),- setOnDragEntered(EventHandler)
 
- 
onDragExitedDefines a function to be called when drag gesture exits thisScene.- See Also:
- getOnDragExited(),- setOnDragExited(EventHandler)
 
- 
onDragOverDefines a function to be called when drag gesture progresses within thisScene.- See Also:
- getOnDragOver(),- setOnDragOver(EventHandler)
 
- 
onDragDroppedDefines a function to be called when the mouse button is released on thisSceneduring drag and drop gesture. Transfer of data from theDragEvent'sdragboardshould happen in this function.- See Also:
- getOnDragDropped(),- setOnDragDropped(EventHandler)
 
- 
onDragDoneDefines a function to be called when thisSceneis a drag and drop gesture source after its data has been dropped on a drop target. ThetransferModeof the event shows what just happened at the drop target. IftransferModehas the valueMOVE, 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. AtransferModethat has the valueNONEindicates that no data was transferred during the drag and drop gesture. Positional data for theDragEventis invalid. Valid positional data for theDragEventis presented in theonDragDroppedevent handler.- See Also:
- getOnDragDone(),- setOnDragDone(EventHandler)
 
- 
onKeyPressedDefines a function to be called when someNodeof thisScenehas 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.- See Also:
- getOnKeyPressed(),- setOnKeyPressed(EventHandler)
 
- 
onKeyReleasedDefines a function to be called when someNodeof thisScenehas 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.- See Also:
- getOnKeyReleased(),- setOnKeyReleased(EventHandler)
 
- 
onKeyTypedDefines a function to be called when someNodeof thisScenehas 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.- See Also:
- getOnKeyTyped(),- setOnKeyTyped(EventHandler)
 
- 
onInputMethodTextChangedpublic final ObjectProperty<EventHandler<? super InputMethodEvent>> onInputMethodTextChangedPropertyDefines a function to be called when thisNodehas input focus and the input method text has changed. If this function is not defined in thisNode, then it receives the result string of the input method composition as a series ofonKeyTypedfunction calls.When the Nodeloses the input focus, the JavaFX runtime automatically commits the existing composed text if any.
- 
nodeOrientationProperty holding NodeOrientation.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. - Since:
- JavaFX 8.0
- See Also:
- getNodeOrientation(),- setNodeOrientation(NodeOrientation)
 
- 
effectiveNodeOrientationThe effective node orientation of a scene resolves the inheritance of node orientation, returning either left-to-right or right-to-left.- Since:
- JavaFX 8.0
- See Also:
- getEffectiveNodeOrientation()
 
 
- 
- 
Constructor Details- 
SceneCreates a Scene for a specific root Node.- Parameters:
- root- The root node of the scene graph
- Throws:
- NullPointerException- if root is null
 
- 
SceneCreates a Scene for a specific root Node with a specific size.- Parameters:
- root- The root node of the scene graph
- width- The width of the scene
- height- The height of the scene
- Throws:
- NullPointerException- if root is null
 
- 
SceneCreates a Scene for a specific root Node with a fill.- Parameters:
- root- The parent
- fill- The fill
- Throws:
- NullPointerException- if root is null
 
- 
SceneCreates a Scene for a specific root Node with a specific size and fill.- Parameters:
- root- The root node of the scene graph
- width- The width of the scene
- height- The height of the scene
- fill- The fill
- Throws:
- NullPointerException- if root is null
 
- 
SceneConstructs a scene consisting of a root, with a dimension of width and height, and specifies whether a depth buffer is created for this scene.A scene with only 2D shapes and without any 3D transforms does not need a depth buffer. 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 depthTestfor more information.- Parameters:
- root- The root node of the scene graph
- width- The width of the scene
- height- The height of the scene
- depthBuffer- The depth buffer flag- The depthBuffer flag is a conditional feature and its default value is false. See - ConditionalFeature.SCENE3Dfor more information.
- Throws:
- NullPointerException- if root is null
- See Also:
- Node.setDepthTest(DepthTest)
 
- 
Scenepublic 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.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 depthTestfor more information. A scene with 3D shapes may enable scene anti-aliasing to improve its rendering quality.- Parameters:
- root- The root node of the scene graph
- width- The width of the scene
- height- The height of the scene
- depthBuffer- The depth buffer flag
- antiAliasing- The scene anti-aliasing attribute. A value of- nullis treated as DISABLED.- The depthBuffer and antiAliasing are conditional features. With the respective default values of: false and - SceneAntialiasing.DISABLED. See- ConditionalFeature.SCENE3Dfor more information.
- Throws:
- NullPointerException- if root is null
- Since:
- JavaFX 8.0
- See Also:
- Node.setDepthTest(DepthTest)
 
 
- 
- 
Method Details- 
addPreLayoutPulseListenerAdds a new scene pre layout pulse listener to this scene. Every time a pulse occurs, this listener will be called on the JavaFX Application Thread directly before the CSS and layout passes, and also before any rendering is done for this frame. This scene pulse listener is suitable for knowing when a scenegraph pulse is happening and also for modifying the scenegraph (as it is called before CSS and layout, so any changes made will be properly styled and positioned). This method must be called on the JavaFX Application thread.- Parameters:
- r- The Runnable to be called when the pulse occurs.
- Throws:
- IllegalStateException- if this method is called on a thread other than the JavaFX Application Thread.
- NullPointerException- if the provided Runnable is null.
- Since:
- 9
 
- 
removePreLayoutPulseListenerRemoves a previously registered scene pre layout pulse listener from listening to pulses in this scene. This method does nothing if the specified Runnable is not already in the list. This method must be called on the JavaFX Application thread.- Parameters:
- r- The Runnable that should no longer be called when the pulse occurs for this scene.
- Throws:
- IllegalStateException- if this method is called on a thread other than the JavaFX Application Thread.
- Since:
- 9
 
- 
addPostLayoutPulseListenerAdds a new scene post layout pulse listener to this scene. Every time a pulse occurs, this listener will be called on the JavaFX Application Thread directly after the CSS and layout passes, but before any rendering is done for this frame. This scene pulse listener is suitable for knowing when a scenegraph pulse is happening, but it is not suited to use cases related to modifying the scenegraph (as it is called after CSS and layout, so any changes will possibly be incorrect until the next pulse is run). An alternative (and better) solution for situations where a scenegraph modification is required to happen is to use either theaddPreLayoutPulseListener(Runnable)API or the theAnimationTimerAPI. This method must be called on the JavaFX Application thread.- Parameters:
- r- The Runnable to be called when the pulse occurs.
- Throws:
- IllegalStateException- if this method is called on a thread other than the JavaFX Application Thread.
- NullPointerException- if the provided Runnable is null.
- Since:
- 9
 
- 
removePostLayoutPulseListenerRemoves a previously registered scene post layout pulse listener from listening to pulses in this scene. This method does nothing if the specified Runnable is not already in the list. This method must be called on the JavaFX Application thread.- Parameters:
- r- The Runnable that should no longer be called when the pulse occurs for this scene.
- Throws:
- IllegalStateException- if this method is called on a thread other than the JavaFX Application Thread.
- Since:
- 9
 
- 
getAntiAliasingReturn the definedSceneAntialiasingfor thisScene.Note: this is a conditional feature. See ConditionalFeature.SCENE3DandSceneAntialiasingfor more information.- Returns:
- the SceneAntialiasing for this scene
- Since:
- JavaFX 8.0
 
- 
getWindowGets the value of the property window.- Property description:
- The Windowfor thisScene
 
- 
windowPropertyTheWindowfor thisScene- See Also:
- getWindow()
 
- 
getXpublic final double getX()Gets the value of the property x.- Property description:
- The horizontal location of this Sceneon theWindow.
 
- 
xPropertyThe horizontal location of thisSceneon theWindow.- See Also:
- getX()
 
- 
getYpublic final double getY()Gets the value of the property y.- Property description:
- The vertical location of this Sceneon theWindow.
 
- 
yPropertyThe vertical location of thisSceneon theWindow.- See Also:
- getY()
 
- 
getWidthpublic final double getWidth()Gets the value of the property width.- Property description:
- The width of this Scene
 
- 
widthPropertyThe width of thisScene- See Also:
- getWidth()
 
- 
getHeightpublic final double getHeight()Gets the value of the property height.- Property description:
- The height of this Scene
 
- 
heightPropertyThe height of thisScene- See Also:
- getHeight()
 
- 
setCameraSets the value of the property camera.- Property description:
- Specifies the type of camera use for rendering this Scene. Ifcamerais null, a parallel camera is used for rendering. It is illegal to set a camera that belongs to otherSceneorSubScene.Note: this is a conditional feature. See ConditionalFeature.SCENE3Dfor more information.
- Default value:
- null
 
- 
getCameraGets the value of the property camera.- Property description:
- Specifies the type of camera use for rendering this Scene. Ifcamerais null, a parallel camera is used for rendering. It is illegal to set a camera that belongs to otherSceneorSubScene.Note: this is a conditional feature. See ConditionalFeature.SCENE3Dfor more information.
- Default value:
- null
 
- 
cameraPropertySpecifies the type of camera use for rendering thisScene. Ifcamerais null, a parallel camera is used for rendering. It is illegal to set a camera that belongs to otherSceneorSubScene.Note: this is a conditional feature. See ConditionalFeature.SCENE3Dfor more information.- Default value:
- null
- See Also:
- getCamera(),- setCamera(Camera)
 
- 
setFillSets the value of the property fill.- Property description:
- Defines the background fill of this Scene. Both anullvalue meaning 'paint no background' and aPaintwith transparency are supported. The default fill of the Scene isColor.WHITE, but it is more commonly the case that the initial color shown to users is the background fill of theroot nodeof theScene, as it typically is stretched to take up all available space in theScene. The root node of theSceneis 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.
- Default value:
- WHITE
 
- 
getFillGets the value of the property fill.- Property description:
- Defines the background fill of this Scene. Both anullvalue meaning 'paint no background' and aPaintwith transparency are supported. The default fill of the Scene isColor.WHITE, but it is more commonly the case that the initial color shown to users is the background fill of theroot nodeof theScene, as it typically is stretched to take up all available space in theScene. The root node of theSceneis 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.
- Default value:
- WHITE
 
- 
fillPropertyDefines the background fill of thisScene. Both anullvalue meaning 'paint no background' and aPaintwith transparency are supported. The default fill of the Scene isColor.WHITE, but it is more commonly the case that the initial color shown to users is the background fill of theroot nodeof theScene, as it typically is stretched to take up all available space in theScene. The root node of theSceneis 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.- Default value:
- WHITE
- See Also:
- getFill(),- setFill(Paint)
 
- 
setRootSets the value of the property root.- Property description:
- Defines the root Nodeof the scene graph. If aGroupis 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 (layoutRegionorControl) 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.
 
- 
getRootGets the value of the property root.- Property description:
- Defines the root Nodeof the scene graph. If aGroupis 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 (layoutRegionorControl) 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.
 
- 
rootPropertyDefines the rootNodeof the scene graph. If aGroupis 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 (layoutRegionorControl) 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.- See Also:
- getRoot(),- setRoot(Parent)
 
- 
snapshotTakes a snapshot of this scene and returns the rendered image when it is ready. CSS and layout processing will be done for the scene prior to rendering it. The entire destination image is cleared using the fillPaintof 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. - Parameters:
- 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.
- Returns:
- the rendered image
- Throws:
- IllegalStateException- if this method is called on a thread other than the JavaFX Application Thread.
- Since:
- JavaFX 2.2
 
- 
snapshotTakes a snapshot of this scene at the next frame and calls the specified callback method when the image is ready. CSS and layout processing will be done for the scene prior to rendering it. The entire destination image is cleared using the fillPaintof 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. - Parameters:
- 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.
- Throws:
- IllegalStateException- if this method is called on a thread other than the JavaFX Application Thread.
- NullPointerException- if the callback parameter is null.
- Since:
- JavaFX 2.2
 
- 
setCursorSets the value of the property cursor.- Property description:
- Defines the mouse cursor for this Scene.
 
- 
getCursorGets the value of the property cursor.- Property description:
- Defines the mouse cursor for this Scene.
 
- 
cursorPropertyDefines the mouse cursor for thisScene.- See Also:
- getCursor(),- setCursor(Cursor)
 
- 
lookupLooks for any node within the scene graph based on the specified CSS selector. If more than one node matches the specified selector, this function returns the first of them. If no nodes are found with this id, then null is returned.- Parameters:
- selector- The css selector to look up
- Returns:
- the Nodein the scene which matches the CSSselector, ornullif none is found.
 
- 
getStylesheetsGets an observable list of string URLs linking to the stylesheets to use with this scene's contents.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. The RFC 2397 "data" scheme for URLs is supported in addition to the protocol handlers that are registered for the application. If a URL uses the "data" scheme and the MIME type is either empty, "text/plain", or "text/css", the payload will be interpreted as a CSS file. If the MIME type is "application/octet-stream", the payload will be interpreted as a binary CSS file (see Stylesheet.convertToBinary(File, File)).
 For additional information about using CSS with the scene graph, see the CSS Reference Guide.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); } }- Returns:
- the list of stylesheets to use with this scene
 
- 
userAgentStylesheetProperty- Since:
- JavaFX 8u20
- See Also:
- getUserAgentStylesheet(),- setUserAgentStylesheet(String)
 
- 
getUserAgentStylesheetGet the URL of the user-agent stylesheet that will be used by this Scene. If the URL has not been set, the platform-default user-agent stylesheet will be used.For additional information about using CSS with the scene graph, see the CSS Reference Guide. - Returns:
- The URL of the user-agent stylesheet that will be used by this Scene, or null if has not been set.
- Since:
- JavaFX 8u20
 
- 
setUserAgentStylesheetSet the URL of the user-agent stylesheet that will be used by this Scene in place of the the platform-default user-agent stylesheet. If the URL does not resolve to a valid location, the platform-default user-agent stylesheet will be used.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. The RFC 2397 "data" scheme for URLs is supported in addition to the protocol handlers that are registered for the application. If a URL uses the "data" scheme and the MIME type is either empty, "text/plain", or "text/css", the payload will be interpreted as a CSS file. If the MIME type is "application/octet-stream", the payload will be interpreted as a binary CSS file (see Stylesheet.convertToBinary(File, File)).For additional information about using CSS with the scene graph, see the CSS Reference Guide. - Parameters:
- url- the URL of the user-agent stylesheet
- Since:
- JavaFX 8u20
 
- 
isDepthBufferpublic final boolean isDepthBuffer()Retrieves the depth buffer attribute for this scene.- Returns:
- the depth buffer attribute.
 
- 
getFocusOwnerGets the value of the property focusOwner.- Property description:
- The scene's current focus owner node. This node's "focused" variable might be false if this scene has no window, or if the window is inactive (window.focused == false).
- Since:
- JavaFX 2.2
 
- 
focusOwnerPropertyThe scene's current focus owner node. This node's "focused" variable might be false if this scene has no window, or if the window is inactive (window.focused == false).- Since:
- JavaFX 2.2
- See Also:
- getFocusOwner()
 
- 
setEventDispatcherSets the value of the property eventDispatcher.- Property description:
- Specifies the event dispatcher for this scene. When replacing the value
 with a new EventDispatcher, the new dispatcher should forward events to the replaced dispatcher to keep the scene's default event handling behavior.
 
- 
getEventDispatcherGets the value of the property eventDispatcher.- Property description:
- Specifies the event dispatcher for this scene. When replacing the value
 with a new EventDispatcher, the new dispatcher should forward events to the replaced dispatcher to keep the scene's default event handling behavior.
 
- 
eventDispatcherPropertySpecifies the event dispatcher for this scene. When replacing the value with a newEventDispatcher, the new dispatcher should forward events to the replaced dispatcher to keep the scene's default event handling behavior.
- 
addEventHandlerpublic final <T extends Event> void addEventHandler(EventType<T> eventType, EventHandler<? super T> eventHandler)Registers an event handler to this scene. The handler is called when the scene receives anEventof the specified type during the bubbling phase of event delivery.- Type Parameters:
- T- the specific event class of the handler
- Parameters:
- eventType- the type of the events to receive by the handler
- eventHandler- the handler to register
- Throws:
- NullPointerException- if the event type or handler is null
 
- 
removeEventHandlerpublic final <T extends Event> void removeEventHandler(EventType<T> eventType, EventHandler<? super T> eventHandler)Unregisters a previously registered event handler from this scene. One handler might have been registered for different event types, so the caller needs to specify the particular event type from which to unregister the handler.- Type Parameters:
- T- the specific event class of the handler
- Parameters:
- eventType- the event type from which to unregister
- eventHandler- the handler to unregister
- Throws:
- NullPointerException- if the event type or handler is null
 
- 
addEventFilterpublic final <T extends Event> void addEventFilter(EventType<T> eventType, EventHandler<? super T> eventFilter)Registers an event filter to this scene. The filter is called when the scene receives anEventof the specified type during the capturing phase of event delivery.- Type Parameters:
- T- the specific event class of the filter
- Parameters:
- eventType- the type of the events to receive by the filter
- eventFilter- the filter to register
- Throws:
- NullPointerException- if the event type or filter is null
 
- 
removeEventFilterpublic final <T extends Event> void removeEventFilter(EventType<T> eventType, EventHandler<? super T> eventFilter)Unregisters a previously registered event filter from this scene. One filter might have been registered for different event types, so the caller needs to specify the particular event type from which to unregister the filter.- Type Parameters:
- T- the specific event class of the filter
- Parameters:
- eventType- the event type from which to unregister
- eventFilter- the filter to unregister
- Throws:
- NullPointerException- if the event type or filter is null
 
- 
setEventHandlerprotected final <T extends Event> void setEventHandler(EventType<T> eventType, EventHandler<? super T> eventHandler)Sets the handler to use for this event type. There can only be one such handler specified at a time. This handler is guaranteed to be called first. This is used for registering the user-defined onFoo event handlers.- Type Parameters:
- T- the specific event class of the handler
- Parameters:
- eventType- the event type to associate with the given eventHandler
- eventHandler- the handler to register, or null to unregister
- Throws:
- NullPointerException- if the event type is null
 
- 
addMnemonicRegisters the specified mnemonic.- Parameters:
- m- The mnemonic
 
- 
removeMnemonicUnregisters the specified mnemonic.- Parameters:
- m- The mnemonic
 
- 
getMnemonicsGets the list of mnemonics for thisScene.- Returns:
- the list of mnemonics
 
- 
getAcceleratorsGets the list of accelerators for thisScene.- Returns:
- the list of accelerators
 
- 
buildEventDispatchChainConstruct an event dispatch chain for this scene. The event dispatch chain contains all event dispatchers from the stage to this scene.- Specified by:
- buildEventDispatchChainin interface- EventTarget
- Parameters:
- tail- the initial chain to build from
- Returns:
- the resulting event dispatch chain for this scene
 
- 
setOnContextMenuRequestedSets the value of the property onContextMenuRequested.- Property description:
- Defines a function to be called when a mouse button has been clicked
 (pressed and released) on this Scene.
- Since:
- JavaFX 2.1
 
- 
getOnContextMenuRequestedGets the value of the property onContextMenuRequested.- Property description:
- Defines a function to be called when a mouse button has been clicked
 (pressed and released) on this Scene.
- Since:
- JavaFX 2.1
 
- 
onContextMenuRequestedPropertypublic final ObjectProperty<EventHandler<? super ContextMenuEvent>> onContextMenuRequestedProperty()Defines a function to be called when a mouse button has been clicked (pressed and released) on thisScene.- Since:
- JavaFX 2.1
- See Also:
- getOnContextMenuRequested(),- setOnContextMenuRequested(EventHandler)
 
- 
setOnMouseClickedSets the value of the property onMouseClicked.- Property description:
- Defines a function to be called when a mouse button has been clicked
 (pressed and released) on this Scene.
 
- 
getOnMouseClickedGets the value of the property onMouseClicked.- Property description:
- Defines a function to be called when a mouse button has been clicked
 (pressed and released) on this Scene.
 
- 
onMouseClickedPropertyDefines a function to be called when a mouse button has been clicked (pressed and released) on thisScene.
- 
setOnMouseDraggedSets the value of the property onMouseDragged.- Property description:
- Defines a function to be called when a mouse button is pressed
 on this Sceneand then dragged.
 
- 
getOnMouseDraggedGets the value of the property onMouseDragged.- Property description:
- Defines a function to be called when a mouse button is pressed
 on this Sceneand then dragged.
 
- 
onMouseDraggedPropertyDefines a function to be called when a mouse button is pressed on thisSceneand then dragged.
- 
setOnMouseEnteredSets the value of the property onMouseEntered.- Property description:
- Defines a function to be called when the mouse enters this Scene.
 
- 
getOnMouseEnteredGets the value of the property onMouseEntered.- Property description:
- Defines a function to be called when the mouse enters this Scene.
 
- 
onMouseEnteredPropertyDefines a function to be called when the mouse enters thisScene.
- 
setOnMouseExitedSets the value of the property onMouseExited.- Property description:
- Defines a function to be called when the mouse exits this Scene.
 
- 
getOnMouseExitedGets the value of the property onMouseExited.- Property description:
- Defines a function to be called when the mouse exits this Scene.
 
- 
onMouseExitedPropertyDefines a function to be called when the mouse exits thisScene.- See Also:
- getOnMouseExited(),- setOnMouseExited(EventHandler)
 
- 
setOnMouseMovedSets the value of the property onMouseMoved.- Property description:
- Defines a function to be called when mouse cursor moves within
 this Scenebut no buttons have been pushed.
 
- 
getOnMouseMovedGets the value of the property onMouseMoved.- Property description:
- Defines a function to be called when mouse cursor moves within
 this Scenebut no buttons have been pushed.
 
- 
onMouseMovedPropertyDefines a function to be called when mouse cursor moves within thisScenebut no buttons have been pushed.- See Also:
- getOnMouseMoved(),- setOnMouseMoved(EventHandler)
 
- 
setOnMousePressedSets the value of the property onMousePressed.- Property description:
- Defines a function to be called when a mouse button
 has been pressed on this Scene.
 
- 
getOnMousePressedGets the value of the property onMousePressed.- Property description:
- Defines a function to be called when a mouse button
 has been pressed on this Scene.
 
- 
onMousePressedPropertyDefines a function to be called when a mouse button has been pressed on thisScene.
- 
setOnMouseReleasedSets the value of the property onMouseReleased.- Property description:
- Defines a function to be called when a mouse button
 has been released on this Scene.
 
- 
getOnMouseReleasedGets the value of the property onMouseReleased.- Property description:
- Defines a function to be called when a mouse button
 has been released on this Scene.
 
- 
onMouseReleasedPropertyDefines a function to be called when a mouse button has been released on thisScene.
- 
setOnDragDetectedSets the value of the property onDragDetected.- Property description:
- Defines a function to be called when drag gesture has been detected. This is the right place to start drag and drop operation.
 
- 
getOnDragDetectedGets the value of the property onDragDetected.- Property description:
- Defines a function to be called when drag gesture has been detected. This is the right place to start drag and drop operation.
 
- 
onDragDetectedPropertyDefines a function to be called when drag gesture has been detected. This is the right place to start drag and drop operation.
- 
setOnMouseDragOverSets the value of the property onMouseDragOver.- Property description:
- Defines a function to be called when a full press-drag-release gesture
 progresses within this Scene.
- Since:
- JavaFX 2.1
 
- 
getOnMouseDragOverGets the value of the property onMouseDragOver.- Property description:
- Defines a function to be called when a full press-drag-release gesture
 progresses within this Scene.
- Since:
- JavaFX 2.1
 
- 
onMouseDragOverPropertyDefines a function to be called when a full press-drag-release gesture progresses within thisScene.- Since:
- JavaFX 2.1
- See Also:
- getOnMouseDragOver(),- setOnMouseDragOver(EventHandler)
 
- 
setOnMouseDragReleasedSets the value of the property onMouseDragReleased.- Property description:
- Defines a function to be called when a full press-drag-release gesture
 ends within this Scene.
- Since:
- JavaFX 2.1
 
- 
getOnMouseDragReleasedGets the value of the property onMouseDragReleased.- Property description:
- Defines a function to be called when a full press-drag-release gesture
 ends within this Scene.
- Since:
- JavaFX 2.1
 
- 
onMouseDragReleasedPropertyDefines a function to be called when a full press-drag-release gesture ends within thisScene.- Since:
- JavaFX 2.1
- See Also:
- getOnMouseDragReleased(),- setOnMouseDragReleased(EventHandler)
 
- 
setOnMouseDragEnteredSets the value of the property onMouseDragEntered.- Property description:
- Defines a function to be called when a full press-drag-release gesture
 enters this Scene.
- Since:
- JavaFX 2.1
 
- 
getOnMouseDragEnteredGets the value of the property onMouseDragEntered.- Property description:
- Defines a function to be called when a full press-drag-release gesture
 enters this Scene.
- Since:
- JavaFX 2.1
 
- 
onMouseDragEnteredPropertyDefines a function to be called when a full press-drag-release gesture enters thisScene.- Since:
- JavaFX 2.1
- See Also:
- getOnMouseDragEntered(),- setOnMouseDragEntered(EventHandler)
 
- 
setOnMouseDragExitedSets the value of the property onMouseDragExited.- Property description:
- Defines a function to be called when a full press-drag-release gesture
 exits this Scene.
- Since:
- JavaFX 2.1
 
- 
getOnMouseDragExitedGets the value of the property onMouseDragExited.- Property description:
- Defines a function to be called when a full press-drag-release gesture
 exits this Scene.
- Since:
- JavaFX 2.1
 
- 
onMouseDragExitedPropertyDefines a function to be called when a full press-drag-release gesture exits thisScene.- Since:
- JavaFX 2.1
- See Also:
- getOnMouseDragExited(),- setOnMouseDragExited(EventHandler)
 
- 
setOnScrollStartedSets the value of the property onScrollStarted.- Property description:
- Defines a function to be called when a scrolling gesture is detected.
- Since:
- JavaFX 2.2
 
- 
getOnScrollStartedGets the value of the property onScrollStarted.- Property description:
- Defines a function to be called when a scrolling gesture is detected.
- Since:
- JavaFX 2.2
 
- 
onScrollStartedPropertyDefines a function to be called when a scrolling gesture is detected.- Since:
- JavaFX 2.2
- See Also:
- getOnScrollStarted(),- setOnScrollStarted(EventHandler)
 
- 
setOnScrollSets the value of the property onScroll.- Property description:
- Defines a function to be called when user performs a scrolling action.
 
- 
getOnScrollGets the value of the property onScroll.- Property description:
- Defines a function to be called when user performs a scrolling action.
 
- 
onScrollPropertyDefines a function to be called when user performs a scrolling action.- See Also:
- getOnScroll(),- setOnScroll(EventHandler)
 
- 
setOnScrollFinishedSets the value of the property onScrollFinished.- Property description:
- Defines a function to be called when a scrolling gesture ends.
- Since:
- JavaFX 2.2
 
- 
getOnScrollFinishedGets the value of the property onScrollFinished.- Property description:
- Defines a function to be called when a scrolling gesture ends.
- Since:
- JavaFX 2.2
 
- 
onScrollFinishedPropertyDefines a function to be called when a scrolling gesture ends.- Since:
- JavaFX 2.2
- See Also:
- getOnScrollFinished(),- setOnScrollFinished(EventHandler)
 
- 
setOnRotationStartedSets the value of the property onRotationStarted.- Property description:
- Defines a function to be called when a rotating gesture is detected.
- Since:
- JavaFX 2.2
 
- 
getOnRotationStartedGets the value of the property onRotationStarted.- Property description:
- Defines a function to be called when a rotating gesture is detected.
- Since:
- JavaFX 2.2
 
- 
onRotationStartedPropertyDefines a function to be called when a rotating gesture is detected.- Since:
- JavaFX 2.2
- See Also:
- getOnRotationStarted(),- setOnRotationStarted(EventHandler)
 
- 
setOnRotateSets the value of the property onRotate.- Property description:
- Defines a function to be called when user performs a rotating action.
- Since:
- JavaFX 2.2
 
- 
getOnRotateGets the value of the property onRotate.- Property description:
- Defines a function to be called when user performs a rotating action.
- Since:
- JavaFX 2.2
 
- 
onRotatePropertyDefines a function to be called when user performs a rotating action.- Since:
- JavaFX 2.2
- See Also:
- getOnRotate(),- setOnRotate(EventHandler)
 
- 
setOnRotationFinishedSets the value of the property onRotationFinished.- Property description:
- Defines a function to be called when a rotating gesture ends.
- Since:
- JavaFX 2.2
 
- 
getOnRotationFinishedGets the value of the property onRotationFinished.- Property description:
- Defines a function to be called when a rotating gesture ends.
- Since:
- JavaFX 2.2
 
- 
onRotationFinishedPropertyDefines a function to be called when a rotating gesture ends.- Since:
- JavaFX 2.2
- See Also:
- getOnRotationFinished(),- setOnRotationFinished(EventHandler)
 
- 
setOnZoomStartedSets the value of the property onZoomStarted.- Property description:
- Defines a function to be called when a zooming gesture is detected.
- Since:
- JavaFX 2.2
 
- 
getOnZoomStartedGets the value of the property onZoomStarted.- Property description:
- Defines a function to be called when a zooming gesture is detected.
- Since:
- JavaFX 2.2
 
- 
onZoomStartedPropertyDefines a function to be called when a zooming gesture is detected.- Since:
- JavaFX 2.2
- See Also:
- getOnZoomStarted(),- setOnZoomStarted(EventHandler)
 
- 
setOnZoomSets the value of the property onZoom.- Property description:
- Defines a function to be called when user performs a zooming action.
- Since:
- JavaFX 2.2
 
- 
getOnZoomGets the value of the property onZoom.- Property description:
- Defines a function to be called when user performs a zooming action.
- Since:
- JavaFX 2.2
 
- 
onZoomPropertyDefines a function to be called when user performs a zooming action.- Since:
- JavaFX 2.2
- See Also:
- getOnZoom(),- setOnZoom(EventHandler)
 
- 
setOnZoomFinishedSets the value of the property onZoomFinished.- Property description:
- Defines a function to be called when a zooming gesture ends.
- Since:
- JavaFX 2.2
 
- 
getOnZoomFinishedGets the value of the property onZoomFinished.- Property description:
- Defines a function to be called when a zooming gesture ends.
- Since:
- JavaFX 2.2
 
- 
onZoomFinishedPropertyDefines a function to be called when a zooming gesture ends.- Since:
- JavaFX 2.2
- See Also:
- getOnZoomFinished(),- setOnZoomFinished(EventHandler)
 
- 
setOnSwipeUpSets the value of the property onSwipeUp.- Property description:
- Defines a function to be called when an upward swipe gesture happens in this scene.
- Since:
- JavaFX 2.2
 
- 
getOnSwipeUpGets the value of the property onSwipeUp.- Property description:
- Defines a function to be called when an upward swipe gesture happens in this scene.
- Since:
- JavaFX 2.2
 
- 
onSwipeUpPropertyDefines a function to be called when an upward swipe gesture happens in this scene.- Since:
- JavaFX 2.2
- See Also:
- getOnSwipeUp(),- setOnSwipeUp(EventHandler)
 
- 
setOnSwipeDownSets the value of the property onSwipeDown.- Property description:
- Defines a function to be called when an downward swipe gesture happens in this scene.
- Since:
- JavaFX 2.2
 
- 
getOnSwipeDownGets the value of the property onSwipeDown.- Property description:
- Defines a function to be called when an downward swipe gesture happens in this scene.
- Since:
- JavaFX 2.2
 
- 
onSwipeDownPropertyDefines a function to be called when an downward swipe gesture happens in this scene.- Since:
- JavaFX 2.2
- See Also:
- getOnSwipeDown(),- setOnSwipeDown(EventHandler)
 
- 
setOnSwipeLeftSets the value of the property onSwipeLeft.- Property description:
- Defines a function to be called when an leftward swipe gesture happens in this scene.
- Since:
- JavaFX 2.2
 
- 
getOnSwipeLeftGets the value of the property onSwipeLeft.- Property description:
- Defines a function to be called when an leftward swipe gesture happens in this scene.
- Since:
- JavaFX 2.2
 
- 
onSwipeLeftPropertyDefines a function to be called when an leftward swipe gesture happens in this scene.- Since:
- JavaFX 2.2
- See Also:
- getOnSwipeLeft(),- setOnSwipeLeft(EventHandler)
 
- 
setOnSwipeRightSets the value of the property onSwipeRight.- Property description:
- Defines a function to be called when an rightward swipe gesture happens in this scene.
- Since:
- JavaFX 2.2
 
- 
getOnSwipeRightGets the value of the property onSwipeRight.- Property description:
- Defines a function to be called when an rightward swipe gesture happens in this scene.
- Since:
- JavaFX 2.2
 
- 
onSwipeRightPropertyDefines a function to be called when an rightward swipe gesture happens in this scene.- Since:
- JavaFX 2.2
- See Also:
- getOnSwipeRight(),- setOnSwipeRight(EventHandler)
 
- 
setOnTouchPressedSets the value of the property onTouchPressed.- Property description:
- Defines a function to be called when a new touch point is pressed.
- Since:
- JavaFX 2.2
 
- 
getOnTouchPressedGets the value of the property onTouchPressed.- Property description:
- Defines a function to be called when a new touch point is pressed.
- Since:
- JavaFX 2.2
 
- 
onTouchPressedPropertyDefines a function to be called when a new touch point is pressed.- Since:
- JavaFX 2.2
- See Also:
- getOnTouchPressed(),- setOnTouchPressed(EventHandler)
 
- 
setOnTouchMovedSets the value of the property onTouchMoved.- Property description:
- Defines a function to be called when a touch point is moved.
- Since:
- JavaFX 2.2
 
- 
getOnTouchMovedGets the value of the property onTouchMoved.- Property description:
- Defines a function to be called when a touch point is moved.
- Since:
- JavaFX 2.2
 
- 
onTouchMovedPropertyDefines a function to be called when a touch point is moved.- Since:
- JavaFX 2.2
- See Also:
- getOnTouchMoved(),- setOnTouchMoved(EventHandler)
 
- 
setOnTouchReleasedSets the value of the property onTouchReleased.- Property description:
- Defines a function to be called when a new touch point is pressed.
- Since:
- JavaFX 2.2
 
- 
getOnTouchReleasedGets the value of the property onTouchReleased.- Property description:
- Defines a function to be called when a new touch point is pressed.
- Since:
- JavaFX 2.2
 
- 
onTouchReleasedPropertyDefines a function to be called when a new touch point is pressed.- Since:
- JavaFX 2.2
- See Also:
- getOnTouchReleased(),- setOnTouchReleased(EventHandler)
 
- 
setOnTouchStationarySets the value of the property onTouchStationary.- Property description:
- Defines a function to be called when a touch point stays pressed and still.
- Since:
- JavaFX 2.2
 
- 
getOnTouchStationaryGets the value of the property onTouchStationary.- Property description:
- Defines a function to be called when a touch point stays pressed and still.
- Since:
- JavaFX 2.2
 
- 
onTouchStationaryPropertyDefines a function to be called when a touch point stays pressed and still.- Since:
- JavaFX 2.2
- See Also:
- getOnTouchStationary(),- setOnTouchStationary(EventHandler)
 
- 
setOnDragEnteredSets the value of the property onDragEntered.- Property description:
- Defines a function to be called when drag gesture
 enters this Scene.
 
- 
getOnDragEnteredGets the value of the property onDragEntered.- Property description:
- Defines a function to be called when drag gesture
 enters this Scene.
 
- 
onDragEnteredPropertyDefines a function to be called when drag gesture enters thisScene.- See Also:
- getOnDragEntered(),- setOnDragEntered(EventHandler)
 
- 
setOnDragExitedSets the value of the property onDragExited.- Property description:
- Defines a function to be called when drag gesture
 exits this Scene.
 
- 
getOnDragExitedGets the value of the property onDragExited.- Property description:
- Defines a function to be called when drag gesture
 exits this Scene.
 
- 
onDragExitedPropertyDefines a function to be called when drag gesture exits thisScene.- See Also:
- getOnDragExited(),- setOnDragExited(EventHandler)
 
- 
setOnDragOverSets the value of the property onDragOver.- Property description:
- Defines a function to be called when drag gesture progresses
 within this Scene.
 
- 
getOnDragOverGets the value of the property onDragOver.- Property description:
- Defines a function to be called when drag gesture progresses
 within this Scene.
 
- 
onDragOverPropertyDefines a function to be called when drag gesture progresses within thisScene.- See Also:
- getOnDragOver(),- setOnDragOver(EventHandler)
 
- 
setOnDragDroppedSets the value of the property onDragDropped.
- 
getOnDragDroppedGets the value of the property onDragDropped.
- 
onDragDroppedPropertyDefines a function to be called when the mouse button is released on thisSceneduring drag and drop gesture. Transfer of data from theDragEvent'sdragboardshould happen in this function.- See Also:
- getOnDragDropped(),- setOnDragDropped(EventHandler)
 
- 
setOnDragDoneSets the value of the property onDragDone.- Property description:
- Defines a function to be called when this Sceneis a drag and drop gesture source after its data has been dropped on a drop target. ThetransferModeof the event shows what just happened at the drop target. IftransferModehas the valueMOVE, 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. AtransferModethat has the valueNONEindicates that no data was transferred during the drag and drop gesture. Positional data for theDragEventis invalid. Valid positional data for theDragEventis presented in theonDragDroppedevent handler.
 
- 
getOnDragDoneGets the value of the property onDragDone.- Property description:
- Defines a function to be called when this Sceneis a drag and drop gesture source after its data has been dropped on a drop target. ThetransferModeof the event shows what just happened at the drop target. IftransferModehas the valueMOVE, 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. AtransferModethat has the valueNONEindicates that no data was transferred during the drag and drop gesture. Positional data for theDragEventis invalid. Valid positional data for theDragEventis presented in theonDragDroppedevent handler.
 
- 
onDragDonePropertyDefines a function to be called when thisSceneis a drag and drop gesture source after its data has been dropped on a drop target. ThetransferModeof the event shows what just happened at the drop target. IftransferModehas the valueMOVE, 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. AtransferModethat has the valueNONEindicates that no data was transferred during the drag and drop gesture. Positional data for theDragEventis invalid. Valid positional data for theDragEventis presented in theonDragDroppedevent handler.- See Also:
- getOnDragDone(),- setOnDragDone(EventHandler)
 
- 
startDragAndDropConfirms a potential drag and drop gesture that is recognized over thisScene. Can be called only from a DRAG_DETECTED event handler. The returnedDragboardis used to transfer data during the drag and drop gesture. Placing thisScene's data on theDragboardalso identifies thisSceneas the source of the drag and drop gesture. More detail about drag and drop gestures is described in the overivew ofDragEvent.- Parameters:
- transferModes- The supported- TransferMode(s) of this- Node
- Returns:
- A Dragboardto place thisScene's data on
- Throws:
- IllegalStateException- if drag and drop cannot be started at this moment (it's called outside of- DRAG_DETECTEDevent handling).
- See Also:
- DragEvent
 
- 
startFullDragpublic void startFullDrag()Starts a full press-drag-release gesture with this scene as gesture source. This method can be called only from aDRAG_DETECTEDmouse event handler. More detail about dragging gestures can be found in the overview ofMouseEventandMouseDragEvent.- Throws:
- IllegalStateException- if the full press-drag-release gesture cannot be started at this moment (it's called outside of- DRAG_DETECTEDevent handling).
- Since:
- JavaFX 2.1
- See Also:
- MouseEvent,- MouseDragEvent
 
- 
setOnKeyPressedSets the value of the property onKeyPressed.- Property description:
- Defines a function to be called when some Nodeof thisScenehas 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.
 
- 
getOnKeyPressedGets the value of the property onKeyPressed.- Property description:
- Defines a function to be called when some Nodeof thisScenehas 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.
 
- 
onKeyPressedPropertyDefines a function to be called when someNodeof thisScenehas 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.- See Also:
- getOnKeyPressed(),- setOnKeyPressed(EventHandler)
 
- 
setOnKeyReleasedSets the value of the property onKeyReleased.- Property description:
- Defines a function to be called when some Nodeof thisScenehas 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.
 
- 
getOnKeyReleasedGets the value of the property onKeyReleased.- Property description:
- Defines a function to be called when some Nodeof thisScenehas 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.
 
- 
onKeyReleasedPropertyDefines a function to be called when someNodeof thisScenehas 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.- See Also:
- getOnKeyReleased(),- setOnKeyReleased(EventHandler)
 
- 
setOnKeyTypedSets the value of the property onKeyTyped.- Property description:
- Defines a function to be called when some Nodeof thisScenehas 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.
 
- 
getOnKeyTypedGets the value of the property onKeyTyped.- Property description:
- Defines a function to be called when some Nodeof thisScenehas 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.
 
- 
onKeyTypedPropertyDefines a function to be called when someNodeof thisScenehas 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.- See Also:
- getOnKeyTyped(),- setOnKeyTyped(EventHandler)
 
- 
setOnInputMethodTextChangedSets the value of the property onInputMethodTextChanged.- Property description:
- Defines a function to be called when this Nodehas input focus and the input method text has changed. If this function is not defined in thisNode, then it receives the result string of the input method composition as a series ofonKeyTypedfunction calls.When the Nodeloses the input focus, the JavaFX runtime automatically commits the existing composed text if any.
 
- 
getOnInputMethodTextChangedGets the value of the property onInputMethodTextChanged.- Property description:
- Defines a function to be called when this Nodehas input focus and the input method text has changed. If this function is not defined in thisNode, then it receives the result string of the input method composition as a series ofonKeyTypedfunction calls.When the Nodeloses the input focus, the JavaFX runtime automatically commits the existing composed text if any.
 
- 
onInputMethodTextChangedPropertypublic final ObjectProperty<EventHandler<? super InputMethodEvent>> onInputMethodTextChangedProperty()Defines a function to be called when thisNodehas input focus and the input method text has changed. If this function is not defined in thisNode, then it receives the result string of the input method composition as a series ofonKeyTypedfunction calls.When the Nodeloses the input focus, the JavaFX runtime automatically commits the existing composed text if any.
- 
getPropertiesReturns an observable map of properties on this node for use primarily by application developers.- Returns:
- an observable map of properties on this node for use primarily by application developers
- Since:
- JavaFX 8u40
 
- 
hasPropertiespublic boolean hasProperties()Tests if Scene has properties.- Returns:
- true if node has properties.
- Since:
- JavaFX 8u40
 
- 
setUserDataConvenience method for setting a single Object property that can be retrieved at a later date. This is functionally equivalent to calling the getProperties().put(Object key, Object value) method. This can later be retrieved by callinggetUserData().- Parameters:
- value- The value to be stored - this can later be retrieved by calling- getUserData().
- Since:
- JavaFX 8u40
 
- 
getUserDataReturns a previously set Object property, or null if no such property has been set using thesetUserData(java.lang.Object)method.- Returns:
- The Object that was previously set, or null if no property has been set or if null was set.
- Since:
- JavaFX 8u40
 
- 
setNodeOrientationSets the value of the property nodeOrientation.- Property description:
- Property holding NodeOrientation.
 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. 
- Since:
- JavaFX 8.0
 
- 
getNodeOrientationGets the value of the property nodeOrientation.- Property description:
- Property holding NodeOrientation.
 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. 
- Since:
- JavaFX 8.0
 
- 
nodeOrientationPropertyProperty holding NodeOrientation.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. - Since:
- JavaFX 8.0
- See Also:
- getNodeOrientation(),- setNodeOrientation(NodeOrientation)
 
- 
getEffectiveNodeOrientationGets the value of the property effectiveNodeOrientation.- Property description:
- The effective node orientation of a scene resolves the inheritance of node orientation, returning either left-to-right or right-to-left.
- Since:
- JavaFX 8.0
 
- 
effectiveNodeOrientationPropertyThe effective node orientation of a scene resolves the inheritance of node orientation, returning either left-to-right or right-to-left.- Since:
- JavaFX 8.0
- See Also:
- getEffectiveNodeOrientation()
 
 
-