Class PointerEvent

Direct Known Subclasses:
PointerCancelEvent, PointerDownEvent, PointerEnterEvent, PointerLeaveEvent, PointerMoveEvent, PointerOutEvent, PointerOverEvent, PointerUpEvent

public abstract class PointerEvent extends ClientEvent<PointerListener>
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

    Constructors
    Constructor
    Description
    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.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the X coordinate of the pointer relative to the client viewport.
    int
    Returns the Y coordinate of the pointer relative to the client viewport.
    int
    Returns the height of the pointer contact geometry.
    int
    Returns the unique identifier for the pointer.
    Returns the type of pointer (mouse, pen, or touch).
    float
    Returns the normalized pressure of the pointer input (0.0 to 1.0).
    int
    Returns the tilt angle along the X axis in degrees (-90 to 90).
    int
    Returns the tilt angle along the Y axis in degrees (-90 to 90).
    int
    Returns the width of the pointer contact geometry.
    boolean
    Returns whether this pointer is the primary pointer.

    Methods inherited from class com.oorian.messaging.events.client.ClientEvent

    getSource, getTarget, setSource, setTarget

    Methods inherited from class com.oorian.messaging.events.Event

    bubbles, dispatchTo

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 viewport
      clientY - the Y coordinate of the pointer relative to the client viewport
      pointerId - the unique identifier for the pointer
      pointerType - the type of pointer (mouse, pen, touch)
      width - the width of the pointer contact geometry
      height - the height of the pointer contact geometry
      pressure - the normalized pressure of the pointer input
      tiltX - the tilt angle along the X axis in degrees
      tiltY - the tilt angle along the Y axis in degrees
      isPrimary - 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

      public String 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