Class PointerEvent


  • public class PointerEvent
    extends java.lang.Object
    Represents a pointer event.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      @NotNull PointerEventType eventType
      The event type.
      float f
      The event normalised pressure.
      int pointerId
      The id of the pointer.
      @NotNull PointerType pointerType
      The type of input pointer.
      long t
      The event timestamp.
      float x
      The event x coordinate.
      float y
      The event y coordinate.
    • Constructor Summary

      Constructors 
      Constructor Description
      PointerEvent()
      Default constructor.
      PointerEvent​(@NotNull PointerEventType eventType, float x, float y, long t, float f, @NotNull PointerType pointerType, int pointerId)
      Constructs a PointerEvent
    • Field Detail

      • eventType

        @NotNull
        public @NotNull PointerEventType eventType
        The event type.
      • x

        public float x
        The event x coordinate.
      • y

        public float y
        The event y coordinate.
      • t

        public long t
        The event timestamp.
      • f

        public float f
        The event normalised pressure.
      • pointerType

        @NotNull
        public @NotNull PointerType pointerType
        The type of input pointer.
      • pointerId

        public int pointerId
        The id of the pointer.
    • Constructor Detail

      • PointerEvent

        public PointerEvent()
        Default constructor. Construct a Pen Cancel event.
      • 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.
        f - the event pressure.
        pointerType - the event pointer type.
        pointerId - the event pointer identifier.
    • Method Detail

      • down

        @NotNull
        public @NotNull PointerEvent down​(float x,
                                          float y)
        Update this event to a "down" event.
        Parameters:
        x - the x coordinate location.
        y - the y coordinate location.
        Returns:
        this.
      • move

        @NotNull
        public @NotNull PointerEvent move​(float x,
                                          float y)
        Update this event to a "move" event.
        Parameters:
        x - the x coordinate location.
        y - the y coordinate location.
        Returns:
        this.
      • up

        @NotNull
        public @NotNull PointerEvent up​(float x,
                                        float y)
        Update this event to a "up" event.
        Parameters:
        x - the x coordinate location.
        y - the y coordinate location.
        Returns:
        this.
      • timestamp

        @NotNull
        public @NotNull PointerEvent timestamp​(long t)
        Update the event timestamp.
        Parameters:
        t - the timestamp value.
        Returns:
        this.
      • force

        @NotNull
        public @NotNull PointerEvent force​(float f)
        Update the event pressure.
        Parameters:
        f - the presure value.
        Returns:
        this.
      • type

        @NotNull
        public @NotNull PointerEvent type​(@NotNull
                                          @NotNull PointerType pointerType)
        Update the event pointer type.
        Parameters:
        pointerType - the pointert type.
        Returns:
        this.
      • id

        @NotNull
        public @NotNull PointerEvent id​(int pointerId)
        Update the event pointer id.
        Parameters:
        pointerId - the pointer id value.
        Returns:
        this.
      • equals

        public boolean equals​(@Nullable
                              @Nullable java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public final int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        @NotNull
        public final @NotNull java.lang.String toString()
        Overrides:
        toString in class java.lang.Object