Class NEWTEvent

java.lang.Object
java.util.EventObject
com.jogamp.newt.event.NEWTEvent
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
InputEvent, OutputEvent, WindowEvent

public class NEWTEvent extends EventObject
NEWT events are provided for notification purposes ONLY;
The NEWT will automatically handle the event semantics internally, regardless of whether a program is receiving these events or not.
The actual event semantic is processed before the event is send.
Event type registry:
  • WindowEvent 100..10x
  • MouseEvent 200..20x
  • KeyEvent 300..30x
  • GestureEvent 400..5xx
  • MonitorEvent 600..60x

See Also:
  • Field Details

  • Method Details

    • getEventType

      public final short getEventType()
      Returns the event type of this event.
    • getWhen

      public final long getWhen()
      Returns the timestamp, in milliseconds, of this event.
    • setAttachment

      public final void setAttachment(Object attachment)
      Attach the passed object to this event.
      If an object was previously attached, it will be replaced.
      Attachments to NEWT events allow users to pass on information from one custom listener to another, ie custom listener to listener communication.
      Parameters:
      attachment - User application specific object
    • getAttachment

      public final Object getAttachment()
      Returns:
      The user application specific attachment, or null
    • isConsumed

      public final boolean isConsumed()
      Returns true if this events has been consumed, otherwise false.
      See Also:
    • setConsumed

      public final void setConsumed(boolean consumed)
      If consumed is true, this event is marked as consumed, ie. the event will not be propagated any further to potential other event listener. Otherwise the event will be propagated to other event listener, the default.

      The event is marked as being consumed while attaching the consumedTag.

      Events with platform specific actions will be supressed if marked as consumed. Examples are:

    • toString

      public String toString()
      Overrides:
      toString in class EventObject
    • toString

      public StringBuilder toString(StringBuilder sb)
    • toHexString

      public static String toHexString(short hex)