public abstract class AbstractMouseDragGesture extends AbstractGesture
press(Node, MouseEvent)
,
drag(Node, MouseEvent, double, double)
, and
release(Node, MouseEvent, double, double)
methods.Constructor and Description |
---|
AbstractMouseDragGesture() |
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 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.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()
AbstractGesture
Scene
is provided. The new Scene
can be
obtained via AbstractGesture.getScene()
. Event handlers are registered here.register
in class AbstractGesture
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()
AbstractGesture
Scene
is removed. You can obtain the old
Scene
via AbstractGesture.getScene()
so that event handlers can be
unregistered.unregister
in class AbstractGesture
Copyright (c) 2014 itemis AG and others. All rights reserved.