public abstract class Event extends java.lang.Object implements Printable
| Modifier and Type | Field and Description |
|---|---|
private boolean |
consumed
If
true, the keyboard event was processed and consumed. |
private int |
id
Event type ID.
|
private Widget |
other
Companion widget, used for ENTER/LEAVE events.
|
private Widget |
source
Event source.
|
| Constructor and Description |
|---|
Event(Widget source,
int id)
Constructor.
|
Event(Widget source,
Widget other,
int id)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
consume()
Mark event as consumed.
|
int |
id()
Get event ID.
|
boolean |
isConsumed()
Check if event is already consumed.
|
Event |
merge(java.util.LinkedList<Event> queue)
Merges the current event with already existed events in queue.
|
Widget |
other()
Companion widget for this event.
|
void |
print(PrintHelper printer)
Print all class-specific fields.
|
Widget |
source()
Source widget for this event.
|
java.lang.String |
toString()
Returns a string representation of the object.
|
private final int id
private final Widget source
private final Widget other
private boolean consumed
true, the keyboard event was processed and consumed.public Event(Widget source, int id)
source - Event source.id - Event type ID.public int id()
public Widget source()
public Widget other()
public void consume()
public boolean isConsumed()
true if event is consumed.public Event merge(java.util.LinkedList<Event> queue)
queue - The queue to check for events.NULL if event merged or current event otherwise.public void print(PrintHelper printer)
public java.lang.String toString()
toString method returns a string that
"textually represents" this object. The result should
be a concise but informative representation that is easy for a
person to read.
It is recommended that all subclasses override this method.
The toString method for class Object
returns a string consisting of the name of the class of which the
object is an instance, the at-sign character `@', and
the unsigned hexadecimal representation of the hash code of the
object. In other words, this method returns a string equal to the
value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())
toString in class java.lang.Object