Package 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
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:
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 Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionfinal Objectfinal shortReturns the event type of this event.final longgetWhen()Returns the timestamp, in milliseconds, of this event.final booleanfinal voidsetAttachment(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.final voidsetConsumed(boolean consumed) Ifconsumedistrue, this event is marked as consumed, ie.static StringtoHexString(short hex) toString()Methods inherited from class java.util.EventObject
getSource
-
Field Details
-
consumedTag
SeesetConsumed(boolean)for description.
-
-
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
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
- Returns:
- The user application specific attachment, or null
-
isConsumed
public final boolean isConsumed()- See Also:
-
setConsumed
public final void setConsumed(boolean consumed) Ifconsumedistrue, 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
attachingtheconsumedTag.Events with platform specific actions will be supressed if marked as consumed. Examples are:
KeyEvent.VK_ESCAPEon Android's BACK button w/ Activity::finish()KeyEvent.VK_HOMEon Android's HOME button w/ Intend.ACTION_MAIN[Intend.CATEGORY_HOME]
-
toString
- Overrides:
toStringin classEventObject
-
toString
-
toHexString
-