Class BaseTouch


  • @JsType(isNative=true,
            name="Touch",
            namespace="<global>")
    public final class BaseTouch
    extends Object
    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.
    Author:
    Andrea "Stock" Stocchero
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      double getClientX()
      Returns the X coordinate of the touch point relative to the left edge of the browser viewport, not including any scroll offset.
      double getClientY()
      Returns the Y coordinate of the touch point relative to the top edge of the browser viewport, not including 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).
      int 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.
      double getPageX()
      Returns the X coordinate of the touch point relative to the left edge of the document.
      Unlike clientX, this value includes the horizontal scroll offset, if any.
      double getPageY()
      Returns the Y coordinate of the touch point relative to the top of the document.
      Unlike clientY, this value includes the vertical scroll offset, if any.
      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.
      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.
      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.
      double getScreenX()
      Returns the X coordinate of the touch point relative to the left edge of the screen.
      double getScreenY()
      Returns the Y coordinate of the touch point relative to the top edge of the screen.
      BaseEventTarget 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.
    • Method Detail

      • getClientX

        @JsProperty
        public double getClientX()
        Returns the X coordinate of the touch point relative to the left edge of the browser viewport, not including any scroll offset.
        Returns:
        the X coordinate of the touch point relative to the left edge of the browser viewport, not including any scroll offset
      • getClientY

        @JsProperty
        public double getClientY()
        Returns the Y coordinate of the touch point relative to the top edge of the browser viewport, not including any scroll offset.
        Returns:
        the Y coordinate of the touch point relative to the top edge of the browser viewport, not including any scroll offset
      • getForce

        @JsProperty
        public 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
      • getIdentifier

        @JsProperty
        public int 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
      • getPageX

        @JsProperty
        public double getPageX()
        Returns the X coordinate of the touch point relative to the left edge of the document.
        Unlike clientX, this value includes the horizontal scroll offset, if any.
        Returns:
        the X coordinate of the touch point relative to the left edge of the document
      • getPageY

        @JsProperty
        public double getPageY()
        Returns the Y coordinate of the touch point relative to the top of the document.
        Unlike clientY, this value includes the vertical scroll offset, if any.
        Returns:
        the Y coordinate of the touch point relative to the top of the document
      • getRadiusX

        @JsProperty
        public 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

        @JsProperty
        public 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

        @JsProperty
        public 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
      • getScreenX

        @JsProperty
        public double getScreenX()
        Returns the X coordinate of the touch point relative to the left edge of the screen.
        Returns:
        the X coordinate of the touch point relative to the left edge of the screen
      • getScreenY

        @JsProperty
        public double getScreenY()
        Returns the Y coordinate of the touch point relative to the top edge of the screen.
        Returns:
        the Y coordinate of the touch point relative to the top edge of the screen
      • getTarget

        @JsProperty
        public BaseEventTarget 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