TouchEvent.
The touch point has its coordinates, state (see State) and ID. The
ID is sequential number of this touch point unique in scope of a single
multi-touch gesture.
Each touch point is by default delivered to a single node during its whole
trajectory - to the node on which it was pressed. There is a grabbing API
to modify this behavior. The above means that when touch point is pressed,
it is automatically grabbed by the top-most node on the press coordinates.
Any time during the gesture grab() and ungrab() methods
can be used to alter the event delivery target. When grabbed by a different
node, it will next time be targeted to it; when ungrabbed, it will be
always targeted to the top-most node on the current location.
| Modifier and Type | Class and Description |
|---|---|
| public static enum | TouchPoint.
Represents current state of the touch point |
| Modifier and Type | Field and Description |
|---|---|
| private EventTarget | |
| private int | |
| private PickResult | pickResult
Information about the pick if the picked |
| private double | |
| private double | |
| private double | |
| private double | |
| private transient Object | |
| private TouchPoint. | |
| private transient EventTarget | |
| private transient double | |
| private transient double | |
| private transient double | z
Depth z position of the event relative to the origin of the MouseEvent's node. |
| Access | Constructor and Description |
|---|---|
| public | TouchPoint(int
ID of the new touch point id, TouchPoint.state of the new touch point state,The x with respect to the scene. x, double The y with respect to the scene. y, double The x coordinate relative to screen. screenX, double The y coordinate relative to screen. screenY, EventTarget Node or other event target. target, 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 target pickResult)Creates new instance of TouchPoint. |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: true if this touch point is targeted to the given target or some of its childrenNode or other event target to be tested target)Distinguishes between touch points targeted to the given node or some of its children from touch points targeted somewhere else. |
| public EventTarget | Returns: The current grabbed target, null if the touch point is ungrabbedGets event target which has grabbed this touch point. |
| public final int | |
| public final PickResult | Returns: new PickResult object that contains information about the pickReturns information about the pick. |
| public final double | Returns: the horizontal position of the touch point relative to the origin of theScene that contains the TouchEvent's sourceGets the horizontal position of the touch point relative to the
origin of the |
| public final double | Returns: the vertical position of the touch point relative to the origin of theScene that contains the TouchEvent's sourceGets the vertical position of the touch point relative to the
origin of the |
| public final double | Returns: the absolute horizontal position of the touch pointGets the absolute horizontal position of the touch point. |
| public final double | Returns: the absolute vertical position of the touch pointGets the absolute vertical position of the touch point. |
| public final TouchPoint. | |
| public EventTarget | Returns: Event target for this touch pointGets event target on which the touch event carrying this touch point is fired. |
| public final double | Returns: the horizontal position of the touch point relative to the origin of the TouchEvent's source.Gets the horizontal position of the touch point relative to the origin of the TouchEvent's source. |
| public final double | Returns: the vertical position of the touch point relative to the origin of the TouchEvent's source.Gets the vertical position of the touch point relative to the origin of the TouchEvent's source. |
| public final double | Returns: depth position of the event relative to the origin of the MouseEvent's source.Depth position of the event relative to the origin of the MouseEvent's source. |
| public void | |
| public void | grab(EventTarget
Target by which to grab the touch point target)Grabs this touch point by the given target. |
| private void | |
| pack-priv void | recomputeToSource(Object
Source object of the current values oldSource, Object Source object to compute values for newSource)Recomputes this touch point (coordinates, relevancy) for the given event source object. |
| pack-priv void | |
| public String | Returns: a string representation of thisTouchPoint object.Overrides java. Returns a string representation of this |
| public void |
| grabbed | back to summary |
|---|---|
private EventTarget grabbed
| |
| id | back to summary |
|---|---|
private int id
| |
| pickResult | back to summary |
|---|---|
| private PickResult pickResult Information about the pick if the picked | |
| sceneX | back to summary |
|---|---|
private double sceneX
| |
| sceneY | back to summary |
|---|---|
private double sceneY
| |
| screenX | back to summary |
|---|---|
private double screenX
| |
| screenY | back to summary |
|---|---|
private double screenY
| |
| source | back to summary |
|---|---|
| private transient Object source | |
| state | back to summary |
|---|---|
private TouchPoint.
| |
| target | back to summary |
|---|---|
| private transient EventTarget target | |
| x | back to summary |
|---|---|
| private transient double x | |
| y | back to summary |
|---|---|
| private transient double y | |
| z | back to summary |
|---|---|
| private transient double z Depth z position of the event relative to the origin of the MouseEvent's node. | |
| TouchPoint | back to summary |
|---|---|
| public TouchPoint(int id, TouchPoint. Creates new instance of TouchPoint.
| |
| belongsTo | back to summary |
|---|---|
| public boolean belongsTo(EventTarget target) Distinguishes between touch points targeted to the given node or some of its children from touch points targeted somewhere else. This allows for testing all touch points carried by one touch event on their relevance for a given node.
| |
| getGrabbed | back to summary |
|---|---|
| public EventTarget getGrabbed() Gets event target which has grabbed this touch point.
| |
| getId | back to summary |
|---|---|
| public final int getId() Gets identifier of this touch point. The number is sequential and unique
in scope of one multi touch gesture. The first pressed touch point has id
| |
| getPickResult | back to summary |
|---|---|
| public final PickResult getPickResult() Returns information about the pick.
| |
| getSceneX | back to summary |
|---|---|
| public final double getSceneX() Gets the horizontal position of the touch point relative to the
origin of the
| |
| getSceneY | back to summary |
|---|---|
| public final double getSceneY() Gets the vertical position of the touch point relative to the
origin of the
| |
| getScreenX | back to summary |
|---|---|
| public final double getScreenX() Gets the absolute horizontal position of the touch point.
| |
| getScreenY | back to summary |
|---|---|
| public final double getScreenY() Gets the absolute vertical position of the touch point.
| |
| getState | back to summary |
|---|---|
| public final TouchPoint. Gets state of this touch point
| |
| getTarget | back to summary |
|---|---|
| public EventTarget getTarget() Gets event target on which the touch event carrying this touch point is fired.
| |
| getX | back to summary |
|---|---|
| public final double getX() Gets the horizontal position of the touch point relative to the origin of the TouchEvent's source.
| |
| getY | back to summary |
|---|---|
| public final double getY() Gets the vertical position of the touch point relative to the origin of the TouchEvent's source.
| |
| getZ | back to summary |
|---|---|
| public final double getZ() Depth position of the event relative to the origin of the MouseEvent's source.
| |
| grab | back to summary |
|---|---|
| public void grab() Grabs this touch point by current event source. Next event containing this touch point will be targeted to the same node whose event handler called this method. | |
| grab | back to summary |
|---|---|
| public void grab(EventTarget target) Grabs this touch point by the given target. Next event containing this touch point will be targeted to it.
| |
| readObject | back to summary |
|---|---|
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
| |
| recomputeToSource | back to summary |
|---|---|
| pack-priv void recomputeToSource(Object oldSource, Object newSource) Recomputes this touch point (coordinates, relevancy) for the given event source object. | |
| reset | back to summary |
|---|---|
| pack-priv void reset() | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Returns a string representation of this | |
| ungrab | back to summary |
|---|---|
| public void ungrab() Ungrabs this touch point from its target. Since the next event this touch point will be delivered to the top-most node picked on its respective location until it is grabbed again or released. | |
| Modifier and Type | Field and Description |
|---|---|
| public static final TouchPoint. | MOVED
The touch point has been moved |
| public static final TouchPoint. | PRESSED
The touch point has just been pressed (touched for the first time) |
| public static final TouchPoint. | RELEASED
The touch point has been released |
| public static final TouchPoint. | STATIONARY
The touch point remains pressed and still (without moving) |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static TouchPoint. | |
| public static TouchPoint. |
| MOVED | back to summary |
|---|---|
| public static final TouchPoint. The touch point has been moved | |
| PRESSED | back to summary |
|---|---|
| public static final TouchPoint. The touch point has just been pressed (touched for the first time) | |
| RELEASED | back to summary |
|---|---|
| public static final TouchPoint. The touch point has been released | |
| STATIONARY | back to summary |
|---|---|
| public static final TouchPoint. The touch point remains pressed and still (without moving) | |
| State | back to summary |
|---|---|
| private State() | |
| valueOf | back to summary |
|---|---|
| public static TouchPoint. | |
| values | back to summary |
|---|---|
| public static TouchPoint. | |