Package org.loboevolution.events
Interface Touch
public interface Touch
Represents a single contact point on a touch-sensitive device
The contact point is commonly a finger or stylus and the device may be a touchscreen or trackpad.
The contact point is commonly a finger or stylus and the device may be a touchscreen or trackpad.
-
Method Summary
Modifier and TypeMethodDescriptiondouble
Returns the horizontal position of the touch on the client window of user's screen, excluding any scroll offset.double
Returns the vertical position of the touch on the client window of the user's screen, excluding any scroll offset.double
getForce()
Returns the amount of pressure being applied to the surface by the user, as a double between 0.0 (no pressure) and 1.0 (maximum pressure).double
Returns a unique identifier for this touch object.
A given touch point (say, by a finger) will have the same identifier for the duration of its movement around the surface.
This lets you ensure that you're tracking the same touch all the time.double
getPageX()
Returns the horizontal position of the touch on the client window of user's screen, including any scroll offset.double
getPageY()
Returns the horizontal position of the touch on the client window of user's screen, including any scroll offset.double
Returns the X radius of the ellipse that most closely circumscribes the area of contact with the screen.
The value is in pixels of the same scale as screenX.double
Returns the Y radius of the ellipse that most closely circumscribes the area of contact with the screen.
The value is in pixels of the same scale as screenY.double
Returns the angle (in degrees) that the ellipse described by radiusX and radiusY must be rotated, clockwise, to most accurately cover the area of contact between the user and the surface.double
Returns the horizontal position of the touch on the user's screen.double
Returns the vertical position of the touch on the user's screen.Returns the element on which the touch point started when it was first placed on the surface, even if the touch point has since moved outside the interactive area of that element or even been removed from the document.
-
Method Details
-
getIdentifier
double getIdentifier()Returns a unique identifier for this touch object.
A given touch point (say, by a finger) will have the same identifier for the duration of its movement around the surface.
This lets you ensure that you're tracking the same touch all the time.- Returns:
- a unique identifier for this touch object
-
getTarget
EventTarget getTarget()Returns the element on which the touch point started when it was first placed on the surface, even if the touch point has since moved outside the interactive area of that element or even been removed from the document.- Returns:
- the element on which the touch point started when it was first placed on the surface
-
getClientX
double getClientX()Returns the horizontal position of the touch on the client window of user's screen, excluding any scroll offset.- Returns:
- the horizontal position of the touch on the client window of user's screen, excluding any scroll offset
-
getClientY
double getClientY()Returns the vertical position of the touch on the client window of the user's screen, excluding any scroll offset.- Returns:
- the vertical position of the touch on the client window of the user's screen, excluding any scroll offset
-
getScreenX
double getScreenX()Returns the horizontal position of the touch on the user's screen.- Returns:
- the horizontal position of the touch on the user's screen.
-
getScreenY
double getScreenY()Returns the vertical position of the touch on the user's screen.- Returns:
- the vertical position of the touch on the user's screen
-
getPageX
double getPageX()Returns the horizontal position of the touch on the client window of user's screen, including any scroll offset.- Returns:
- the horizontal position of the touch on the client window of user's screen, including any scroll offset
-
getPageY
double getPageY()Returns the horizontal position of the touch on the client window of user's screen, including any scroll offset.- Returns:
- the horizontal position of the touch on the client window of user's screen, including any scroll offset
-
getRadiusX
double getRadiusX()Returns the X radius of the ellipse that most closely circumscribes the area of contact with the screen.
The value is in pixels of the same scale as screenX.- Returns:
- the X radius of the ellipse that most closely circumscribes the area of contact with the screen
-
getRadiusY
double getRadiusY()Returns the Y radius of the ellipse that most closely circumscribes the area of contact with the screen.
The value is in pixels of the same scale as screenY.- Returns:
- the Y radius of the ellipse that most closely circumscribes the area of contact with the screen
-
getRotationAngle
double getRotationAngle()Returns the angle (in degrees) that the ellipse described by radiusX and radiusY must be rotated, clockwise, to most accurately cover the area of contact between the user and the surface.- Returns:
- the angle (in degrees) that the ellipse described by radiusX and radiusY must be rotated, clockwise, to most accurately cover the area of contact between the user and the surface
-
getForce
double getForce()Returns the amount of pressure being applied to the surface by the user, as a double between 0.0 (no pressure) and 1.0 (maximum pressure).- Returns:
- the amount of pressure being applied to the surface by the user
-