Class Scene
- All Implemented Interfaces:
- 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 SummaryPropertiesTypePropertyDescriptionfinal ObjectProperty<Camera> Specifies the type of camera use for rendering thisScene.final ObjectProperty<Cursor> Defines the mouse cursor for thisScene.The effective node orientation of a scene resolves the inheritance of node orientation, returning either left-to-right or right-to-left.final ObjectProperty<EventDispatcher> Specifies the event dispatcher for this scene.final ObjectProperty<Paint> Defines the background fill of thisScene.final ReadOnlyObjectProperty<Node> The scene's current focus owner node.final ReadOnlyDoublePropertyThe height of thisScenefinal ObjectProperty<NodeOrientation> Node orientation describes the flow of visual data within a node.final ObjectProperty<EventHandler<? super ContextMenuEvent>> Defines a function to be called when a mouse button has been clicked (pressed and released) on thisScene.final ObjectProperty<EventHandler<? super MouseEvent>> Defines a function to be called when drag gesture has been detected.final ObjectProperty<EventHandler<? super DragEvent>> Defines a function to be called when thisSceneis a drag and drop gesture source after its data has been dropped on a drop target.final ObjectProperty<EventHandler<? super DragEvent>> Defines a function to be called when the mouse button is released on thisSceneduring drag and drop gesture.final ObjectProperty<EventHandler<? super DragEvent>> Defines a function to be called when drag gesture enters thisScene.final ObjectProperty<EventHandler<? super DragEvent>> Defines a function to be called when drag gesture exits thisScene.final ObjectProperty<EventHandler<? super DragEvent>> Defines a function to be called when drag gesture progresses within thisScene.final ObjectProperty<EventHandler<? super InputMethodEvent>> Defines a function to be called when thisNodehas input focus and the input method text has changed.final ObjectProperty<EventHandler<? super KeyEvent>> Defines a function to be called when someNodeof thisScenehas input focus and a key has been pressed.final ObjectProperty<EventHandler<? super KeyEvent>> Defines a function to be called when someNodeof thisScenehas input focus and a key has been released.final ObjectProperty<EventHandler<? super KeyEvent>> Defines a function to be called when someNodeof thisScenehas input focus and a key has been typed.final ObjectProperty<EventHandler<? super MouseEvent>> Defines a function to be called when a mouse button has been clicked (pressed and released) on thisScene.final ObjectProperty<EventHandler<? super MouseDragEvent>> Defines a function to be called when a full press-drag-release gesture enters thisScene.final ObjectProperty<EventHandler<? super MouseDragEvent>> Defines a function to be called when a full press-drag-release gesture exits thisScene.final ObjectProperty<EventHandler<? super MouseEvent>> Defines a function to be called when a mouse button is pressed on thisSceneand then dragged.final ObjectProperty<EventHandler<? super MouseDragEvent>> Defines a function to be called when a full press-drag-release gesture progresses within thisScene.final ObjectProperty<EventHandler<? super MouseDragEvent>> Defines a function to be called when a full press-drag-release gesture ends within thisScene.final ObjectProperty<EventHandler<? super MouseEvent>> Defines a function to be called when the mouse enters thisScene.final ObjectProperty<EventHandler<? super MouseEvent>> Defines a function to be called when the mouse exits thisScene.final ObjectProperty<EventHandler<? super MouseEvent>> Defines a function to be called when mouse cursor moves within thisScenebut no buttons have been pushed.final ObjectProperty<EventHandler<? super MouseEvent>> Defines a function to be called when a mouse button has been pressed on thisScene.final ObjectProperty<EventHandler<? super MouseEvent>> Defines a function to be called when a mouse button has been released on thisScene.final ObjectProperty<EventHandler<? super RotateEvent>> Defines a function to be called when user performs a rotating action.final ObjectProperty<EventHandler<? super RotateEvent>> Defines a function to be called when a rotating gesture ends.final ObjectProperty<EventHandler<? super RotateEvent>> Defines a function to be called when a rotating gesture is detected.final ObjectProperty<EventHandler<? super ScrollEvent>> Defines a function to be called when a scrolling gesture ends.final ObjectProperty<EventHandler<? super ScrollEvent>> Defines a function to be called when user performs a scrolling action.final ObjectProperty<EventHandler<? super ScrollEvent>> Defines a function to be called when a scrolling gesture is detected.final ObjectProperty<EventHandler<? super SwipeEvent>> Defines a function to be called when an downward swipe gesture happens in this scene.final ObjectProperty<EventHandler<? super SwipeEvent>> Defines a function to be called when an leftward swipe gesture happens in this scene.final ObjectProperty<EventHandler<? super SwipeEvent>> Defines a function to be called when an rightward swipe gesture happens in this scene.final ObjectProperty<EventHandler<? super SwipeEvent>> Defines a function to be called when an upward swipe gesture happens in this scene.final ObjectProperty<EventHandler<? super TouchEvent>> Defines a function to be called when a touch point is moved.final ObjectProperty<EventHandler<? super TouchEvent>> Defines a function to be called when a new touch point is pressed.final ObjectProperty<EventHandler<? super TouchEvent>> Defines a function to be called when a new touch point is pressed.final ObjectProperty<EventHandler<? super TouchEvent>> Defines a function to be called when a touch point stays pressed and still.final ObjectProperty<EventHandler<? super ZoomEvent>> Defines a function to be called when a zooming gesture ends.final ObjectProperty<EventHandler<? super ZoomEvent>> Defines a function to be called when user performs a zooming action.final ObjectProperty<EventHandler<? super ZoomEvent>> Defines a function to be called when a zooming gesture is detected.final ObjectProperty<Parent> Defines the rootNodeof the scene graph.final ObjectProperty<String> Gets the userAgentStylesheet property.final ReadOnlyDoublePropertyThe width of thisScenefinal ReadOnlyObjectProperty<Window> TheWindowfor thisScenefinal ReadOnlyDoublePropertyThe horizontal location of thisSceneon theWindow.final ReadOnlyDoublePropertyThe vertical location of thisSceneon theWindow.
- 
Constructor SummaryConstructorsConstructorDescriptionCreates a Scene for a specific root Node.Creates a Scene for a specific root Node with a specific size.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.Creates a Scene for a specific root Node with a specific size and fill.Creates a Scene for a specific root Node with a fill.
- 
Method SummaryModifier and TypeMethodDescriptionfinal <T extends Event>
 voidaddEventFilter(EventType<T> eventType, EventHandler<? super T> eventFilter) Registers an event filter for this target.final <T extends Event>
 voidaddEventHandler(EventType<T> eventType, EventHandler<? super T> eventHandler) Registers an event handler for this target.voidRegisters the specified mnemonic.final voidAdds a new scene post layout pulse listener to this scene.final voidAdds a new scene pre layout pulse listener to this scene.Construct an event dispatch chain for this target.final ObjectProperty<Camera> Specifies the type of camera use for rendering thisScene.final ObjectProperty<Cursor> Defines the mouse cursor for thisScene.The effective node orientation of a scene resolves the inheritance of node orientation, returning either left-to-right or right-to-left.final ObjectProperty<EventDispatcher> Specifies the event dispatcher for this scene.final ObjectProperty<Paint> Defines the background fill of thisScene.final ReadOnlyObjectProperty<Node> The scene's current focus owner node.Gets the list of accelerators for thisScene.final SceneAntialiasingReturn the definedSceneAntialiasingfor thisScene.final CameraGets the value of thecameraproperty.final CursorGets the value of thecursorproperty.final NodeOrientationGets the value of theeffectiveNodeOrientationproperty.final EventDispatcherGets the value of theeventDispatcherproperty.final PaintgetFill()Gets the value of thefillproperty.final NodeGets the value of thefocusOwnerproperty.final doubleGets the value of theheightproperty.Gets the list of mnemonics for thisScene.final NodeOrientationGets the value of thenodeOrientationproperty.final EventHandler<? super ContextMenuEvent> Gets the value of theonContextMenuRequestedproperty.final EventHandler<? super MouseEvent> Gets the value of theonDragDetectedproperty.final EventHandler<? super DragEvent> Gets the value of theonDragDoneproperty.final EventHandler<? super DragEvent> Gets the value of theonDragDroppedproperty.final EventHandler<? super DragEvent> Gets the value of theonDragEnteredproperty.final EventHandler<? super DragEvent> Gets the value of theonDragExitedproperty.final EventHandler<? super DragEvent> Gets the value of theonDragOverproperty.final EventHandler<? super InputMethodEvent> Gets the value of theonInputMethodTextChangedproperty.final EventHandler<? super KeyEvent> Gets the value of theonKeyPressedproperty.final EventHandler<? super KeyEvent> Gets the value of theonKeyReleasedproperty.final EventHandler<? super KeyEvent> Gets the value of theonKeyTypedproperty.final EventHandler<? super MouseEvent> Gets the value of theonMouseClickedproperty.final EventHandler<? super MouseDragEvent> Gets the value of theonMouseDragEnteredproperty.final EventHandler<? super MouseDragEvent> Gets the value of theonMouseDragExitedproperty.final EventHandler<? super MouseEvent> Gets the value of theonMouseDraggedproperty.final EventHandler<? super MouseDragEvent> Gets the value of theonMouseDragOverproperty.final EventHandler<? super MouseDragEvent> Gets the value of theonMouseDragReleasedproperty.final EventHandler<? super MouseEvent> Gets the value of theonMouseEnteredproperty.final EventHandler<? super MouseEvent> Gets the value of theonMouseExitedproperty.final EventHandler<? super MouseEvent> Gets the value of theonMouseMovedproperty.final EventHandler<? super MouseEvent> Gets the value of theonMousePressedproperty.final EventHandler<? super MouseEvent> Gets the value of theonMouseReleasedproperty.final EventHandler<? super RotateEvent> Gets the value of theonRotateproperty.final EventHandler<? super RotateEvent> Gets the value of theonRotationFinishedproperty.final EventHandler<? super RotateEvent> Gets the value of theonRotationStartedproperty.final EventHandler<? super ScrollEvent> Gets the value of theonScrollproperty.final EventHandler<? super ScrollEvent> Gets the value of theonScrollFinishedproperty.final EventHandler<? super ScrollEvent> Gets the value of theonScrollStartedproperty.final EventHandler<? super SwipeEvent> Gets the value of theonSwipeDownproperty.final EventHandler<? super SwipeEvent> Gets the value of theonSwipeLeftproperty.final EventHandler<? super SwipeEvent> Gets the value of theonSwipeRightproperty.final EventHandler<? super SwipeEvent> Gets the value of theonSwipeUpproperty.final EventHandler<? super TouchEvent> Gets the value of theonTouchMovedproperty.final EventHandler<? super TouchEvent> Gets the value of theonTouchPressedproperty.final EventHandler<? super TouchEvent> Gets the value of theonTouchReleasedproperty.final EventHandler<? super TouchEvent> Gets the value of theonTouchStationaryproperty.final EventHandler<? super ZoomEvent> Gets the value of theonZoomproperty.final EventHandler<? super ZoomEvent> Gets the value of theonZoomFinishedproperty.final EventHandler<? super ZoomEvent> Gets the value of theonZoomStartedproperty.final ObservableMap<Object, Object> Returns an observable map of properties on this node for use primarily by application developers.final ParentgetRoot()Gets the value of therootproperty.final ObservableList<String> Gets an observable list of string URLs linking to the stylesheets to use with this scene's contents.final StringGet the URL of the user-agent stylesheet that will be used by this Scene.Returns a previously set Object property, or null if no such property has been set using thesetUserData(java.lang.Object)method.final doublegetWidth()Gets the value of thewidthproperty.final WindowGets the value of thewindowproperty.final doublegetX()Gets the value of thexproperty.final doublegetY()Gets the value of theyproperty.booleanTests if Scene has properties.final ReadOnlyDoublePropertyThe height of thisScenefinal booleanRetrieves the depth buffer attribute for this scene.Looks for any node within the scene graph based on the specified CSS selector.final ObjectProperty<NodeOrientation> Node orientation describes the flow of visual data within a node.final ObjectProperty<EventHandler<? super ContextMenuEvent>> Defines a function to be called when a mouse button has been clicked (pressed and released) on thisScene.final ObjectProperty<EventHandler<? super MouseEvent>> Defines a function to be called when drag gesture has been detected.final ObjectProperty<EventHandler<? super DragEvent>> Defines a function to be called when thisSceneis a drag and drop gesture source after its data has been dropped on a drop target.final ObjectProperty<EventHandler<? super DragEvent>> Defines a function to be called when the mouse button is released on thisSceneduring drag and drop gesture.final ObjectProperty<EventHandler<? super DragEvent>> Defines a function to be called when drag gesture enters thisScene.final ObjectProperty<EventHandler<? super DragEvent>> Defines a function to be called when drag gesture exits thisScene.final ObjectProperty<EventHandler<? super DragEvent>> Defines a function to be called when drag gesture progresses within thisScene.final ObjectProperty<EventHandler<? super InputMethodEvent>> Defines a function to be called when thisNodehas input focus and the input method text has changed.final ObjectProperty<EventHandler<? super KeyEvent>> Defines a function to be called when someNodeof thisScenehas input focus and a key has been pressed.final ObjectProperty<EventHandler<? super KeyEvent>> Defines a function to be called when someNodeof thisScenehas input focus and a key has been released.final ObjectProperty<EventHandler<? super KeyEvent>> Defines a function to be called when someNodeof thisScenehas input focus and a key has been typed.final ObjectProperty<EventHandler<? super MouseEvent>> Defines a function to be called when a mouse button has been clicked (pressed and released) on thisScene.final ObjectProperty<EventHandler<? super MouseDragEvent>> Defines a function to be called when a full press-drag-release gesture enters thisScene.final ObjectProperty<EventHandler<? super MouseDragEvent>> Defines a function to be called when a full press-drag-release gesture exits thisScene.final ObjectProperty<EventHandler<? super MouseEvent>> Defines a function to be called when a mouse button is pressed on thisSceneand then dragged.final ObjectProperty<EventHandler<? super MouseDragEvent>> Defines a function to be called when a full press-drag-release gesture progresses within thisScene.final ObjectProperty<EventHandler<? super MouseDragEvent>> Defines a function to be called when a full press-drag-release gesture ends within thisScene.final ObjectProperty<EventHandler<? super MouseEvent>> Defines a function to be called when the mouse enters thisScene.final ObjectProperty<EventHandler<? super MouseEvent>> Defines a function to be called when the mouse exits thisScene.final ObjectProperty<EventHandler<? super MouseEvent>> Defines a function to be called when mouse cursor moves within thisScenebut no buttons have been pushed.final ObjectProperty<EventHandler<? super MouseEvent>> Defines a function to be called when a mouse button has been pressed on thisScene.final ObjectProperty<EventHandler<? super MouseEvent>> Defines a function to be called when a mouse button has been released on thisScene.final ObjectProperty<EventHandler<? super RotateEvent>> Defines a function to be called when user performs a rotating action.final ObjectProperty<EventHandler<? super RotateEvent>> Defines a function to be called when a rotating gesture ends.final ObjectProperty<EventHandler<? super RotateEvent>> Defines a function to be called when a rotating gesture is detected.final ObjectProperty<EventHandler<? super ScrollEvent>> Defines a function to be called when a scrolling gesture ends.final ObjectProperty<EventHandler<? super ScrollEvent>> Defines a function to be called when user performs a scrolling action.final ObjectProperty<EventHandler<? super ScrollEvent>> Defines a function to be called when a scrolling gesture is detected.final ObjectProperty<EventHandler<? super SwipeEvent>> Defines a function to be called when an downward swipe gesture happens in this scene.final ObjectProperty<EventHandler<? super SwipeEvent>> Defines a function to be called when an leftward swipe gesture happens in this scene.final ObjectProperty<EventHandler<? super SwipeEvent>> Defines a function to be called when an rightward swipe gesture happens in this scene.final ObjectProperty<EventHandler<? super SwipeEvent>> Defines a function to be called when an upward swipe gesture happens in this scene.final ObjectProperty<EventHandler<? super TouchEvent>> Defines a function to be called when a touch point is moved.final ObjectProperty<EventHandler<? super TouchEvent>> Defines a function to be called when a new touch point is pressed.final ObjectProperty<EventHandler<? super TouchEvent>> Defines a function to be called when a new touch point is pressed.final ObjectProperty<EventHandler<? super TouchEvent>> Defines a function to be called when a touch point stays pressed and still.final ObjectProperty<EventHandler<? super ZoomEvent>> Defines a function to be called when a zooming gesture ends.final ObjectProperty<EventHandler<? super ZoomEvent>> Defines a function to be called when user performs a zooming action.final ObjectProperty<EventHandler<? super ZoomEvent>> Defines a function to be called when a zooming gesture is detected.final <T extends Event>
 voidremoveEventFilter(EventType<T> eventType, EventHandler<? super T> eventFilter) Unregisters a previously registered event filter from this target.final <T extends Event>
 voidremoveEventHandler(EventType<T> eventType, EventHandler<? super T> eventHandler) Unregisters a previously registered event handler from this target.voidUnregisters the specified mnemonic.final voidRemoves a previously registered scene post layout pulse listener from listening to pulses in this scene.final voidRemoves a previously registered scene pre layout pulse listener from listening to pulses in this scene.final ObjectProperty<Parent> Defines the rootNodeof the scene graph.final voidSets the value of thecameraproperty.final voidSets the value of thecursorproperty.final voidSets the value of theeventDispatcherproperty.protected final <T extends Event>
 voidsetEventHandler(EventType<T> eventType, EventHandler<? super T> eventHandler) Sets the handler to use for this event type.final voidSets the value of thefillproperty.final voidsetNodeOrientation(NodeOrientation orientation) Sets the value of thenodeOrientationproperty.final voidsetOnContextMenuRequested(EventHandler<? super ContextMenuEvent> value) Sets the value of theonContextMenuRequestedproperty.final voidsetOnDragDetected(EventHandler<? super MouseEvent> value) Sets the value of theonDragDetectedproperty.final voidsetOnDragDone(EventHandler<? super DragEvent> value) Sets the value of theonDragDoneproperty.final voidsetOnDragDropped(EventHandler<? super DragEvent> value) Sets the value of theonDragDroppedproperty.final voidsetOnDragEntered(EventHandler<? super DragEvent> value) Sets the value of theonDragEnteredproperty.final voidsetOnDragExited(EventHandler<? super DragEvent> value) Sets the value of theonDragExitedproperty.final voidsetOnDragOver(EventHandler<? super DragEvent> value) Sets the value of theonDragOverproperty.final voidsetOnInputMethodTextChanged(EventHandler<? super InputMethodEvent> value) Sets the value of theonInputMethodTextChangedproperty.final voidsetOnKeyPressed(EventHandler<? super KeyEvent> value) Sets the value of theonKeyPressedproperty.final voidsetOnKeyReleased(EventHandler<? super KeyEvent> value) Sets the value of theonKeyReleasedproperty.final voidsetOnKeyTyped(EventHandler<? super KeyEvent> value) Sets the value of theonKeyTypedproperty.final voidsetOnMouseClicked(EventHandler<? super MouseEvent> value) Sets the value of theonMouseClickedproperty.final voidsetOnMouseDragEntered(EventHandler<? super MouseDragEvent> value) Sets the value of theonMouseDragEnteredproperty.final voidsetOnMouseDragExited(EventHandler<? super MouseDragEvent> value) Sets the value of theonMouseDragExitedproperty.final voidsetOnMouseDragged(EventHandler<? super MouseEvent> value) Sets the value of theonMouseDraggedproperty.final voidsetOnMouseDragOver(EventHandler<? super MouseDragEvent> value) Sets the value of theonMouseDragOverproperty.final voidsetOnMouseDragReleased(EventHandler<? super MouseDragEvent> value) Sets the value of theonMouseDragReleasedproperty.final voidsetOnMouseEntered(EventHandler<? super MouseEvent> value) Sets the value of theonMouseEnteredproperty.final voidsetOnMouseExited(EventHandler<? super MouseEvent> value) Sets the value of theonMouseExitedproperty.final voidsetOnMouseMoved(EventHandler<? super MouseEvent> value) Sets the value of theonMouseMovedproperty.final voidsetOnMousePressed(EventHandler<? super MouseEvent> value) Sets the value of theonMousePressedproperty.final voidsetOnMouseReleased(EventHandler<? super MouseEvent> value) Sets the value of theonMouseReleasedproperty.final voidsetOnRotate(EventHandler<? super RotateEvent> value) Sets the value of theonRotateproperty.final voidsetOnRotationFinished(EventHandler<? super RotateEvent> value) Sets the value of theonRotationFinishedproperty.final voidsetOnRotationStarted(EventHandler<? super RotateEvent> value) Sets the value of theonRotationStartedproperty.final voidsetOnScroll(EventHandler<? super ScrollEvent> value) Sets the value of theonScrollproperty.final voidsetOnScrollFinished(EventHandler<? super ScrollEvent> value) Sets the value of theonScrollFinishedproperty.final voidsetOnScrollStarted(EventHandler<? super ScrollEvent> value) Sets the value of theonScrollStartedproperty.final voidsetOnSwipeDown(EventHandler<? super SwipeEvent> value) Sets the value of theonSwipeDownproperty.final voidsetOnSwipeLeft(EventHandler<? super SwipeEvent> value) Sets the value of theonSwipeLeftproperty.final voidsetOnSwipeRight(EventHandler<? super SwipeEvent> value) Sets the value of theonSwipeRightproperty.final voidsetOnSwipeUp(EventHandler<? super SwipeEvent> value) Sets the value of theonSwipeUpproperty.final voidsetOnTouchMoved(EventHandler<? super TouchEvent> value) Sets the value of theonTouchMovedproperty.final voidsetOnTouchPressed(EventHandler<? super TouchEvent> value) Sets the value of theonTouchPressedproperty.final voidsetOnTouchReleased(EventHandler<? super TouchEvent> value) Sets the value of theonTouchReleasedproperty.final voidsetOnTouchStationary(EventHandler<? super TouchEvent> value) Sets the value of theonTouchStationaryproperty.final voidsetOnZoom(EventHandler<? super ZoomEvent> value) Sets the value of theonZoomproperty.final voidsetOnZoomFinished(EventHandler<? super ZoomEvent> value) Sets the value of theonZoomFinishedproperty.final voidsetOnZoomStarted(EventHandler<? super ZoomEvent> value) Sets the value of theonZoomStartedproperty.final voidSets the value of therootproperty.final voidSet 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.snapshot(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.startDragAndDrop(TransferMode... transferModes) Confirms a potential drag and drop gesture that is recognized over thisScene.voidStarts a full press-drag-release gesture with this scene as gesture source.final ObjectProperty<String> Gets the userAgentStylesheet property.final ReadOnlyDoublePropertyThe width of thisScenefinal ReadOnlyObjectProperty<Window> TheWindowfor thisScenefinal ReadOnlyDoublePropertyThe horizontal location of thisSceneon theWindow.final ReadOnlyDoublePropertyThe vertical location of thisSceneon theWindow.
- 
Property Details- 
window
- 
xThe horizontal location of thisSceneon theWindow.- See Also:
 
- 
yThe vertical location of thisSceneon theWindow.- See Also:
 
- 
width
- 
height
- 
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:
 
- 
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:
 
- 
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.The :rootpseudo-class matches the root node.Scene doesn't accept null root. - See Also:
 
- 
cursorDefines the mouse cursor for thisScene.- See Also:
 
- 
userAgentStylesheetGets the userAgentStylesheet property.- Since:
- JavaFX 8u20
- See Also:
 
- 
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:
 
- 
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.- See Also:
 
- 
onContextMenuRequestedDefines a function to be called when a mouse button has been clicked (pressed and released) on thisScene.- Since:
- JavaFX 2.1
- See Also:
 
- 
onMouseClickedDefines a function to be called when a mouse button has been clicked (pressed and released) on thisScene.- See Also:
 
- 
onMouseDraggedDefines a function to be called when a mouse button is pressed on thisSceneand then dragged.- See Also:
 
- 
onMouseEnteredDefines a function to be called when the mouse enters thisScene.- See Also:
 
- 
onMouseExitedDefines a function to be called when the mouse exits thisScene.- See Also:
 
- 
onMouseMovedDefines a function to be called when mouse cursor moves within thisScenebut no buttons have been pushed.- See Also:
 
- 
onMousePressedDefines a function to be called when a mouse button has been pressed on thisScene.- See Also:
 
- 
onMouseReleasedDefines a function to be called when a mouse button has been released on thisScene.- See Also:
 
- 
onDragDetectedDefines a function to be called when drag gesture has been detected. This is the right place to start drag and drop operation.- See Also:
 
- 
onMouseDragOverDefines a function to be called when a full press-drag-release gesture progresses within thisScene.- Since:
- JavaFX 2.1
- See Also:
 
- 
onMouseDragReleasedDefines a function to be called when a full press-drag-release gesture ends within thisScene.- Since:
- JavaFX 2.1
- See Also:
 
- 
onMouseDragEnteredDefines a function to be called when a full press-drag-release gesture enters thisScene.- Since:
- JavaFX 2.1
- See Also:
 
- 
onMouseDragExitedDefines a function to be called when a full press-drag-release gesture exits thisScene.- Since:
- JavaFX 2.1
- See Also:
 
- 
onScrollStartedDefines a function to be called when a scrolling gesture is detected.- Since:
- JavaFX 2.2
- See Also:
 
- 
onScrollDefines a function to be called when user performs a scrolling action.- See Also:
 
- 
onScrollFinishedDefines a function to be called when a scrolling gesture ends.- Since:
- JavaFX 2.2
- See Also:
 
- 
onRotationStartedDefines a function to be called when a rotating gesture is detected.- Since:
- JavaFX 2.2
- See Also:
 
- 
onRotateDefines a function to be called when user performs a rotating action.- Since:
- JavaFX 2.2
- See Also:
 
- 
onRotationFinishedDefines a function to be called when a rotating gesture ends.- Since:
- JavaFX 2.2
- See Also:
 
- 
onZoomStartedDefines a function to be called when a zooming gesture is detected.- Since:
- JavaFX 2.2
- See Also:
 
- 
onZoomDefines a function to be called when user performs a zooming action.- Since:
- JavaFX 2.2
- See Also:
 
- 
onZoomFinishedDefines a function to be called when a zooming gesture ends.- Since:
- JavaFX 2.2
- See Also:
 
- 
onSwipeUpDefines a function to be called when an upward swipe gesture happens in this scene.- Since:
- JavaFX 2.2
- See Also:
 
- 
onSwipeDownDefines a function to be called when an downward swipe gesture happens in this scene.- Since:
- JavaFX 2.2
- See Also:
 
- 
onSwipeLeftDefines a function to be called when an leftward swipe gesture happens in this scene.- Since:
- JavaFX 2.2
- See Also:
 
- 
onSwipeRightDefines a function to be called when an rightward swipe gesture happens in this scene.- Since:
- JavaFX 2.2
- See Also:
 
- 
onTouchPressedDefines a function to be called when a new touch point is pressed.- Since:
- JavaFX 2.2
- See Also:
 
- 
onTouchMovedDefines a function to be called when a touch point is moved.- Since:
- JavaFX 2.2
- See Also:
 
- 
onTouchReleasedDefines a function to be called when a new touch point is pressed.- Since:
- JavaFX 2.2
- See Also:
 
- 
onTouchStationaryDefines a function to be called when a touch point stays pressed and still.- Since:
- JavaFX 2.2
- See Also:
 
- 
onDragEnteredDefines a function to be called when drag gesture enters thisScene.- See Also:
 
- 
onDragExitedDefines a function to be called when drag gesture exits thisScene.- See Also:
 
- 
onDragOverDefines a function to be called when drag gesture progresses within thisScene.- See Also:
 
- 
onDragDropped
- 
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:
 
- 
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:
 
- 
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:
 
- 
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:
 
- 
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.- See Also:
 
- 
nodeOrientationNode 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.- Default value:
- if the system property javafx.scene.nodeOrientation.RTListrue,NodeOrientation.RIGHT_TO_LEFT, otherwiseNodeOrientation.INHERIT
- Since:
- JavaFX 8.0
- See Also:
 
- 
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:
 
 
- 
- 
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:
 
- 
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:
 
 
- 
- 
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 thewindowproperty.- Property description:
- The Windowfor thisScene
- Returns:
- the value of the windowproperty
- See Also:
 
- 
windowPropertyTheWindowfor thisScene- Returns:
- the windowproperty
- See Also:
 
- 
getXpublic final double getX()Gets the value of thexproperty.- Property description:
- The horizontal location of this Sceneon theWindow.
- Returns:
- the value of the xproperty
- See Also:
 
- 
xPropertyThe horizontal location of thisSceneon theWindow.- Returns:
- the xproperty
- See Also:
 
- 
getYpublic final double getY()Gets the value of theyproperty.- Property description:
- The vertical location of this Sceneon theWindow.
- Returns:
- the value of the yproperty
- See Also:
 
- 
yPropertyThe vertical location of thisSceneon theWindow.- Returns:
- the yproperty
- See Also:
 
- 
getWidthpublic final double getWidth()Gets the value of thewidthproperty.- Property description:
- The width of this Scene
- Returns:
- the value of the widthproperty
- See Also:
 
- 
widthPropertyThe width of thisScene- Returns:
- the widthproperty
- See Also:
 
- 
getHeightpublic final double getHeight()Gets the value of theheightproperty.- Property description:
- The height of this Scene
- Returns:
- the value of the heightproperty
- See Also:
 
- 
heightPropertyThe height of thisScene- Returns:
- the heightproperty
- See Also:
 
- 
setCameraSets the value of thecameraproperty.- 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
- Parameters:
- value- the value for the- cameraproperty
- See Also:
 
- 
getCameraGets the value of thecameraproperty.- 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
- Returns:
- the value of the cameraproperty
- See Also:
 
- 
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
- Returns:
- the cameraproperty
- See Also:
 
- 
setFillSets the value of thefillproperty.- 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
- Parameters:
- value- the value for the- fillproperty
- See Also:
 
- 
getFillGets the value of thefillproperty.- 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
- Returns:
- the value of the fillproperty
- See Also:
 
- 
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
- Returns:
- the fillproperty
- See Also:
 
- 
setRootSets the value of therootproperty.- 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.The :rootpseudo-class matches the root node.Scene doesn't accept null root. 
- Parameters:
- value- the value for the- rootproperty
- See Also:
 
- 
getRootGets the value of therootproperty.- 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.The :rootpseudo-class matches the root node.Scene doesn't accept null root. 
- Returns:
- the value of the rootproperty
- See Also:
 
- 
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.The :rootpseudo-class matches the root node.Scene doesn't accept null root. - Returns:
- the rootproperty
- See Also:
 
- 
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 thecursorproperty.- Property description:
- Defines the mouse cursor for this Scene.
- Parameters:
- value- the value for the- cursorproperty
- See Also:
 
- 
getCursorGets the value of thecursorproperty.- Property description:
- Defines the mouse cursor for this Scene.
- Returns:
- the value of the cursorproperty
- See Also:
 
- 
cursorPropertyDefines the mouse cursor for thisScene.- Returns:
- the cursorproperty
- See Also:
 
- 
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
 
- 
userAgentStylesheetPropertyGets the userAgentStylesheet property.- Returns:
- the userAgentStylesheet property
- Since:
- JavaFX 8u20
- See Also:
 
- 
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.
 
- 
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).- Returns:
- the focusOwnerproperty
- Since:
- JavaFX 2.2
- See Also:
 
- 
getFocusOwnerGets the value of thefocusOwnerproperty.- 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).
- Returns:
- the value of the focusOwnerproperty
- Since:
- JavaFX 2.2
- See Also:
 
- 
setEventDispatcherSets the value of theeventDispatcherproperty.- 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.
- Parameters:
- value- the value for the- eventDispatcherproperty
- See Also:
 
- 
getEventDispatcherGets the value of theeventDispatcherproperty.- 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.
- Returns:
- the value of the eventDispatcherproperty
- See Also:
 
- 
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.- Returns:
- the eventDispatcherproperty
- See Also:
 
- 
addEventHandlerpublic final <T extends Event> void addEventHandler(EventType<T> eventType, EventHandler<? super T> eventHandler) Description copied from interface:EventTargetRegisters an event handler for this target.The handler is called when the target receives an Eventof the specified type during the bubbling phase of event delivery.- Specified by:
- addEventHandlerin interface- EventTarget
- Type Parameters:
- T- the event class of the handler
- Parameters:
- eventType- the type of the events received by the handler
- eventHandler- the event handler
 
- 
removeEventHandlerpublic final <T extends Event> void removeEventHandler(EventType<T> eventType, EventHandler<? super T> eventHandler) Description copied from interface:EventTargetUnregisters a previously registered event handler from this target.Since it is possible to register a single EventHandlerinstance for different event types, the caller needs to specify the event type from which the handler should be unregistered.- Specified by:
- removeEventHandlerin interface- EventTarget
- Type Parameters:
- T- the event class of the handler
- Parameters:
- eventType- the event type from which to unregister
- eventHandler- the event handler
 
- 
addEventFilterpublic final <T extends Event> void addEventFilter(EventType<T> eventType, EventHandler<? super T> eventFilter) Description copied from interface:EventTargetRegisters an event filter for this target.The filter is called when the target receives an Eventof the specified type during the capturing phase of event delivery.- Specified by:
- addEventFilterin interface- EventTarget
- Type Parameters:
- T- the event class of the filter
- Parameters:
- eventType- the type of the events received by the filter
- eventFilter- the event filter
 
- 
removeEventFilterpublic final <T extends Event> void removeEventFilter(EventType<T> eventType, EventHandler<? super T> eventFilter) Description copied from interface:EventTargetUnregisters a previously registered event filter from this target.Since it is possible to register a single EventHandlerinstance for different event types, the caller needs to specify the event type from which the filter should be unregistered.- Specified by:
- removeEventFilterin interface- EventTarget
- Type Parameters:
- T- the event class of the filter
- Parameters:
- eventType- the event type from which to unregister
- eventFilter- the event filter
 
- 
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
 
- 
addMnemonic
- 
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
 
- 
buildEventDispatchChainDescription copied from interface:EventTargetConstruct an event dispatch chain for this target. The event dispatch chain contains event dispatchers which might be interested in processing of events targeted at thisEventTarget. This event target is not automatically added to the chain, so if it wants to process events, it needs to add anEventDispatcherfor itself to the chain.In the case the event target is part of some hierarchy, the chain for it is usually built from event dispatchers collected from the root of the hierarchy to the event target. The event dispatch chain is constructed by modifications to the provided initial event dispatch chain. The returned chain should have the initial chain at its end so the dispatchers should be prepended to the initial chain. The caller shouldn't assume that the initial chain remains unchanged nor that the returned value will reference a different chain. - Specified by:
- buildEventDispatchChainin interface- EventTarget
- Parameters:
- tail- the initial chain to build from
- Returns:
- the resulting event dispatch chain for this target
 
- 
setOnContextMenuRequestedSets the value of theonContextMenuRequestedproperty.- Property description:
- Defines a function to be called when a mouse button has been clicked
 (pressed and released) on this Scene.
- Parameters:
- value- the value for the- onContextMenuRequestedproperty
- Since:
- JavaFX 2.1
- See Also:
 
- 
getOnContextMenuRequestedGets the value of theonContextMenuRequestedproperty.- Property description:
- Defines a function to be called when a mouse button has been clicked
 (pressed and released) on this Scene.
- Returns:
- the value of the onContextMenuRequestedproperty
- Since:
- JavaFX 2.1
- See Also:
 
- 
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.- Returns:
- the onContextMenuRequestedproperty
- Since:
- JavaFX 2.1
- See Also:
 
- 
setOnMouseClickedSets the value of theonMouseClickedproperty.- Property description:
- Defines a function to be called when a mouse button has been clicked
 (pressed and released) on this Scene.
- Parameters:
- value- the value for the- onMouseClickedproperty
- See Also:
 
- 
getOnMouseClickedGets the value of theonMouseClickedproperty.- Property description:
- Defines a function to be called when a mouse button has been clicked
 (pressed and released) on this Scene.
- Returns:
- the value of the onMouseClickedproperty
- See Also:
 
- 
onMouseClickedPropertyDefines a function to be called when a mouse button has been clicked (pressed and released) on thisScene.- Returns:
- the onMouseClickedproperty
- See Also:
 
- 
setOnMouseDraggedSets the value of theonMouseDraggedproperty.- Property description:
- Defines a function to be called when a mouse button is pressed
 on this Sceneand then dragged.
- Parameters:
- value- the value for the- onMouseDraggedproperty
- See Also:
 
- 
getOnMouseDraggedGets the value of theonMouseDraggedproperty.- Property description:
- Defines a function to be called when a mouse button is pressed
 on this Sceneand then dragged.
- Returns:
- the value of the onMouseDraggedproperty
- See Also:
 
- 
onMouseDraggedPropertyDefines a function to be called when a mouse button is pressed on thisSceneand then dragged.- Returns:
- the onMouseDraggedproperty
- See Also:
 
- 
setOnMouseEnteredSets the value of theonMouseEnteredproperty.- Property description:
- Defines a function to be called when the mouse enters this Scene.
- Parameters:
- value- the value for the- onMouseEnteredproperty
- See Also:
 
- 
getOnMouseEnteredGets the value of theonMouseEnteredproperty.- Property description:
- Defines a function to be called when the mouse enters this Scene.
- Returns:
- the value of the onMouseEnteredproperty
- See Also:
 
- 
onMouseEnteredPropertyDefines a function to be called when the mouse enters thisScene.- Returns:
- the onMouseEnteredproperty
- See Also:
 
- 
setOnMouseExitedSets the value of theonMouseExitedproperty.- Property description:
- Defines a function to be called when the mouse exits this Scene.
- Parameters:
- value- the value for the- onMouseExitedproperty
- See Also:
 
- 
getOnMouseExitedGets the value of theonMouseExitedproperty.- Property description:
- Defines a function to be called when the mouse exits this Scene.
- Returns:
- the value of the onMouseExitedproperty
- See Also:
 
- 
onMouseExitedPropertyDefines a function to be called when the mouse exits thisScene.- Returns:
- the onMouseExitedproperty
- See Also:
 
- 
setOnMouseMovedSets the value of theonMouseMovedproperty.- Property description:
- Defines a function to be called when mouse cursor moves within
 this Scenebut no buttons have been pushed.
- Parameters:
- value- the value for the- onMouseMovedproperty
- See Also:
 
- 
getOnMouseMovedGets the value of theonMouseMovedproperty.- Property description:
- Defines a function to be called when mouse cursor moves within
 this Scenebut no buttons have been pushed.
- Returns:
- the value of the onMouseMovedproperty
- See Also:
 
- 
onMouseMovedPropertyDefines a function to be called when mouse cursor moves within thisScenebut no buttons have been pushed.- Returns:
- the onMouseMovedproperty
- See Also:
 
- 
setOnMousePressedSets the value of theonMousePressedproperty.- Property description:
- Defines a function to be called when a mouse button
 has been pressed on this Scene.
- Parameters:
- value- the value for the- onMousePressedproperty
- See Also:
 
- 
getOnMousePressedGets the value of theonMousePressedproperty.- Property description:
- Defines a function to be called when a mouse button
 has been pressed on this Scene.
- Returns:
- the value of the onMousePressedproperty
- See Also:
 
- 
onMousePressedPropertyDefines a function to be called when a mouse button has been pressed on thisScene.- Returns:
- the onMousePressedproperty
- See Also:
 
- 
setOnMouseReleasedSets the value of theonMouseReleasedproperty.- Property description:
- Defines a function to be called when a mouse button
 has been released on this Scene.
- Parameters:
- value- the value for the- onMouseReleasedproperty
- See Also:
 
- 
getOnMouseReleasedGets the value of theonMouseReleasedproperty.- Property description:
- Defines a function to be called when a mouse button
 has been released on this Scene.
- Returns:
- the value of the onMouseReleasedproperty
- See Also:
 
- 
onMouseReleasedPropertyDefines a function to be called when a mouse button has been released on thisScene.- Returns:
- the onMouseReleasedproperty
- See Also:
 
- 
setOnDragDetectedSets the value of theonDragDetectedproperty.- 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.
- Parameters:
- value- the value for the- onDragDetectedproperty
- See Also:
 
- 
getOnDragDetectedGets the value of theonDragDetectedproperty.- 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.
- Returns:
- the value of the onDragDetectedproperty
- See Also:
 
- 
onDragDetectedPropertyDefines a function to be called when drag gesture has been detected. This is the right place to start drag and drop operation.- Returns:
- the onDragDetectedproperty
- See Also:
 
- 
setOnMouseDragOverSets the value of theonMouseDragOverproperty.- Property description:
- Defines a function to be called when a full press-drag-release gesture
 progresses within this Scene.
- Parameters:
- value- the value for the- onMouseDragOverproperty
- Since:
- JavaFX 2.1
- See Also:
 
- 
getOnMouseDragOverGets the value of theonMouseDragOverproperty.- Property description:
- Defines a function to be called when a full press-drag-release gesture
 progresses within this Scene.
- Returns:
- the value of the onMouseDragOverproperty
- Since:
- JavaFX 2.1
- See Also:
 
- 
onMouseDragOverPropertyDefines a function to be called when a full press-drag-release gesture progresses within thisScene.- Returns:
- the onMouseDragOverproperty
- Since:
- JavaFX 2.1
- See Also:
 
- 
setOnMouseDragReleasedSets the value of theonMouseDragReleasedproperty.- Property description:
- Defines a function to be called when a full press-drag-release gesture
 ends within this Scene.
- Parameters:
- value- the value for the- onMouseDragReleasedproperty
- Since:
- JavaFX 2.1
- See Also:
 
- 
getOnMouseDragReleasedGets the value of theonMouseDragReleasedproperty.- Property description:
- Defines a function to be called when a full press-drag-release gesture
 ends within this Scene.
- Returns:
- the value of the onMouseDragReleasedproperty
- Since:
- JavaFX 2.1
- See Also:
 
- 
onMouseDragReleasedPropertyDefines a function to be called when a full press-drag-release gesture ends within thisScene.- Returns:
- the onMouseDragReleasedproperty
- Since:
- JavaFX 2.1
- See Also:
 
- 
setOnMouseDragEnteredSets the value of theonMouseDragEnteredproperty.- Property description:
- Defines a function to be called when a full press-drag-release gesture
 enters this Scene.
- Parameters:
- value- the value for the- onMouseDragEnteredproperty
- Since:
- JavaFX 2.1
- See Also:
 
- 
getOnMouseDragEnteredGets the value of theonMouseDragEnteredproperty.- Property description:
- Defines a function to be called when a full press-drag-release gesture
 enters this Scene.
- Returns:
- the value of the onMouseDragEnteredproperty
- Since:
- JavaFX 2.1
- See Also:
 
- 
onMouseDragEnteredPropertyDefines a function to be called when a full press-drag-release gesture enters thisScene.- Returns:
- the onMouseDragEnteredproperty
- Since:
- JavaFX 2.1
- See Also:
 
- 
setOnMouseDragExitedSets the value of theonMouseDragExitedproperty.- Property description:
- Defines a function to be called when a full press-drag-release gesture
 exits this Scene.
- Parameters:
- value- the value for the- onMouseDragExitedproperty
- Since:
- JavaFX 2.1
- See Also:
 
- 
getOnMouseDragExitedGets the value of theonMouseDragExitedproperty.- Property description:
- Defines a function to be called when a full press-drag-release gesture
 exits this Scene.
- Returns:
- the value of the onMouseDragExitedproperty
- Since:
- JavaFX 2.1
- See Also:
 
- 
onMouseDragExitedPropertyDefines a function to be called when a full press-drag-release gesture exits thisScene.- Returns:
- the onMouseDragExitedproperty
- Since:
- JavaFX 2.1
- See Also:
 
- 
setOnScrollStartedSets the value of theonScrollStartedproperty.- Property description:
- Defines a function to be called when a scrolling gesture is detected.
- Parameters:
- value- the value for the- onScrollStartedproperty
- Since:
- JavaFX 2.2
- See Also:
 
- 
getOnScrollStartedGets the value of theonScrollStartedproperty.- Property description:
- Defines a function to be called when a scrolling gesture is detected.
- Returns:
- the value of the onScrollStartedproperty
- Since:
- JavaFX 2.2
- See Also:
 
- 
onScrollStartedPropertyDefines a function to be called when a scrolling gesture is detected.- Returns:
- the onScrollStartedproperty
- Since:
- JavaFX 2.2
- See Also:
 
- 
setOnScrollSets the value of theonScrollproperty.- Property description:
- Defines a function to be called when user performs a scrolling action.
- Parameters:
- value- the value for the- onScrollproperty
- See Also:
 
- 
getOnScrollGets the value of theonScrollproperty.- Property description:
- Defines a function to be called when user performs a scrolling action.
- Returns:
- the value of the onScrollproperty
- See Also:
 
- 
onScrollPropertyDefines a function to be called when user performs a scrolling action.- Returns:
- the onScrollproperty
- See Also:
 
- 
setOnScrollFinishedSets the value of theonScrollFinishedproperty.- Property description:
- Defines a function to be called when a scrolling gesture ends.
- Parameters:
- value- the value for the- onScrollFinishedproperty
- Since:
- JavaFX 2.2
- See Also:
 
- 
getOnScrollFinishedGets the value of theonScrollFinishedproperty.- Property description:
- Defines a function to be called when a scrolling gesture ends.
- Returns:
- the value of the onScrollFinishedproperty
- Since:
- JavaFX 2.2
- See Also:
 
- 
onScrollFinishedPropertyDefines a function to be called when a scrolling gesture ends.- Returns:
- the onScrollFinishedproperty
- Since:
- JavaFX 2.2
- See Also:
 
- 
setOnRotationStartedSets the value of theonRotationStartedproperty.- Property description:
- Defines a function to be called when a rotating gesture is detected.
- Parameters:
- value- the value for the- onRotationStartedproperty
- Since:
- JavaFX 2.2
- See Also:
 
- 
getOnRotationStartedGets the value of theonRotationStartedproperty.- Property description:
- Defines a function to be called when a rotating gesture is detected.
- Returns:
- the value of the onRotationStartedproperty
- Since:
- JavaFX 2.2
- See Also:
 
- 
onRotationStartedPropertyDefines a function to be called when a rotating gesture is detected.- Returns:
- the onRotationStartedproperty
- Since:
- JavaFX 2.2
- See Also:
 
- 
setOnRotateSets the value of theonRotateproperty.- Property description:
- Defines a function to be called when user performs a rotating action.
- Parameters:
- value- the value for the- onRotateproperty
- Since:
- JavaFX 2.2
- See Also:
 
- 
getOnRotateGets the value of theonRotateproperty.- Property description:
- Defines a function to be called when user performs a rotating action.
- Returns:
- the value of the onRotateproperty
- Since:
- JavaFX 2.2
- See Also:
 
- 
onRotatePropertyDefines a function to be called when user performs a rotating action.- Returns:
- the onRotateproperty
- Since:
- JavaFX 2.2
- See Also:
 
- 
setOnRotationFinishedSets the value of theonRotationFinishedproperty.- Property description:
- Defines a function to be called when a rotating gesture ends.
- Parameters:
- value- the value for the- onRotationFinishedproperty
- Since:
- JavaFX 2.2
- See Also:
 
- 
getOnRotationFinishedGets the value of theonRotationFinishedproperty.- Property description:
- Defines a function to be called when a rotating gesture ends.
- Returns:
- the value of the onRotationFinishedproperty
- Since:
- JavaFX 2.2
- See Also:
 
- 
onRotationFinishedPropertyDefines a function to be called when a rotating gesture ends.- Returns:
- the onRotationFinishedproperty
- Since:
- JavaFX 2.2
- See Also:
 
- 
setOnZoomStartedSets the value of theonZoomStartedproperty.- Property description:
- Defines a function to be called when a zooming gesture is detected.
- Parameters:
- value- the value for the- onZoomStartedproperty
- Since:
- JavaFX 2.2
- See Also:
 
- 
getOnZoomStartedGets the value of theonZoomStartedproperty.- Property description:
- Defines a function to be called when a zooming gesture is detected.
- Returns:
- the value of the onZoomStartedproperty
- Since:
- JavaFX 2.2
- See Also:
 
- 
onZoomStartedPropertyDefines a function to be called when a zooming gesture is detected.- Returns:
- the onZoomStartedproperty
- Since:
- JavaFX 2.2
- See Also:
 
- 
setOnZoomSets the value of theonZoomproperty.- Property description:
- Defines a function to be called when user performs a zooming action.
- Parameters:
- value- the value for the- onZoomproperty
- Since:
- JavaFX 2.2
- See Also:
 
- 
getOnZoomGets the value of theonZoomproperty.- Property description:
- Defines a function to be called when user performs a zooming action.
- Returns:
- the value of the onZoomproperty
- Since:
- JavaFX 2.2
- See Also:
 
- 
onZoomPropertyDefines a function to be called when user performs a zooming action.- Returns:
- the onZoomproperty
- Since:
- JavaFX 2.2
- See Also:
 
- 
setOnZoomFinishedSets the value of theonZoomFinishedproperty.- Property description:
- Defines a function to be called when a zooming gesture ends.
- Parameters:
- value- the value for the- onZoomFinishedproperty
- Since:
- JavaFX 2.2
- See Also:
 
- 
getOnZoomFinishedGets the value of theonZoomFinishedproperty.- Property description:
- Defines a function to be called when a zooming gesture ends.
- Returns:
- the value of the onZoomFinishedproperty
- Since:
- JavaFX 2.2
- See Also:
 
- 
onZoomFinishedPropertyDefines a function to be called when a zooming gesture ends.- Returns:
- the onZoomFinishedproperty
- Since:
- JavaFX 2.2
- See Also:
 
- 
setOnSwipeUpSets the value of theonSwipeUpproperty.- Property description:
- Defines a function to be called when an upward swipe gesture happens in this scene.
- Parameters:
- value- the value for the- onSwipeUpproperty
- Since:
- JavaFX 2.2
- See Also:
 
- 
getOnSwipeUpGets the value of theonSwipeUpproperty.- Property description:
- Defines a function to be called when an upward swipe gesture happens in this scene.
- Returns:
- the value of the onSwipeUpproperty
- Since:
- JavaFX 2.2
- See Also:
 
- 
onSwipeUpPropertyDefines a function to be called when an upward swipe gesture happens in this scene.- Returns:
- the onSwipeUpproperty
- Since:
- JavaFX 2.2
- See Also:
 
- 
setOnSwipeDownSets the value of theonSwipeDownproperty.- Property description:
- Defines a function to be called when an downward swipe gesture happens in this scene.
- Parameters:
- value- the value for the- onSwipeDownproperty
- Since:
- JavaFX 2.2
- See Also:
 
- 
getOnSwipeDownGets the value of theonSwipeDownproperty.- Property description:
- Defines a function to be called when an downward swipe gesture happens in this scene.
- Returns:
- the value of the onSwipeDownproperty
- Since:
- JavaFX 2.2
- See Also:
 
- 
onSwipeDownPropertyDefines a function to be called when an downward swipe gesture happens in this scene.- Returns:
- the onSwipeDownproperty
- Since:
- JavaFX 2.2
- See Also:
 
- 
setOnSwipeLeftSets the value of theonSwipeLeftproperty.- Property description:
- Defines a function to be called when an leftward swipe gesture happens in this scene.
- Parameters:
- value- the value for the- onSwipeLeftproperty
- Since:
- JavaFX 2.2
- See Also:
 
- 
getOnSwipeLeftGets the value of theonSwipeLeftproperty.- Property description:
- Defines a function to be called when an leftward swipe gesture happens in this scene.
- Returns:
- the value of the onSwipeLeftproperty
- Since:
- JavaFX 2.2
- See Also:
 
- 
onSwipeLeftPropertyDefines a function to be called when an leftward swipe gesture happens in this scene.- Returns:
- the onSwipeLeftproperty
- Since:
- JavaFX 2.2
- See Also:
 
- 
setOnSwipeRightSets the value of theonSwipeRightproperty.- Property description:
- Defines a function to be called when an rightward swipe gesture happens in this scene.
- Parameters:
- value- the value for the- onSwipeRightproperty
- Since:
- JavaFX 2.2
- See Also:
 
- 
getOnSwipeRightGets the value of theonSwipeRightproperty.- Property description:
- Defines a function to be called when an rightward swipe gesture happens in this scene.
- Returns:
- the value of the onSwipeRightproperty
- Since:
- JavaFX 2.2
- See Also:
 
- 
onSwipeRightPropertyDefines a function to be called when an rightward swipe gesture happens in this scene.- Returns:
- the onSwipeRightproperty
- Since:
- JavaFX 2.2
- See Also:
 
- 
setOnTouchPressedSets the value of theonTouchPressedproperty.- Property description:
- Defines a function to be called when a new touch point is pressed.
- Parameters:
- value- the value for the- onTouchPressedproperty
- Since:
- JavaFX 2.2
- See Also:
 
- 
getOnTouchPressedGets the value of theonTouchPressedproperty.- Property description:
- Defines a function to be called when a new touch point is pressed.
- Returns:
- the value of the onTouchPressedproperty
- Since:
- JavaFX 2.2
- See Also:
 
- 
onTouchPressedPropertyDefines a function to be called when a new touch point is pressed.- Returns:
- the onTouchPressedproperty
- Since:
- JavaFX 2.2
- See Also:
 
- 
setOnTouchMovedSets the value of theonTouchMovedproperty.- Property description:
- Defines a function to be called when a touch point is moved.
- Parameters:
- value- the value for the- onTouchMovedproperty
- Since:
- JavaFX 2.2
- See Also:
 
- 
getOnTouchMovedGets the value of theonTouchMovedproperty.- Property description:
- Defines a function to be called when a touch point is moved.
- Returns:
- the value of the onTouchMovedproperty
- Since:
- JavaFX 2.2
- See Also:
 
- 
onTouchMovedPropertyDefines a function to be called when a touch point is moved.- Returns:
- the onTouchMovedproperty
- Since:
- JavaFX 2.2
- See Also:
 
- 
setOnTouchReleasedSets the value of theonTouchReleasedproperty.- Property description:
- Defines a function to be called when a new touch point is pressed.
- Parameters:
- value- the value for the- onTouchReleasedproperty
- Since:
- JavaFX 2.2
- See Also:
 
- 
getOnTouchReleasedGets the value of theonTouchReleasedproperty.- Property description:
- Defines a function to be called when a new touch point is pressed.
- Returns:
- the value of the onTouchReleasedproperty
- Since:
- JavaFX 2.2
- See Also:
 
- 
onTouchReleasedPropertyDefines a function to be called when a new touch point is pressed.- Returns:
- the onTouchReleasedproperty
- Since:
- JavaFX 2.2
- See Also:
 
- 
setOnTouchStationarySets the value of theonTouchStationaryproperty.- Property description:
- Defines a function to be called when a touch point stays pressed and still.
- Parameters:
- value- the value for the- onTouchStationaryproperty
- Since:
- JavaFX 2.2
- See Also:
 
- 
getOnTouchStationaryGets the value of theonTouchStationaryproperty.- Property description:
- Defines a function to be called when a touch point stays pressed and still.
- Returns:
- the value of the onTouchStationaryproperty
- Since:
- JavaFX 2.2
- See Also:
 
- 
onTouchStationaryPropertyDefines a function to be called when a touch point stays pressed and still.- Returns:
- the onTouchStationaryproperty
- Since:
- JavaFX 2.2
- See Also:
 
- 
setOnDragEnteredSets the value of theonDragEnteredproperty.- Property description:
- Defines a function to be called when drag gesture
 enters this Scene.
- Parameters:
- value- the value for the- onDragEnteredproperty
- See Also:
 
- 
getOnDragEnteredGets the value of theonDragEnteredproperty.- Property description:
- Defines a function to be called when drag gesture
 enters this Scene.
- Returns:
- the value of the onDragEnteredproperty
- See Also:
 
- 
onDragEnteredPropertyDefines a function to be called when drag gesture enters thisScene.- Returns:
- function to be called when drag gesture enters this scene
- See Also:
 
- 
setOnDragExitedSets the value of theonDragExitedproperty.- Property description:
- Defines a function to be called when drag gesture
 exits this Scene.
- Parameters:
- value- the value for the- onDragExitedproperty
- See Also:
 
- 
getOnDragExitedGets the value of theonDragExitedproperty.- Property description:
- Defines a function to be called when drag gesture
 exits this Scene.
- Returns:
- the value of the onDragExitedproperty
- See Also:
 
- 
onDragExitedPropertyDefines a function to be called when drag gesture exits thisScene.- Returns:
- the function to be called when drag gesture exits this scene
- See Also:
 
- 
setOnDragOverSets the value of theonDragOverproperty.- Property description:
- Defines a function to be called when drag gesture progresses
 within this Scene.
- Parameters:
- value- the value for the- onDragOverproperty
- See Also:
 
- 
getOnDragOverGets the value of theonDragOverproperty.- Property description:
- Defines a function to be called when drag gesture progresses
 within this Scene.
- Returns:
- the value of the onDragOverproperty
- See Also:
 
- 
onDragOverPropertyDefines a function to be called when drag gesture progresses within thisScene.- Returns:
- the function to be called when drag gesture progresses within this scene
- See Also:
 
- 
setOnDragDroppedSets the value of theonDragDroppedproperty.
- 
getOnDragDroppedGets the value of theonDragDroppedproperty.
- 
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.- Returns:
- the function to be called when the mouse button is released on this scene during drag and drop gesture
- See Also:
 
- 
setOnDragDoneSets the value of theonDragDoneproperty.- 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.
- Parameters:
- value- the value for the- onDragDoneproperty
- See Also:
 
- 
getOnDragDoneGets the value of theonDragDoneproperty.- 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.
- Returns:
- the value of the onDragDoneproperty
- See Also:
 
- 
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.- Returns:
- the function to be called when this scene is a drag and drop gesture source after its data has been dropped on a drop target
- See Also:
 
- 
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:
 
- 
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:
 
- 
setOnKeyPressedSets the value of theonKeyPressedproperty.- 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.
- Parameters:
- value- the value for the- onKeyPressedproperty
- See Also:
 
- 
getOnKeyPressedGets the value of theonKeyPressedproperty.- 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.
- Returns:
- the value of the onKeyPressedproperty
- See Also:
 
- 
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.- Returns:
- the onKeyPressedproperty
- See Also:
 
- 
setOnKeyReleasedSets the value of theonKeyReleasedproperty.- 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.
- Parameters:
- value- the value for the- onKeyReleasedproperty
- See Also:
 
- 
getOnKeyReleasedGets the value of theonKeyReleasedproperty.- 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.
- Returns:
- the value of the onKeyReleasedproperty
- See Also:
 
- 
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.- Returns:
- the onKeyReleasedproperty
- See Also:
 
- 
setOnKeyTypedSets the value of theonKeyTypedproperty.- 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.
- Parameters:
- value- the value for the- onKeyTypedproperty
- See Also:
 
- 
getOnKeyTypedGets the value of theonKeyTypedproperty.- 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.
- Returns:
- the value of the onKeyTypedproperty
- See Also:
 
- 
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.- Returns:
- the onKeyTypedproperty
- See Also:
 
- 
setOnInputMethodTextChangedSets the value of theonInputMethodTextChangedproperty.- 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.
- Parameters:
- value- the value for the- onInputMethodTextChangedproperty
- See Also:
 
- 
getOnInputMethodTextChangedGets the value of theonInputMethodTextChangedproperty.- 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.
- Returns:
- the value of the onInputMethodTextChangedproperty
- See Also:
 
- 
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.- Returns:
- the onInputMethodTextChangedproperty
- See Also:
 
- 
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 thenodeOrientationproperty.- Property description:
- 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.
- Default value:
- if the system property javafx.scene.nodeOrientation.RTListrue,NodeOrientation.RIGHT_TO_LEFT, otherwiseNodeOrientation.INHERIT
- Parameters:
- orientation- the value for the- nodeOrientationproperty
- Since:
- JavaFX 8.0
- See Also:
 
- 
getNodeOrientationGets the value of thenodeOrientationproperty.- Property description:
- 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.
- Default value:
- if the system property javafx.scene.nodeOrientation.RTListrue,NodeOrientation.RIGHT_TO_LEFT, otherwiseNodeOrientation.INHERIT
- Returns:
- the value of the nodeOrientationproperty
- Since:
- JavaFX 8.0
- See Also:
 
- 
nodeOrientationPropertyNode 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.- Default value:
- if the system property javafx.scene.nodeOrientation.RTListrue,NodeOrientation.RIGHT_TO_LEFT, otherwiseNodeOrientation.INHERIT
- Returns:
- the nodeOrientationproperty
- Since:
- JavaFX 8.0
- See Also:
 
- 
getEffectiveNodeOrientationGets the value of theeffectiveNodeOrientationproperty.- Property description:
- The effective node orientation of a scene resolves the inheritance of node orientation, returning either left-to-right or right-to-left.
- Returns:
- the value of the effectiveNodeOrientationproperty
- Since:
- JavaFX 8.0
- See Also:
 
- 
effectiveNodeOrientationPropertyThe effective node orientation of a scene resolves the inheritance of node orientation, returning either left-to-right or right-to-left.- Returns:
- the effective node orientation of this scene
- Since:
- JavaFX 8.0
- See Also:
 
 
-