com.jogamp.newt.event

## 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:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static Object` | `consumedTag` See `setConsumed(boolean)` for description.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Object` | `getAttachment()`
    `short` | `getEventType()` Returns the event type of this event.
    `long` | `getWhen()` Returns the timestamp, in milliseconds, of this event.
    `boolean` | `isConsumed()` Returns `true` if this events has been `consumed`, otherwise `false`.
    `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.
    `void` | `setConsumed(boolean consumed)` If `consumed` is `true`, this event is marked as consumed, ie.
    `static String` | `toHexString(short hex)`
    `String` | `toString()`
    `StringBuilder` | `toString(StringBuilder sb)`

    - ### Methods inherited from class java.util.EventObject

      `getSource`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### consumedTag

          public static final Object consumedTag

      See `setConsumed(boolean)` for description.

  - ### Method Detail

    - #### 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(boolean)`

    - #### 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:

      - `KeyEvent.VK_ESCAPE` on Android's BACK button w/ Activity::finish()
      - `KeyEvent.VK_HOME` on Android's HOME button w/ Intend.ACTION_MAIN[Intend.CATEGORY_HOME]

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `EventObject`

    - #### toString

          public StringBuilder toString(StringBuilder sb)

    - #### toHexString

          public static String toHexString(short hex)

Copyright 2010 JogAmp Community.