Class PenEvent

  • All Implemented Interfaces:
    java.lang.Cloneable
    Direct Known Subclasses:
    DragEvent, MouseEvent

    public class PenEvent
    extends Event
    implements java.lang.Cloneable
    PenEvent is a pen down, up, move or drag event.

    A pen drag occurs when the pen moves while the screen is pressed.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      int absoluteX
      The absolute x location of the event.
      int absoluteY
      The absolute y location of the event.
      protected static java.lang.String[] EVENT_NAME  
      int modifiers
      The state of the modifier keys when the event occured.
      static int PEN_DOWN
      The event type for a pen or mouse down.
      static int PEN_DRAG
      The event type for a pen or mouse drag.
      static int PEN_DRAG_END
      The event type for a pen or mouse drag end.
      static int PEN_DRAG_START
      The event type for a pen or mouse drag start.
      static int PEN_UP
      The event type for a pen or mouse up.
      int x
      The x location of the event.
      int y
      The y location of the event.
    • Constructor Summary

      Constructors 
      Constructor Description
      PenEvent()  
    • Field Detail

      • PEN_DOWN

        public static final int PEN_DOWN
        The event type for a pen or mouse down.
        See Also:
        Constant Field Values
      • PEN_UP

        public static final int PEN_UP
        The event type for a pen or mouse up.
        See Also:
        Constant Field Values
      • PEN_DRAG

        public static final int PEN_DRAG
        The event type for a pen or mouse drag.
        See Also:
        Constant Field Values
      • PEN_DRAG_START

        public static final int PEN_DRAG_START
        The event type for a pen or mouse drag start.
        See Also:
        Constant Field Values
      • PEN_DRAG_END

        public static final int PEN_DRAG_END
        The event type for a pen or mouse drag end.
        See Also:
        Constant Field Values
      • EVENT_NAME

        protected static final java.lang.String[] EVENT_NAME
      • x

        public int x
        The x location of the event.
      • y

        public int y
        The y location of the event.
      • absoluteX

        public int absoluteX
        The absolute x location of the event.
      • absoluteY

        public int absoluteY
        The absolute y location of the event.
      • modifiers

        public int modifiers
        The state of the modifier keys when the event occured. This is a OR'ed combination of the modifiers present in the DeviceKeys interface.
        See Also:
        SpecialKeys
    • Constructor Detail

      • PenEvent

        public PenEvent()
    • Method Detail

      • update

        public PenEvent update​(Control c,
                               int absoluteX,
                               int x,
                               int absoluteY,
                               int y,
                               int type,
                               int modifiers)
        Updates this event setting also the timestamp, consumed and target.
        Since:
        TotalCross 1.0
      • getEventName

        public static java.lang.String getEventName​(int type)
        Returns the event name. Used to debugging.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class Event
      • clone

        public PenEvent clone()
        Overrides:
        clone in class java.lang.Object