Spec-Zone .ru
спецификации, руководства, описания, API
|
public final class TouchPoint
extends java.lang.Object
TouchEvent
.
The touch point has its coordinates, state (see TouchPoint.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 |
---|---|
static class |
TouchPoint.State
Represents current state of the touch point
|
Modifier and Type | Method and Description |
---|---|
boolean |
belongsTo(EventTarget target)
Distinguishes between touch points targeted to the given node or some
of its children from touch points targeted somewhere else.
|
EventTarget |
getGrabbed()
Gets event target which has grabbed this touch point.
|
int |
getId()
Gets identifier of this touch point.
|
double |
getSceneX()
Gets the horizontal position of the touch point relative to the
origin of the
Scene that contains the TouchEvent's source. |
double |
getSceneY()
Gets the vertical position of the touch point relative to the
origin of the
Scene that contains the TouchEvent's source. |
double |
getScreenX()
Gets the absolute horizontal position of the touch point.
|
double |
getScreenY()
Gets the absolute vertical position of the touch point.
|
TouchPoint.State |
getState()
Gets state of this touch point
|
EventTarget |
getTarget()
Gets event target on which the touch event carrying this touch point
is fired.
|
double |
getX()
Gets the horizontal position of the touch point relative to the
origin of the TouchEvent's source.
|
double |
getY()
Gets the vertical position of the touch point relative to the
origin of the TouchEvent's source.
|
void |
grab()
Grabs this touch point by current event source.
|
void |
grab(EventTarget target)
Grabs this touch point by the given target.
|
java.lang.String |
toString()
Returns a string representation of this
TouchPoint object. |
void |
ungrab() |
public boolean belongsTo(EventTarget target)
target
- Node or other event target to be testedpublic EventTarget getGrabbed()
public void grab()
public void grab(EventTarget target)
target
- Target by which to grab the touch pointpublic void ungrab()
public final int getId()
1
, each subsequently pressed touch points gets the next ordinal
number until all touch points are released and the counter is reset.public final TouchPoint.State getState()
public final double getX()
public final double getY()
public final double getScreenX()
public final double getScreenY()
public final double getSceneX()
Scene
that contains the TouchEvent'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 TouchEvent's node.Scene
that contains the TouchEvent's sourcepublic final double getSceneY()
Scene
that contains the TouchEvent'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 TouchEvent's node.Scene
that contains the TouchEvent's sourcepublic EventTarget getTarget()
public java.lang.String toString()
TouchPoint
object.toString
in class java.lang.Object
TouchPoint
object.Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved. Use is subject to