public class GestureEvent extends InputEvent
Delivery of gestures is dependent on the capabilities of the underlying platform and connected input devices. For instance on a PC with mouse and keyboard there is no way of producing a rotating gesture.
Modifier and Type | Field and Description |
---|---|
static EventType<GestureEvent> |
ANY
Common supertype for all gestures.
|
consumed, eventType, NULL_SOURCE_TARGET, target
source
Modifier | Constructor and Description |
---|---|
protected |
GestureEvent(EventType<? extends GestureEvent> eventType)
Deprecated.
Do not use this constructor. Constructs empty event.
|
protected |
GestureEvent(EventType<? extends GestureEvent> eventType,
double x,
double y,
double screenX,
double screenY,
boolean shiftDown,
boolean controlDown,
boolean altDown,
boolean metaDown,
boolean direct,
boolean inertia,
PickResult pickResult)
Constructs new GestureEvent event with empty source and target
|
protected |
GestureEvent(Object source,
EventTarget target,
EventType<? extends GestureEvent> eventType)
Deprecated.
Do not use this constructor. Constructs empty event.
|
protected |
GestureEvent(Object source,
EventTarget target,
EventType<? extends GestureEvent> eventType,
double x,
double y,
double screenX,
double screenY,
boolean shiftDown,
boolean controlDown,
boolean altDown,
boolean metaDown,
boolean direct,
boolean inertia,
PickResult pickResult)
Constructs new GestureEvent event.
|
Modifier and Type | Method and Description |
---|---|
GestureEvent |
copyFor(Object newSource,
EventTarget newTarget)
Creates and returns a copy of this event with the specified event source
and target.
|
EventType<? extends GestureEvent> |
getEventType()
Gets the event type of this event.
|
PickResult |
getPickResult()
Returns information about the pick.
|
double |
getSceneX()
Gets the horizontal position of the event relative to the
origin of the
Scene that contains the event's source. |
double |
getSceneY()
Gets the vertical position of the event relative to the
origin of the
Scene that contains the event's source. |
double |
getScreenX()
Gets the absolute horizontal position of the event.
|
double |
getScreenY()
Gets the absolute vertical position of the event.
|
double |
getX()
Gets the horizontal position of the event relative to the
origin of the event's source.
|
double |
getY()
Gets the vertical position of the event relative to the
origin of the event's source.
|
double |
getZ()
Depth position of the event relative to the
origin of the MouseEvent's source.
|
boolean |
isAltDown()
Indicates whether or not the Alt modifier is down on this event.
|
boolean |
isControlDown()
Indicates whether or not the Control modifier is down on this event.
|
boolean |
isDirect()
Indicates whether this gesture is caused by a direct or indirect input
device.
|
boolean |
isInertia()
Indicates if this event represents an inertia of an already finished
gesture.
|
boolean |
isMetaDown()
Indicates whether or not the Meta modifier is down on this event.
|
boolean |
isShiftDown()
Indicates whether or not the Shift modifier is down on this event.
|
boolean |
isShortcutDown()
Indicates whether or not the host platform common shortcut modifier is
down on this event.
|
String |
toString()
Returns a string representation of this
GestureEvent object. |
getSource
public static final EventType<GestureEvent> ANY
@Deprecated protected GestureEvent(EventType<? extends GestureEvent> eventType)
GestureEvent
.eventType
- Type of the event@Deprecated protected GestureEvent(Object source, EventTarget target, EventType<? extends GestureEvent> eventType)
GestureEvent
.source
- Event sourcetarget
- Event targeteventType
- Type of the eventprotected GestureEvent(Object source, EventTarget target, EventType<? extends GestureEvent> eventType, double x, double y, double screenX, double screenY, boolean shiftDown, boolean controlDown, boolean altDown, boolean metaDown, boolean direct, boolean inertia, PickResult pickResult)
source
- the source of the event. Can be null.target
- the target of the event. Can be null.eventType
- The type of the event.x
- The x with respect to the scene.y
- The y with respect to the scene.screenX
- The x coordinate relative to screen.screenY
- The y coordinate relative to screen.shiftDown
- true if shift modifier was pressed.controlDown
- true if control modifier was pressed.altDown
- true if alt modifier was pressed.metaDown
- true if meta modifier was pressed.direct
- true if the event was caused by direct input device. See isDirect()
inertia
- if represents inertia of an already finished gesture.pickResult
- pick result. Can be null, in this case a 2D pick result
without any further values is constructed
based on the scene coordinates and the targetprotected GestureEvent(EventType<? extends GestureEvent> eventType, double x, double y, double screenX, double screenY, boolean shiftDown, boolean controlDown, boolean altDown, boolean metaDown, boolean direct, boolean inertia, PickResult pickResult)
eventType
- The type of the event.x
- The x with respect to the scene.y
- The y with respect to the scene.screenX
- The x coordinate relative to screen.screenY
- The y coordinate relative to screen.shiftDown
- true if shift modifier was pressed.controlDown
- true if control modifier was pressed.altDown
- true if alt modifier was pressed.metaDown
- true if meta modifier was pressed.direct
- true if the event was caused by direct input device. See isDirect()
inertia
- if represents inertia of an already finished gesture.pickResult
- pick result. Can be null, in this case a 2D pick result
without any further values is constructed
based on the scene coordinatespublic GestureEvent copyFor(Object newSource, EventTarget newTarget)
Event
null
, it is
replaced by the NULL_SOURCE_TARGET
value.public final double getX()
isDirect()
public final double getY()
isDirect()
public final double getZ()
public final double getScreenX()
isDirect()
public final double getScreenY()
isDirect()
public final double getSceneX()
Scene
that contains the event's source.
If the node is not in a Scene
, then the value is relative to
the boundsInParent of the root-most parent of the event's node.
Note that in 3D scene, this represents the flat coordinates after
applying the projection transformations.Scene
that contains the event's sourceisDirect()
public final double getSceneY()
Scene
that contains the event's source.
If the node is not in a Scene
, then the value is relative to
the boundsInParent of the root-most parent of the event's node.
Note that in 3D scene, this represents the flat coordinates after
applying the projection transformations.Scene
that contains the event's sourceisDirect()
public final boolean isShiftDown()
public final boolean isControlDown()
public final boolean isAltDown()
public final boolean isMetaDown()
public final boolean isDirect()
public boolean isInertia()
public final PickResult getPickResult()
public final boolean isShortcutDown()
control
on Windows and meta
(command key) on Mac.true
if the shortcut modifier is down, false
otherwisepublic String toString()
GestureEvent
object.toString
in class EventObject
GestureEvent
object.public EventType<? extends GestureEvent> getEventType()
Event
Event
class can have different event types. These event types further specify
what kind of event occurred.getEventType
in class InputEvent
Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.