public abstract class AbstractFXMouseDragGesture extends AbstractFXGesture
press(Node, MouseEvent)
,
drag(Node, MouseEvent, double, double)
, and
release(Node, MouseEvent, double, double)
methods.Constructor and Description |
---|
AbstractFXMouseDragGesture() |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
drag(javafx.scene.Node target,
javafx.scene.input.MouseEvent event,
double dx,
double dy)
This method is called upon
MouseEvent.MOUSE_DRAGGED events. |
javafx.scene.Node |
getPressed()
Returns the currently pressed
Node . |
protected void |
onMouseEvent(javafx.scene.input.MouseEvent event)
This method is called for *any*
MouseEvent that occurs in the
Scene where this gesture is currently registered. |
protected void |
onMousePress(javafx.scene.input.MouseEvent event)
This method is called when a
MouseEvent.MOUSE_PRESSED event
occurs in the Scene where this gesture is currently registered. |
protected abstract void |
press(javafx.scene.Node target,
javafx.scene.input.MouseEvent event)
This method is called upon
MouseEvent.MOUSE_PRESSED events. |
protected void |
register()
Called when a
Scene is provided. |
protected abstract void |
release(javafx.scene.Node target,
javafx.scene.input.MouseEvent event,
double dx,
double dy)
This method is called upon
MouseEvent.MOUSE_RELEASED events. |
protected void |
unregister()
Called when the
Scene is removed. |
getScene, setScene
protected abstract void drag(javafx.scene.Node target, javafx.scene.input.MouseEvent event, double dx, double dy)
MouseEvent.MOUSE_DRAGGED
events.target
- The event target.event
- The corresponding MouseEvent
.dx
- The horizontal displacement from the mouse press location.dy
- The vertical displacement from the mouse press location.public javafx.scene.Node getPressed()
Node
.Node
.protected void onMouseEvent(javafx.scene.input.MouseEvent event)
MouseEvent
that occurs in the
Scene
where this gesture is currently registered. It processes
MouseEvent.MOUSE_DRAGGED
and MouseEvent.MOUSE_RELEASED
events if the gesture was previously initiated (pressed node is known).event
- The MouseEvent
to process.onMousePress(MouseEvent)
protected void onMousePress(javafx.scene.input.MouseEvent event)
MouseEvent.MOUSE_PRESSED
event
occurs in the Scene
where this gesture is currently registered.
This initiates the gesture and activates processing of drag and release
events.event
- The MouseEvent
to process.onMouseEvent(MouseEvent)
protected abstract void press(javafx.scene.Node target, javafx.scene.input.MouseEvent event)
MouseEvent.MOUSE_PRESSED
events.target
- The event target.event
- The corresponding MouseEvent
.protected void register()
AbstractFXGesture
Scene
is provided. The new Scene
can be
obtained via AbstractFXGesture.getScene()
. Event handlers are registered here.register
in class AbstractFXGesture
protected abstract void release(javafx.scene.Node target, javafx.scene.input.MouseEvent event, double dx, double dy)
MouseEvent.MOUSE_RELEASED
events. This
method is also called for other mouse events, when a mouse release event
was not fired, but was detected otherwise (probably only possible when
using the JavaFX/SWT integration).target
- The event target.event
- The corresponding MouseEvent
.dx
- The horizontal displacement from the mouse press location.dy
- The vertical displacement from the mouse press location.protected void unregister()
AbstractFXGesture
Scene
is removed. You can obtain the old
Scene
via AbstractFXGesture.getScene()
so that event handlers can be
unregistered.unregister
in class AbstractFXGesture
Copyright (c) 2014 itemis AG and others. All rights reserved.