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
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 Description static ObjectconsumedTagSeesetConsumed(boolean)for description.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectgetAttachment()shortgetEventType()Returns the event type of this event.longgetWhen()Returns the timestamp, in milliseconds, of this event.booleanisConsumed()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.voidsetConsumed(boolean consumed)Ifconsumedistrue, this event is marked as consumed, ie.static StringtoHexString(short hex)StringtoString()StringBuildertoString(StringBuilder sb)-
Methods inherited from class java.util.EventObject
getSource
-
-
-
-
Field Detail
-
consumedTag
public static final Object consumedTag
SeesetConsumed(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()
- See Also:
setConsumed(boolean)
-
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
public String toString()
- Overrides:
toStringin classEventObject
-
toString
public StringBuilder toString(StringBuilder sb)
-
toHexString
public static String toHexString(short hex)
-
-