public final class TouchPinchRotateEvent extends Object implements IInputEvent, AutoCloseable
IInputEvent
representing a 2 pointers gesture.
This class aggregates information related to pinch and rotation in the same event.
Modifier and Type | Method and Description |
---|---|
void |
close() |
static TouchPinchRotateEvent |
createEvent(Coordinate initialCenterLocation,
double initialDistance,
Angle initialAngle,
Coordinate currentCenterLocation,
double currentDistance,
Angle currentAngle,
Coordinate previousCenterLocation,
double previousDistance,
Angle previousAngle,
EventStatus status)
Creates a two pointer event.
|
static TouchPinchRotateEvent |
createStartEvent(Coordinate initialCenterLocation,
double initialDistance,
Angle initialAngle,
Coordinate currentCenterLocation,
double currentDistance,
Angle currentAngle)
Creates the first
TouchPinchRotateEvent of a gesture. |
protected void |
finalize() |
Angle |
getCurrentAngle() |
Coordinate |
getCurrentCenterLocation() |
double |
getCurrentDistance() |
Angle |
getInitialAngle() |
Coordinate |
getInitialCenterLocation() |
double |
getInitialDistance() |
Angle |
getPreviousAngle() |
Coordinate |
getPreviousCenterLocation() |
Double |
getPreviousDistance() |
EventStatus |
getStatus() |
public void close()
close
in interface AutoCloseable
@NotNull public static TouchPinchRotateEvent createStartEvent(@NotNull Coordinate initialCenterLocation, double initialDistance, @NotNull Angle initialAngle, @NotNull Coordinate currentCenterLocation, double currentDistance, @NotNull Angle currentAngle)
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.
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.@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)
The initial values refer to the situation at the beginning of the gesture (i.e. before any gesture detection).
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.@NotNull public Coordinate getInitialCenterLocation()
public double getInitialDistance()
@NotNull public Angle getInitialAngle()
@NotNull public Coordinate getCurrentCenterLocation()
public double getCurrentDistance()
@NotNull public Angle getCurrentAngle()
@Nullable public Coordinate getPreviousCenterLocation()
null
if this is the first event of the gesture (i.e. when the status
is EventStatus#Start
).@Nullable public Double getPreviousDistance()
null
if this is the first event of the gesture (i.e. when the status
is EventStatus#Start
).@Nullable public Angle getPreviousAngle()
null
if this is the first event of the gesture (i.e. when the status
is EventStatus#Start
).@NotNull public EventStatus getStatus()