Class TouchPinchRotateEvent

java.lang.Object
com.luciad.input.touch.TouchPinchRotateEvent
All Implemented Interfaces:
IInputEvent, AutoCloseable

public final class TouchPinchRotateEvent extends Object implements IInputEvent, AutoCloseable
Implementation of IInputEvent representing a 2 pointers gesture.

This class aggregates information related to pinch and rotation in the same event.

  • Method Details Link icon

    • finalize Link icon

      protected void finalize()
      Overrides:
      finalize in class Object
    • close Link icon

      public void close()
      Specified by:
      close in interface AutoCloseable
    • createStartEvent Link icon

      @NotNull public static TouchPinchRotateEvent createStartEvent(@NotNull Coordinate initialCenterLocation, double initialDistance, @NotNull Angle initialAngle, @NotNull Coordinate currentCenterLocation, double currentDistance, @NotNull Angle currentAngle)
      Creates the first TouchPinchRotateEvent of a gesture.

      The initial values refer to the situation at the beginning of the gesture (i.e. before any gesture detection). The current ones contain the values after the gesture detection is done.

      Parameters:
      initialCenterLocation - The center location at the beginning of the gesture, defined in device independent pixels.
      initialDistance - The distance between the pointers at the beginning of the gesture, defined in device independent pixels.
      initialAngle - The absolute angle between the two pointers at the beginning of the gesture.
      currentCenterLocation - The current center location, defined in device independent pixels.
      currentDistance - The current distance between the pointers, defined in device independent pixels.
      currentAngle - The absolute angle between the two pointers. The status of the created event is EventStatus#Start. The information relative to the previous event are std::nullopt.
    • createEvent Link icon

      @NotNull public static TouchPinchRotateEvent createEvent(@NotNull Coordinate initialCenterLocation, double initialDistance, @NotNull Angle initialAngle, @NotNull Coordinate currentCenterLocation, double currentDistance, @NotNull Angle currentAngle, @NotNull Coordinate previousCenterLocation, double previousDistance, @NotNull Angle previousAngle, @NotNull EventStatus status)
      Creates a two pointer event.

      The initial values refer to the situation at the beginning of the gesture (i.e. before any gesture detection).

      Parameters:
      initialCenterLocation - The center location at the beginning of the gesture, defined in device independent pixels.
      initialDistance - The distance between the pointers at the beginning of the gesture, defined in device independent pixels.
      initialAngle - The absolute angle between the two pointers at the beginning of the gesture.
      currentCenterLocation - The current center location, defined in device independent pixels.
      currentDistance - The current distance between the pointers, defined in device independent pixels.
      currentAngle - The absolute angle between the two pointers.
      previousCenterLocation - The center location from the previous event of the gesture, defined in device independent pixels.
      previousDistance - The distance between the pointers from the previous event of the gesture, defined in device independent pixels.
      previousAngle - The absolute angle between the two pointers from the previous event of the gesture.
      status - The status of the gesture.
    • getInitialCenterLocation Link icon

      @NotNull public Coordinate getInitialCenterLocation()
      Returns the location of the center between the 2 starting touch point locations.

      It is expressed in device independent pixels.

      Returns:
      the location of the center between the 2 starting touch point locations.
    • getInitialDistance Link icon

      public double getInitialDistance()
      Returns the span between the initial touch point positions.

      It is expressed in device independent pixels.

      Returns:
      the span between the initial touch point positions.
    • getInitialAngle Link icon

      @NotNull public Angle getInitialAngle()
      Returns the absolute angle between the two touch points at the beginning of the gesture.

      It is defined as the angle between the horizontal of the screen and the line connecting the two pointers. It is measured in degrees and counter-clockwise positive. An angle of 0 refers to the position where the first point is located to the left (west, left on the screen) of the other point.

      Returns:
      the absolute angle between the two touch points at the beginning of the gesture.
    • getCurrentCenterLocation Link icon

      @NotNull public Coordinate getCurrentCenterLocation()
      Returns the location of the current center between the 2 touch points.

      This location is defined in device independent pixels.

      Returns:
      the location of the current center between the 2 touch points.
    • getCurrentDistance Link icon

      public double getCurrentDistance()
      Returns the current distance between touch points.

      This distance is defined in device independent pixels.

      Returns:
      the current distance between touch points.
    • getCurrentAngle Link icon

      @NotNull public Angle getCurrentAngle()
      Returns the absolute angle between the two touch points.

      It is measured in degrees and counter-clockwise positive.

      Returns:
      the absolute angle between the two touch points.
    • getPreviousCenterLocation Link icon

      @Nullable public Coordinate getPreviousCenterLocation()
      Returns the location of the center between the 2 touch points from the previous event of this gesture.

      This location is defined in device independent pixels.

      Returns null if this is the first event of the gesture (i.e. when the status is EventStatus#Start).

      Returns:
      the location of the center between the 2 touch points from the previous event of this gesture.
    • getPreviousDistance Link icon

      @Nullable public Double getPreviousDistance()
      Returns the distance between touch points from the previous event of this gesture.

      This distance is defined in device independent pixels.

      Returns null if this is the first event of the gesture (i.e. when the status is EventStatus#Start).

      Returns:
      the distance between touch points from the previous event of this gesture.
    • getPreviousAngle Link icon

      @Nullable public Angle getPreviousAngle()
      Returns the absolute angle between the two touch points from the previous event of this gesture.

      It is measured in degrees and counter-clockwise positive.

      Returns null if this is the first event of the gesture (i.e. when the status is EventStatus#Start).

      Returns:
      the absolute angle between the two touch points from the previous event of this gesture.
    • getStatus Link icon

      @NotNull public EventStatus getStatus()
      Returns the status of the event.
      Returns:
      the status of the event.