Package com.myscript.iink
Class PointerEvent
java.lang.Object
com.myscript.iink.PointerEvent
Represents a pointer event.
-
Field Summary
FieldsModifier and TypeFieldDescription@NotNull PointerEventTypeThe event type.floatThe event normalized pressure, in [0,1].floatThe event orientation in radians.intThe id of the pointer.@NotNull PointerTypeThe type of input pointer.longThe event timestamp in ms since Unix EPOCH, or-1.floatThe event tilt in radians.floatThe event x coordinate.floatThe event y coordinate. -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.PointerEvent(@NotNull PointerEvent other) Copy constructor.PointerEvent(@NotNull PointerEventType eventType, float x, float y, long t, float f, float tilt, float orientation, @NotNull PointerType pointerType, int pointerId) Constructs a PointerEventPointerEvent(@NotNull PointerEventType eventType, float x, float y, long t, float f, @NotNull PointerType pointerType, int pointerId) Constructs a PointerEvent -
Method Summary
Modifier and TypeMethodDescription@NotNull PointerEventdown(float x, float y) Update this event to a "down" event.boolean@NotNull PointerEventforce(float f) Update the event pressure.final inthashCode()booleanCheck whether the event has tilt and orientation information.@NotNull PointerEventid(int pointerId) Update the event pointer id.@NotNull PointerEventmove(float x, float y) Update this event to a "move" event.@NotNull PointerEventorientationAngle(float orientation) Update the event orientation angle.@NotNull PointerEventtiltAngle(float tilt) Update the event tilt angle.@NotNull PointerEventtimestamp(long t) Update the event timestamp.final @NotNull StringtoString()@NotNull PointerEventtype(@NotNull PointerType pointerType) Update the event pointer type.@NotNull PointerEventup(float x, float y) Update this event to a "up" event.
-
Field Details
-
eventType
The event type. -
x
public float xThe event x coordinate. -
y
public float yThe event y coordinate. -
t
public long tThe event timestamp in ms since Unix EPOCH, or-1. -
f
public float fThe event normalized pressure, in [0,1]. -
tilt
public float tiltThe event tilt in radians.0is perpendicular,Pi/2if flat on screen.- Since:
- 4.0
-
orientation
public float orientationThe event orientation in radians.0is pointing up,-Pi/2is left,Pi/2is right,+/-Piis down.- Since:
- 4.0
-
pointerType
The type of input pointer. -
pointerId
public int pointerIdThe id of the pointer.
-
-
Constructor Details
-
PointerEvent
public PointerEvent()Default constructor. Construct a Pen Cancel event. -
PointerEvent
Copy constructor.- Parameters:
other- the pointer event to copy.
-
PointerEvent
public PointerEvent(@NotNull @NotNull PointerEventType eventType, float x, float y, long t, float f, @NotNull @NotNull PointerType pointerType, int pointerId) Constructs a PointerEvent- Parameters:
eventType- the event type.x- the event x coordinate.y- the event y coordinate.t- the event timestamp in ms since Unix EPOCH, or-1.f- the event pressure.pointerType- the event pointer type.pointerId- the event pointer identifier.
-
PointerEvent
public PointerEvent(@NotNull @NotNull PointerEventType eventType, float x, float y, long t, float f, float tilt, float orientation, @NotNull @NotNull PointerType pointerType, int pointerId) Constructs a PointerEvent- Parameters:
eventType- the event type.x- the event x coordinate.y- the event y coordinate.t- the event timestamp in ms since Unix EPOCH, or-1.f- the event pressure.tilt- the event tilt in radians.orientation- the event orientation in radians.pointerType- the event pointer type.pointerId- the event pointer identifier.- Since:
- 4.0
-
-
Method Details
-
down
Update this event to a "down" event.- Parameters:
x- the x coordinate location.y- the y coordinate location.- Returns:
- this.
-
move
Update this event to a "move" event.- Parameters:
x- the x coordinate location.y- the y coordinate location.- Returns:
- this.
-
up
Update this event to a "up" event.- Parameters:
x- the x coordinate location.y- the y coordinate location.- Returns:
- this.
-
timestamp
Update the event timestamp.- Parameters:
t- the timestamp value.- Returns:
- this.
-
force
Update the event pressure.- Parameters:
f- the pressure value.- Returns:
- this.
-
tiltAngle
Update the event tilt angle.- Parameters:
tilt- the tilt value.- Returns:
- this.
- Since:
- 4.0
-
orientationAngle
Update the event orientation angle.- Parameters:
orientation- the orientation value.- Returns:
- this.
- Since:
- 4.0
-
type
Update the event pointer type.- Parameters:
pointerType- the pointer type.- Returns:
- this.
-
id
Update the event pointer id.- Parameters:
pointerId- the pointer id value.- Returns:
- this.
-
hasTiltInfo
public boolean hasTiltInfo()Check whether the event has tilt and orientation information.- Returns:
trueif the event has tilt and orientation info, otherwisefalse.- Since:
- 4.0
-
equals
-
hashCode
public final int hashCode() -
toString
-