Class PointerEvent
java.lang.Object
com.oorian.messaging.events.Event<PointerListener>
com.oorian.messaging.events.client.ClientEvent<PointerListener>
com.oorian.messaging.events.client.PointerEvent
- Direct Known Subclasses:
PointerCancelEvent,PointerDownEvent,PointerEnterEvent,PointerLeaveEvent,PointerMoveEvent,PointerOutEvent,PointerOverEvent,PointerUpEvent
Abstract base class for all pointer-related events in the client interface.
Pointer events unify mouse, pen, and touch input into a single event model. This class serves as the foundation for specific pointer event types, providing common fields for tracking pointer coordinates, pointer identity, pointer type, contact geometry, pressure, tilt, and whether the pointer is the primary pointer.
Features:
- Provides coordinate and pointer identity tracking for all pointer events
- Captures contact geometry (width, height) and pressure
- Captures tilt angles for pen/stylus input
- Identifies pointer type (mouse, pen, touch)
- Integrates with the PointerListener interface
- Since:
- 2026
- Version:
- 1.0
- Author:
- Marvin P. Warble Jr.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionPointerEvent(int clientX, int clientY, int pointerId, String pointerType, int width, int height, float pressure, int tiltX, int tiltY, boolean isPrimary) Constructs a new PointerEvent with the specified parameters. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the X coordinate of the pointer relative to the client viewport.intReturns the Y coordinate of the pointer relative to the client viewport.intReturns the height of the pointer contact geometry.intReturns the unique identifier for the pointer.Returns the type of pointer (mouse, pen, or touch).floatReturns the normalized pressure of the pointer input (0.0 to 1.0).intgetTiltX()Returns the tilt angle along the X axis in degrees (-90 to 90).intgetTiltY()Returns the tilt angle along the Y axis in degrees (-90 to 90).intgetWidth()Returns the width of the pointer contact geometry.booleanReturns whether this pointer is the primary pointer.Methods inherited from class com.oorian.messaging.events.client.ClientEvent
getSource, getTarget, setSource, setTargetMethods inherited from class com.oorian.messaging.events.Event
bubbles, dispatchTo
-
Constructor Details
-
PointerEvent
public PointerEvent(int clientX, int clientY, int pointerId, String pointerType, int width, int height, float pressure, int tiltX, int tiltY, boolean isPrimary) Constructs a new PointerEvent with the specified parameters.- Parameters:
clientX- the X coordinate of the pointer relative to the client viewportclientY- the Y coordinate of the pointer relative to the client viewportpointerId- the unique identifier for the pointerpointerType- the type of pointer (mouse, pen, touch)width- the width of the pointer contact geometryheight- the height of the pointer contact geometrypressure- the normalized pressure of the pointer inputtiltX- the tilt angle along the X axis in degreestiltY- the tilt angle along the Y axis in degreesisPrimary- whether this pointer is the primary pointer
-
-
Method Details
-
getClientX
public int getClientX()Returns the X coordinate of the pointer relative to the client viewport.- Returns:
- the X coordinate of the pointer event
-
getClientY
public int getClientY()Returns the Y coordinate of the pointer relative to the client viewport.- Returns:
- the Y coordinate of the pointer event
-
getPointerId
public int getPointerId()Returns the unique identifier for the pointer.- Returns:
- the pointer identifier
-
getPointerType
Returns the type of pointer (mouse, pen, or touch).- Returns:
- the pointer type string
-
getWidth
public int getWidth()Returns the width of the pointer contact geometry.- Returns:
- the contact width
-
getHeight
public int getHeight()Returns the height of the pointer contact geometry.- Returns:
- the contact height
-
getPressure
public float getPressure()Returns the normalized pressure of the pointer input (0.0 to 1.0).- Returns:
- the pressure value
-
getTiltX
public int getTiltX()Returns the tilt angle along the X axis in degrees (-90 to 90).- Returns:
- the X-axis tilt angle
-
getTiltY
public int getTiltY()Returns the tilt angle along the Y axis in degrees (-90 to 90).- Returns:
- the Y-axis tilt angle
-
isPrimary
public boolean isPrimary()Returns whether this pointer is the primary pointer.- Returns:
- true if this is the primary pointer
-