Spec-Zone .ru
спецификации, руководства, описания, API
|
public class Scene extends java.lang.Object implements EventTarget
Scene
class is the container for all content in a scene graph.
The background of the scene is filled as specified by the fill
property.
The application must specify the root Node
for the scene graph by setting
the root
property. If a Group
is used as the root, the
contents of the scene graph will be clipped by the scene's width and height and
changes to the scene's size (if user resizes the stage) will not alter the
layout of the scene graph. If a resizable node (layout Region
or
Control
is set as the root, then the root's size will track the
scene's size, causing the contents to be relayed out as necessary.
The scene's size may be initialized by the application during construction. If no size is specified, the scene will automatically compute its initial size based on the preferred size of its content.
Scene objects must be constructed and modified on the JavaFX Application Thread.
Example:
import javafx.scene.*; import javafx.scene.paint.*; import javafx.scene.shape.*; Group root = new Group(); Scene s = new Scene(root, 300, 300, Color.BLACK); Rectangle r = new Rectangle(25,25,250,250); r.setFill(Color.BLUE); root.getChildren().add(r);
Type | Property and Description |
---|---|
ObjectProperty<Camera> |
camera
Specifies the type of camera use for rendering this
Scene . |
ObjectProperty<Cursor> |
cursor
Defines the mouse cursor for this
Scene . |
ObjectProperty<EventDispatcher> |
eventDispatcher
Specifies the event dispatcher for this scene.
|
ObjectProperty<Paint> |
fill
Defines the background fill of this
Scene . |
ReadOnlyDoubleProperty |
height
The height of this
Scene |
ObjectProperty<EventHandler<? super MouseEvent>> |
onDragDetected
Defines a function to be called when drag gesture has been
detected.
|
ObjectProperty<EventHandler<? super DragEvent>> |
onDragDone
Defines a function to be called when this @{code Scene} is a
drag and drop gesture source after its data has
been dropped on a drop target.
|
ObjectProperty<EventHandler<? super DragEvent>> |
onDragDropped
Defines a function to be called when the mouse button is released
on this
Scene during drag and drop gesture. |
ObjectProperty<EventHandler<? super DragEvent>> |
onDragEntered
Defines a function to be called when drag gesture
enters this
Scene . |
ObjectProperty<EventHandler<? super DragEvent>> |
onDragExited
Defines a function to be called when drag gesture
exits this
Scene . |
ObjectProperty<EventHandler<? super DragEvent>> |
onDragOver
Defines a function to be called when drag gesture progresses
within this
Scene . |
ObjectProperty<EventHandler<? super InputMethodEvent>> |
onInputMethodTextChanged
Defines a function to be called when this
Node
has input focus and the input method text has changed. |
ObjectProperty<EventHandler<? super KeyEvent>> |
onKeyPressed
Defines a function to be called when some
Node of this
Scene has input focus and a key has been pressed. |
ObjectProperty<EventHandler<? super KeyEvent>> |
onKeyReleased
Defines a function to be called when some
Node of this
Scene has input focus and a key has been released. |
ObjectProperty<EventHandler<? super KeyEvent>> |
onKeyTyped
Defines a function to be called when some
Node of this
Scene has input focus and a key has been typed. |
ObjectProperty<EventHandler<? super MouseEvent>> |
onMouseClicked
Defines a function to be called when a mouse button has been clicked
(pressed and released) on this
Scene . |
ObjectProperty<EventHandler<? super MouseEvent>> |
onMouseDragged
Defines a function to be called when a mouse button is pressed
on this
Scene and then dragged. |
ObjectProperty<EventHandler<? super MouseEvent>> |
onMouseEntered
Defines a function to be called when the mouse enters some
Node
of this Scene . |
ObjectProperty<EventHandler<? super MouseEvent>> |
onMouseExited
Defines a function to be called when the mouse exits some
Node
of this Scene . |
ObjectProperty<EventHandler<? super MouseEvent>> |
onMouseMoved
Defines a function to be called when mouse cursor moves within
this
Scene but no buttons have been pushed. |
ObjectProperty<EventHandler<? super MouseEvent>> |
onMousePressed
Defines a function to be called when a mouse button
has been pressed on this
Scene . |
ObjectProperty<EventHandler<? super MouseEvent>> |
onMouseReleased
Defines a function to be called when a mouse button
has been released on this
Scene . |
ObjectProperty<EventHandler<? super ScrollEvent>> |
onScroll
Defines a function to be called when user performs a scrolling action.
|
ObjectProperty<Parent> |
root
Defines the root
Node of the scene graph. |
ReadOnlyDoubleProperty |
width
The width of this
Scene |
ReadOnlyObjectProperty<Window> |
window
The
Window for this Scene |
ReadOnlyDoubleProperty |
x
The horizontal location of this
Scene on the Window . |
ReadOnlyDoubleProperty |
y
The vertical location of this
Scene on the Window . |
Constructor and Description |
---|
Scene(Parent root)
Creates a Scene for a specific root Node.
|
Scene(Parent root,
double width,
double height)
Creates a Scene for a specific root Node with a specific size.
|
Scene(Parent root,
double width,
double height,
boolean depthBuffer)
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,
Paint fill)
Creates a Scene for a specific root Node with a specific size and fill.
|
Scene(Parent root,
Paint fill)
Creates a Scene for a specific root Node with a fill.
|
Modifier and Type | Method and Description |
---|---|
<T extends Event> |
addEventFilter(EventType<T> eventType,
EventHandler<? super T> eventFilter)
Registers an event filter to this scene.
|
<T extends Event> |
addEventHandler(EventType<T> eventType,
EventHandler<? super T> eventHandler)
Registers an event handler to this scene.
|
void |
addMnemonic(Mnemonic m)
Registers the specified mnemonic.
|
EventDispatchChain |
buildEventDispatchChain(EventDispatchChain tail)
Construct an event dispatch chain for this scene.
|
ObjectProperty<Camera> |
cameraProperty()
Specifies the type of camera use for rendering this
Scene . |
ObjectProperty<Cursor> |
cursorProperty()
Defines the mouse cursor for this
Scene . |
ObjectProperty<EventDispatcher> |
eventDispatcherProperty()
Specifies the event dispatcher for this scene.
|
ObjectProperty<Paint> |
fillProperty()
Defines the background fill of this
Scene . |
ObservableMap<KeyCombination,java.lang.Runnable> |
getAccelerators()
Gets the list of accelerators for this
Scene . |
Camera |
getCamera()
Specifies the type of camera use for rendering this
Scene . |
Cursor |
getCursor()
Defines the mouse cursor for this
Scene . |
EventDispatcher |
getEventDispatcher()
Specifies the event dispatcher for this scene.
|
Paint |
getFill()
Defines the background fill of this
Scene . |
double |
getHeight()
The height of this
Scene |
ObservableMap<KeyCombination,ObservableList<Mnemonic>> |
getMnemonics()
Gets the list of mnemonics for this
Scene . |
EventHandler<? super MouseEvent> |
getOnDragDetected()
Defines a function to be called when drag gesture has been
detected.
|
EventHandler<? super DragEvent> |
getOnDragDone()
Defines a function to be called when this @{code Scene} is a
drag and drop gesture source after its data has
been dropped on a drop target.
|
EventHandler<? super DragEvent> |
getOnDragDropped()
Defines a function to be called when the mouse button is released
on this
Scene during drag and drop gesture. |
EventHandler<? super DragEvent> |
getOnDragEntered()
Defines a function to be called when drag gesture
enters this
Scene . |
EventHandler<? super DragEvent> |
getOnDragExited()
Defines a function to be called when drag gesture
exits this
Scene . |
EventHandler<? super DragEvent> |
getOnDragOver()
Defines a function to be called when drag gesture progresses
within this
Scene . |
EventHandler<? super InputMethodEvent> |
getOnInputMethodTextChanged()
Defines a function to be called when this
Node
has input focus and the input method text has changed. |
EventHandler<? super KeyEvent> |
getOnKeyPressed()
Defines a function to be called when some
Node of this
Scene has input focus and a key has been pressed. |
EventHandler<? super KeyEvent> |
getOnKeyReleased()
Defines a function to be called when some
Node of this
Scene has input focus and a key has been released. |
EventHandler<? super KeyEvent> |
getOnKeyTyped()
Defines a function to be called when some
Node of this
Scene has input focus and a key has been typed. |
EventHandler<? super MouseEvent> |
getOnMouseClicked()
Defines a function to be called when a mouse button has been clicked
(pressed and released) on this
Scene . |
EventHandler<? super MouseEvent> |
getOnMouseDragged()
Defines a function to be called when a mouse button is pressed
on this
Scene and then dragged. |
EventHandler<? super MouseEvent> |
getOnMouseEntered()
Defines a function to be called when the mouse enters some
Node
of this Scene . |
EventHandler<? super MouseEvent> |
getOnMouseExited()
Defines a function to be called when the mouse exits some
Node
of this Scene . |
EventHandler<? super MouseEvent> |
getOnMouseMoved()
Defines a function to be called when mouse cursor moves within
this
Scene but no buttons have been pushed. |
EventHandler<? super MouseEvent> |
getOnMousePressed()
Defines a function to be called when a mouse button
has been pressed on this
Scene . |
EventHandler<? super MouseEvent> |
getOnMouseReleased()
Defines a function to be called when a mouse button
has been released on this
Scene . |
EventHandler<? super ScrollEvent> |
getOnScroll()
Defines a function to be called when user performs a scrolling action.
|
Parent |
getRoot()
Defines the root
Node of the scene graph. |
ObservableList<java.lang.String> |
getStylesheets()
Gets an observable list of string URLs linking to the stylesheets to use
with this scene's contents.
|
double |
getWidth()
The width of this
Scene |
Window |
getWindow()
The
Window for this Scene |
double |
getX()
The horizontal location of this
Scene on the Window . |
double |
getY()
The vertical location of this
Scene on the Window . |
ReadOnlyDoubleProperty |
heightProperty()
The height of this
Scene |
boolean |
isDepthBuffer()
Retrieves the depth buffer attribute for this scene.
|
Node |
lookup(java.lang.String selector)
Looks for any node within the scene graph based on the specified CSS selector.
|
ObjectProperty<EventHandler<? super MouseEvent>> |
onDragDetectedProperty()
Defines a function to be called when drag gesture has been
detected.
|
ObjectProperty<EventHandler<? super DragEvent>> |
onDragDoneProperty()
Defines a function to be called when this @{code Scene} is a
drag and drop gesture source after its data has
been dropped on a drop target.
|
ObjectProperty<EventHandler<? super DragEvent>> |
onDragDroppedProperty()
Defines a function to be called when the mouse button is released
on this
Scene during drag and drop gesture. |
ObjectProperty<EventHandler<? super DragEvent>> |
onDragEnteredProperty()
Defines a function to be called when drag gesture
enters this
Scene . |
ObjectProperty<EventHandler<? super DragEvent>> |
onDragExitedProperty()
Defines a function to be called when drag gesture
exits this
Scene . |
ObjectProperty<EventHandler<? super DragEvent>> |
onDragOverProperty()
Defines a function to be called when drag gesture progresses
within this
Scene . |
ObjectProperty<EventHandler<? super InputMethodEvent>> |
onInputMethodTextChangedProperty()
Defines a function to be called when this
Node
has input focus and the input method text has changed. |
ObjectProperty<EventHandler<? super KeyEvent>> |
onKeyPressedProperty()
Defines a function to be called when some
Node of this
Scene has input focus and a key has been pressed. |
ObjectProperty<EventHandler<? super KeyEvent>> |
onKeyReleasedProperty()
Defines a function to be called when some
Node of this
Scene has input focus and a key has been released. |
ObjectProperty<EventHandler<? super KeyEvent>> |
onKeyTypedProperty()
Defines a function to be called when some
Node of this
Scene has input focus and a key has been typed. |
ObjectProperty<EventHandler<? super MouseEvent>> |
onMouseClickedProperty()
Defines a function to be called when a mouse button has been clicked
(pressed and released) on this
Scene . |
ObjectProperty<EventHandler<? super MouseEvent>> |
onMouseDraggedProperty()
Defines a function to be called when a mouse button is pressed
on this
Scene and then dragged. |
ObjectProperty<EventHandler<? super MouseEvent>> |
onMouseEnteredProperty()
Defines a function to be called when the mouse enters some
Node
of this Scene . |
ObjectProperty<EventHandler<? super MouseEvent>> |
onMouseExitedProperty()
Defines a function to be called when the mouse exits some
Node
of this Scene . |
ObjectProperty<EventHandler<? super MouseEvent>> |
onMouseMovedProperty()
Defines a function to be called when mouse cursor moves within
this
Scene but no buttons have been pushed. |
ObjectProperty<EventHandler<? super MouseEvent>> |
onMousePressedProperty()
Defines a function to be called when a mouse button
has been pressed on this
Scene . |
ObjectProperty<EventHandler<? super MouseEvent>> |
onMouseReleasedProperty()
Defines a function to be called when a mouse button
has been released on this
Scene . |
ObjectProperty<EventHandler<? super ScrollEvent>> |
onScrollProperty()
Defines a function to be called when user performs a scrolling action.
|
<T extends Event> |
removeEventFilter(EventType<T> eventType,
EventHandler<? super T> eventFilter)
Unregisters a previously registered event filter from this scene.
|
<T extends Event> |
removeEventHandler(EventType<T> eventType,
EventHandler<? super T> eventHandler)
Unregisters a previously registered event handler from this scene.
|
void |
removeMnemonic(Mnemonic m)
Unregisters the specified mnemonic.
|
ObjectProperty<Parent> |
rootProperty()
Defines the root
Node of the scene graph. |
void |
setCamera(Camera value)
Specifies the type of camera use for rendering this
Scene . |
void |
setCursor(Cursor value)
Defines the mouse cursor for this
Scene . |
void |
setEventDispatcher(EventDispatcher value)
Specifies the event dispatcher for this scene.
|
protected <T extends Event> |
setEventHandler(EventType<T> eventType,
EventHandler<? super T> eventHandler)
Sets the handler to use for this event type.
|
void |
setFill(Paint value)
Defines the background fill of this
Scene . |
void |
setOnDragDetected(EventHandler<? super MouseEvent> value)
Defines a function to be called when drag gesture has been
detected.
|
void |
setOnDragDone(EventHandler<? super DragEvent> value)
Defines a function to be called when this @{code Scene} is a
drag and drop gesture source after its data has
been dropped on a drop target.
|
void |
setOnDragDropped(EventHandler<? super DragEvent> value)
Defines a function to be called when the mouse button is released
on this
Scene during drag and drop gesture. |
void |
setOnDragEntered(EventHandler<? super DragEvent> value)
Defines a function to be called when drag gesture
enters this
Scene . |
void |
setOnDragExited(EventHandler<? super DragEvent> value)
Defines a function to be called when drag gesture
exits this
Scene . |
void |
setOnDragOver(EventHandler<? super DragEvent> value)
Defines a function to be called when drag gesture progresses
within this
Scene . |
void |
setOnInputMethodTextChanged(EventHandler<? super InputMethodEvent> value)
Defines a function to be called when this
Node
has input focus and the input method text has changed. |
void |
setOnKeyPressed(EventHandler<? super KeyEvent> value)
Defines a function to be called when some
Node of this
Scene has input focus and a key has been pressed. |
void |
setOnKeyReleased(EventHandler<? super KeyEvent> value)
Defines a function to be called when some
Node of this
Scene has input focus and a key has been released. |
void |
setOnKeyTyped(EventHandler<? super KeyEvent> value)
Defines a function to be called when some
Node of this
Scene has input focus and a key has been typed. |
void |
setOnMouseClicked(EventHandler<? super MouseEvent> value)
Defines a function to be called when a mouse button has been clicked
(pressed and released) on this
Scene . |
void |
setOnMouseDragged(EventHandler<? super MouseEvent> value)
Defines a function to be called when a mouse button is pressed
on this
Scene and then dragged. |
void |
setOnMouseEntered(EventHandler<? super MouseEvent> value)
Defines a function to be called when the mouse enters some
Node
of this Scene . |
void |
setOnMouseExited(EventHandler<? super MouseEvent> value)
Defines a function to be called when the mouse exits some
Node
of this Scene . |
void |
setOnMouseMoved(EventHandler<? super MouseEvent> value)
Defines a function to be called when mouse cursor moves within
this
Scene but no buttons have been pushed. |
void |
setOnMousePressed(EventHandler<? super MouseEvent> value)
Defines a function to be called when a mouse button
has been pressed on this
Scene . |
void |
setOnMouseReleased(EventHandler<? super MouseEvent> value)
Defines a function to be called when a mouse button
has been released on this
Scene . |
void |
setOnScroll(EventHandler<? super ScrollEvent> value)
Defines a function to be called when user performs a scrolling action.
|
void |
setRoot(Parent value)
Defines the root
Node of the scene graph. |
Dragboard |
startDragAndDrop(TransferMode... transferModes)
Confirms a potential drag and drop gesture that is recognized over this
Scene . |
ReadOnlyDoubleProperty |
widthProperty()
The width of this
Scene |
ReadOnlyObjectProperty<Window> |
windowProperty()
The
Window for this Scene |
ReadOnlyDoubleProperty |
xProperty()
The horizontal location of this
Scene on the Window . |
ReadOnlyDoubleProperty |
yProperty()
The vertical location of this
Scene on the Window . |
Window
for this Scene
getWindow()
Scene
on the Window
.getX()
Scene
on the Window
.getY()
Scene
getWidth()
Scene
getHeight()
Scene
.
If camera
is null, a parallel camera is used for rendering.
Note: this is a conditional feature. See
ConditionalFeature.SCENE3D
for more information.
getCamera()
,
setCamera(Camera)
Scene
. Both a null
value meaning paint no background and a Paint
with transparency are supported, but what is painted behind it will
depend on the platform. The default value is the color white.getFill()
,
setFill(Paint)
Node
of the scene graph.
If a Group
is used as the root, the
contents of the scene graph will be clipped by the scene's width and height and
changes to the scene's size (if user resizes the stage) will not alter the
layout of the scene graph. If a resizable node (layout Region
or
Control
) is set as the root, then the root's size will track the
scene's size, causing the contents to be relayed out as necessary.getRoot()
,
setRoot(Parent)
Scene
.getCursor()
,
setCursor(Cursor)
EventDispatcher
, the new dispatcher should forward
events to the replaced dispatcher to keep the scene's default event
handling behavior.Scene
.Scene
and then dragged.Node
of this Scene
.Node
of this Scene
.Scene
but no buttons have been pushed.Scene
.Scene
.getOnScroll()
,
setOnScroll(EventHandler)
Scene
.Scene
.Scene
.getOnDragOver()
,
setOnDragOver(EventHandler)
transferMode
of the
event shows what just happened at the drop target.
If transferMode
has the value MOVE
, then the source can
clear out its data. Clearing the source's data gives the appropriate
appearance to a user that the data has been moved by the drag and drop
gesture. A transferMode
that has the value NONE
indicates that no data was transferred during the drag and drop gesture.getOnDragDone()
,
setOnDragDone(EventHandler)
Node
of this
Scene
has input focus and a key has been pressed. The function
is called only if the event hasn't been already consumed during its
capturing or bubbling phase.Node
of this
Scene
has input focus and a key has been released. The function
is called only if the event hasn't been already consumed during its
capturing or bubbling phase.Node
of this
Scene
has input focus and a key has been typed. The function
is called only if the event hasn't been already consumed during its
capturing or bubbling phase.getOnKeyTyped()
,
setOnKeyTyped(EventHandler)
Node
has input focus and the input method text has changed. If this
function is not defined in this Node
, then it
receives the result string of the input method composition as a
series of onKeyTyped
function calls.
When the Node
loses the input focus, the JavaFX runtime
automatically commits the existing composed text if any.public Scene(Parent root)
root
- The root node of the scene graphjava.lang.IllegalStateException
- if this constructor is called on a thread
other than the JavaFX Application Thread.public Scene(Parent root, double width, double height)
root
- The root node of the scene graphwidth
- The width of the sceneheight
- The height of the scenejava.lang.IllegalStateException
- if this constructor is called on a thread
other than the JavaFX Application Thread.public Scene(Parent root, Paint fill)
root
- The parentfill
- The filljava.lang.IllegalStateException
- if this constructor is called on a thread
other than the JavaFX Application Thread.public Scene(Parent root, double width, double height, Paint fill)
root
- The root node of the scene graphwidth
- The width of the sceneheight
- The height of the scenefill
- The filljava.lang.IllegalStateException
- if this constructor is called on a thread
other than the JavaFX Application Thread.public Scene(Parent root, double width, double height, boolean depthBuffer)
root
- The root node of the scene graphwidth
- The width of the sceneheight
- The height of the scenedepthBuffer
- The depth buffer flag
The depthBuffer flag is a conditional feature and its default value is
false. See
ConditionalFeature.SCENE3D
for more information.
java.lang.IllegalStateException
- if this constructor is called on a thread
other than the JavaFX Application Thread.Node.setDepthTest(DepthTest)
public final Window getWindow()
Window
for this Scene
public final ReadOnlyObjectProperty<Window> windowProperty()
Window
for this Scene
getWindow()
public final double getX()
Scene
on the Window
.public final ReadOnlyDoubleProperty xProperty()
Scene
on the Window
.getX()
public final double getY()
Scene
on the Window
.public final ReadOnlyDoubleProperty yProperty()
Scene
on the Window
.getY()
public final double getWidth()
Scene
public final ReadOnlyDoubleProperty widthProperty()
Scene
getWidth()
public final double getHeight()
Scene
public final ReadOnlyDoubleProperty heightProperty()
Scene
getHeight()
public final void setCamera(Camera value)
Scene
.
If camera
is null, a parallel camera is used for rendering.
Note: this is a conditional feature. See
ConditionalFeature.SCENE3D
for more information.
public final Camera getCamera()
Scene
.
If camera
is null, a parallel camera is used for rendering.
Note: this is a conditional feature. See
ConditionalFeature.SCENE3D
for more information.
public final ObjectProperty<Camera> cameraProperty()
Scene
.
If camera
is null, a parallel camera is used for rendering.
Note: this is a conditional feature. See
ConditionalFeature.SCENE3D
for more information.
getCamera()
,
setCamera(Camera)
public final void setFill(Paint value)
Scene
. Both a null
value meaning paint no background and a Paint
with transparency are supported, but what is painted behind it will
depend on the platform. The default value is the color white.public final Paint getFill()
Scene
. Both a null
value meaning paint no background and a Paint
with transparency are supported, but what is painted behind it will
depend on the platform. The default value is the color white.public final ObjectProperty<Paint> fillProperty()
Scene
. Both a null
value meaning paint no background and a Paint
with transparency are supported, but what is painted behind it will
depend on the platform. The default value is the color white.getFill()
,
setFill(Paint)
public final void setRoot(Parent value)
Node
of the scene graph.
If a Group
is used as the root, the
contents of the scene graph will be clipped by the scene's width and height and
changes to the scene's size (if user resizes the stage) will not alter the
layout of the scene graph. If a resizable node (layout Region
or
Control
) is set as the root, then the root's size will track the
scene's size, causing the contents to be relayed out as necessary.public final Parent getRoot()
Node
of the scene graph.
If a Group
is used as the root, the
contents of the scene graph will be clipped by the scene's width and height and
changes to the scene's size (if user resizes the stage) will not alter the
layout of the scene graph. If a resizable node (layout Region
or
Control
) is set as the root, then the root's size will track the
scene's size, causing the contents to be relayed out as necessary.public final ObjectProperty<Parent> rootProperty()
Node
of the scene graph.
If a Group
is used as the root, the
contents of the scene graph will be clipped by the scene's width and height and
changes to the scene's size (if user resizes the stage) will not alter the
layout of the scene graph. If a resizable node (layout Region
or
Control
) is set as the root, then the root's size will track the
scene's size, causing the contents to be relayed out as necessary.getRoot()
,
setRoot(Parent)
public final void setCursor(Cursor value)
Scene
.public final Cursor getCursor()
Scene
.public final ObjectProperty<Cursor> cursorProperty()
Scene
.getCursor()
,
setCursor(Cursor)
public Node lookup(java.lang.String selector)
selector
- The css selector to look upNode
in the scene which matches the CSS selector
,
or null
if none is found.public final ObservableList<java.lang.String> getStylesheets()
public final boolean isDepthBuffer()
public final void setEventDispatcher(EventDispatcher value)
EventDispatcher
, the new dispatcher should forward
events to the replaced dispatcher to keep the scene's default event
handling behavior.public final EventDispatcher getEventDispatcher()
EventDispatcher
, the new dispatcher should forward
events to the replaced dispatcher to keep the scene's default event
handling behavior.public final ObjectProperty<EventDispatcher> eventDispatcherProperty()
EventDispatcher
, the new dispatcher should forward
events to the replaced dispatcher to keep the scene's default event
handling behavior.public final <T extends Event> void addEventHandler(EventType<T> eventType, EventHandler<? super T> eventHandler)
Event
of the specified type during the bubbling
phase of event delivery.T
- the specific event class of the handlereventType
- the type of the events to receive by the handlereventHandler
- the handler to registerpublic final <T extends Event> void removeEventHandler(EventType<T> eventType, EventHandler<? super T> eventHandler)
T
- the specific event class of the handlereventType
- the event type from which to unregistereventHandler
- the handler to unregisterpublic final <T extends Event> void addEventFilter(EventType<T> eventType, EventHandler<? super T> eventFilter)
Event
of the specified type during the
capturing phase of event delivery.T
- the specific event class of the filtereventType
- the type of the events to receive by the filtereventFilter
- the filter to registerpublic final <T extends Event> void removeEventFilter(EventType<T> eventType, EventHandler<? super T> eventFilter)
T
- the specific event class of the filtereventType
- the event type from which to unregistereventFilter
- the filter to unregisterprotected final <T extends Event> void setEventHandler(EventType<T> eventType, EventHandler<? super T> eventHandler)
T
- the specific event class of the handlereventType
- the event type to associate with the given eventHandlereventHandler
- the handler to register, or null to unregisterpublic void addMnemonic(Mnemonic m)
m
- The mnemonicpublic void removeMnemonic(Mnemonic m)
m
- The mnemonicpublic ObservableMap<KeyCombination,ObservableList<Mnemonic>> getMnemonics()
Scene
.public ObservableMap<KeyCombination,java.lang.Runnable> getAccelerators()
Scene
.public EventDispatchChain buildEventDispatchChain(EventDispatchChain tail)
buildEventDispatchChain
in interface EventTarget
tail
- the initial chain to build frompublic final void setOnMouseClicked(EventHandler<? super MouseEvent> value)
Scene
.public final EventHandler<? super MouseEvent> getOnMouseClicked()
Scene
.public final ObjectProperty<EventHandler<? super MouseEvent>> onMouseClickedProperty()
Scene
.public final void setOnMouseDragged(EventHandler<? super MouseEvent> value)
Scene
and then dragged.public final EventHandler<? super MouseEvent> getOnMouseDragged()
Scene
and then dragged.public final ObjectProperty<EventHandler<? super MouseEvent>> onMouseDraggedProperty()
Scene
and then dragged.public final void setOnMouseEntered(EventHandler<? super MouseEvent> value)
Node
of this Scene
.public final EventHandler<? super MouseEvent> getOnMouseEntered()
Node
of this Scene
.public final ObjectProperty<EventHandler<? super MouseEvent>> onMouseEnteredProperty()
Node
of this Scene
.public final void setOnMouseExited(EventHandler<? super MouseEvent> value)
Node
of this Scene
.public final EventHandler<? super MouseEvent> getOnMouseExited()
Node
of this Scene
.public final ObjectProperty<EventHandler<? super MouseEvent>> onMouseExitedProperty()
Node
of this Scene
.public final void setOnMouseMoved(EventHandler<? super MouseEvent> value)
Scene
but no buttons have been pushed.public final EventHandler<? super MouseEvent> getOnMouseMoved()
Scene
but no buttons have been pushed.public final ObjectProperty<EventHandler<? super MouseEvent>> onMouseMovedProperty()
Scene
but no buttons have been pushed.public final void setOnMousePressed(EventHandler<? super MouseEvent> value)
Scene
.public final EventHandler<? super MouseEvent> getOnMousePressed()
Scene
.public final ObjectProperty<EventHandler<? super MouseEvent>> onMousePressedProperty()
Scene
.public final void setOnMouseReleased(EventHandler<? super MouseEvent> value)
Scene
.public final EventHandler<? super MouseEvent> getOnMouseReleased()
Scene
.public final ObjectProperty<EventHandler<? super MouseEvent>> onMouseReleasedProperty()
Scene
.public final void setOnDragDetected(EventHandler<? super MouseEvent> value)
public final EventHandler<? super MouseEvent> getOnDragDetected()
public final ObjectProperty<EventHandler<? super MouseEvent>> onDragDetectedProperty()
public final void setOnScroll(EventHandler<? super ScrollEvent> value)
public final EventHandler<? super ScrollEvent> getOnScroll()
public final ObjectProperty<EventHandler<? super ScrollEvent>> onScrollProperty()
getOnScroll()
,
setOnScroll(EventHandler)
public final void setOnDragEntered(EventHandler<? super DragEvent> value)
Scene
.public final EventHandler<? super DragEvent> getOnDragEntered()
Scene
.public final ObjectProperty<EventHandler<? super DragEvent>> onDragEnteredProperty()
Scene
.public final void setOnDragExited(EventHandler<? super DragEvent> value)
Scene
.public final EventHandler<? super DragEvent> getOnDragExited()
Scene
.public final ObjectProperty<EventHandler<? super DragEvent>> onDragExitedProperty()
Scene
.public final void setOnDragOver(EventHandler<? super DragEvent> value)
Scene
.public final EventHandler<? super DragEvent> getOnDragOver()
Scene
.public final ObjectProperty<EventHandler<? super DragEvent>> onDragOverProperty()
Scene
.getOnDragOver()
,
setOnDragOver(EventHandler)
public final void setOnDragDropped(EventHandler<? super DragEvent> value)
public final EventHandler<? super DragEvent> getOnDragDropped()
public final ObjectProperty<EventHandler<? super DragEvent>> onDragDroppedProperty()
public final void setOnDragDone(EventHandler<? super DragEvent> value)
transferMode
of the
event shows what just happened at the drop target.
If transferMode
has the value MOVE
, then the source can
clear out its data. Clearing the source's data gives the appropriate
appearance to a user that the data has been moved by the drag and drop
gesture. A transferMode
that has the value NONE
indicates that no data was transferred during the drag and drop gesture.public final EventHandler<? super DragEvent> getOnDragDone()
transferMode
of the
event shows what just happened at the drop target.
If transferMode
has the value MOVE
, then the source can
clear out its data. Clearing the source's data gives the appropriate
appearance to a user that the data has been moved by the drag and drop
gesture. A transferMode
that has the value NONE
indicates that no data was transferred during the drag and drop gesture.public final ObjectProperty<EventHandler<? super DragEvent>> onDragDoneProperty()
transferMode
of the
event shows what just happened at the drop target.
If transferMode
has the value MOVE
, then the source can
clear out its data. Clearing the source's data gives the appropriate
appearance to a user that the data has been moved by the drag and drop
gesture. A transferMode
that has the value NONE
indicates that no data was transferred during the drag and drop gesture.getOnDragDone()
,
setOnDragDone(EventHandler)
public Dragboard startDragAndDrop(TransferMode... transferModes)
Scene
.
Can be called only from a DRAG_DETECTED event handler. The returned
Dragboard
is used to transfer data during
the drag and drop gesture. Placing this Scene
's data on the
Dragboard
also identifies this Scene
as the source of
the drag and drop gesture.
More detail about drag and drop gestures is described in the overivew
of DragEvent
.transferModes
- The supported TransferMode
(s) of this Node
Dragboard
to place this Scene
's data onjava.lang.IllegalStateException
- if drag and drop cannot be started at this
moment (it's called outside of DRAG_DETECTED
event handling).DragEvent
public final void setOnKeyPressed(EventHandler<? super KeyEvent> value)
Node
of this
Scene
has input focus and a key has been pressed. The function
is called only if the event hasn't been already consumed during its
capturing or bubbling phase.public final EventHandler<? super KeyEvent> getOnKeyPressed()
Node
of this
Scene
has input focus and a key has been pressed. The function
is called only if the event hasn't been already consumed during its
capturing or bubbling phase.public final ObjectProperty<EventHandler<? super KeyEvent>> onKeyPressedProperty()
Node
of this
Scene
has input focus and a key has been pressed. The function
is called only if the event hasn't been already consumed during its
capturing or bubbling phase.public final void setOnKeyReleased(EventHandler<? super KeyEvent> value)
Node
of this
Scene
has input focus and a key has been released. The function
is called only if the event hasn't been already consumed during its
capturing or bubbling phase.public final EventHandler<? super KeyEvent> getOnKeyReleased()
Node
of this
Scene
has input focus and a key has been released. The function
is called only if the event hasn't been already consumed during its
capturing or bubbling phase.public final ObjectProperty<EventHandler<? super KeyEvent>> onKeyReleasedProperty()
Node
of this
Scene
has input focus and a key has been released. The function
is called only if the event hasn't been already consumed during its
capturing or bubbling phase.public final void setOnKeyTyped(EventHandler<? super KeyEvent> value)
Node
of this
Scene
has input focus and a key has been typed. The function
is called only if the event hasn't been already consumed during its
capturing or bubbling phase.public final EventHandler<? super KeyEvent> getOnKeyTyped()
Node
of this
Scene
has input focus and a key has been typed. The function
is called only if the event hasn't been already consumed during its
capturing or bubbling phase.public final ObjectProperty<EventHandler<? super KeyEvent>> onKeyTypedProperty()
Node
of this
Scene
has input focus and a key has been typed. The function
is called only if the event hasn't been already consumed during its
capturing or bubbling phase.getOnKeyTyped()
,
setOnKeyTyped(EventHandler)
public final void setOnInputMethodTextChanged(EventHandler<? super InputMethodEvent> value)
Node
has input focus and the input method text has changed. If this
function is not defined in this Node
, then it
receives the result string of the input method composition as a
series of onKeyTyped
function calls.
When the Node
loses the input focus, the JavaFX runtime
automatically commits the existing composed text if any.public final EventHandler<? super InputMethodEvent> getOnInputMethodTextChanged()
Node
has input focus and the input method text has changed. If this
function is not defined in this Node
, then it
receives the result string of the input method composition as a
series of onKeyTyped
function calls.
When the Node
loses the input focus, the JavaFX runtime
automatically commits the existing composed text if any.public final ObjectProperty<EventHandler<? super InputMethodEvent>> onInputMethodTextChangedProperty()
Node
has input focus and the input method text has changed. If this
function is not defined in this Node
, then it
receives the result string of the input method composition as a
series of onKeyTyped
function calls.
When the Node
loses the input focus, the JavaFX runtime
automatically commits the existing composed text if any.Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved. Use is subject to