|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectdanger.app.Event
public final class Event
Standard object used for passing events, such as UI events.
Event objects are sent when the user initiates an action (such as selecting a menu
item). You can specify the listener for events for the associated UI objects (such as
a menu item, a button, etc). You can also register to receive some specific events by
using Application.registerForEvent(danger.app.Listener, int).
| Field Summary | |
|---|---|
Object |
argument
arbitrary Object |
int |
data
Additional event-specific data. |
int |
keycode
For key events contains the raw keycode |
int |
modifiers
Event modifiers. |
Listener |
target
Where to route the event on receipt. |
int |
timestamp
Timestamp of when the event happened. |
int |
type
Event type ID. |
int |
what
Event specifier. |
| Constructor Summary | |
|---|---|
Event()
|
|
Event(Event e)
|
|
Event(int type)
|
|
Event(int type,
int what)
|
|
Event(int type,
int what,
int data)
|
|
Event(int type,
int what,
int data,
Object argument)
|
|
Event(int type,
int what,
Object argument)
|
|
Event(Listener target,
int type)
|
|
Event(Listener target,
int type,
int what)
|
|
Event(Listener target,
int type,
int what,
int data)
|
|
Event(Listener target,
int type,
int what,
int data,
int modifiers)
|
|
Event(Listener target,
int type,
int what,
int data,
int modifiers,
int timestamp,
Object argument)
|
|
Event(Listener target,
int type,
int what,
int data,
Object argument)
|
|
| Method Summary | |
|---|---|
void |
debugPrint()
|
void |
debugPrint(String beforeMessage,
String afterMessage)
|
void |
debugPrint(String beforeMessage,
String afterMessage,
boolean ignoreTorrential)
|
static void |
debugPrintFilterAdd(String name)
|
static void |
debugPrintFilterAddAll()
|
static void |
debugPrintFilterClear()
|
static void |
debugPrintFilterDump()
|
static void |
debugPrintFilterRemove(String name)
|
byte |
getHorizontalCount()
Return the horizontal component of a navigation event. |
Listener |
getListener()
Deprecated. deprecated Use Event.target instead. |
byte |
getVerticalCount()
Return the vertical component of a navigation event. |
int |
getWheelCount()
Return the wheel count, for events that coalesce wheel movement into one event. |
boolean |
isKeyEvent()
Return whether the event is a "key" event. |
boolean |
isMenuEvent()
Return whether the event is a "menu" event. |
boolean |
isUIEvent()
Return whether the event is a "UI" event, such as a button click, or keypress. |
static Event |
makeBlankEvent()
Construct an event with all fields set to 0 /
null, including particularly the timestamp, which is
normally set to be the current time. |
boolean |
modifierIsActive(int modifierMask)
Determine if the specified modifier key or button was held for this event. |
boolean |
modifierIsChorded()
Determines if the event modifier signifies that a modifier key or button was held during the event. |
void |
sendToTarget()
|
void |
setArgument(Object arg)
Deprecated. deprecated Use Event.argument = instead. |
void |
setListener(Listener inListener)
Deprecated. deprecated Use Event.target = instead. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public int type
public int what
public int keycode
public int data
EventType.EVENT_RAW_KEY_REPEAT if it is actually
a widget-repeat instead of a widget-down.
public int modifiers
EVENT_MODIFIER_CAPS EVENT_MODIFIER_ALT EVENT_MODIFIER_SYM EVENT_MODIFIER_BACK_BUTTON EVENT_MODIFIER_MENU_BUTTON EVENT_MODIFIER_JUMP_BUTTON EVENT_MODIFIER_TRACKBALL
public int timestamp
public Object argument
public Listener target
| Constructor Detail |
|---|
public Event(Listener target,
int type,
int what,
int data,
int modifiers,
int timestamp,
Object argument)
public Event(Listener target,
int type,
int what,
int data,
Object argument)
public Event(Listener target,
int type,
int what,
int data,
int modifiers)
public Event(int type,
int what,
int data,
Object argument)
public Event(int type,
int what,
Object argument)
public Event(int type,
int what,
int data)
public Event(int type,
int what)
public Event(int type)
public Event()
public Event(Listener target,
int type,
int what,
int data)
public Event(Listener target,
int type,
int what)
public Event(Listener target,
int type)
public Event(Event e)
| Method Detail |
|---|
public static Event makeBlankEvent()
0 /
null, including particularly the timestamp, which is
normally set to be the current time.
public void setListener(Listener inListener)
Event.target = instead.
public Listener getListener()
Event.target instead.
public void setArgument(Object arg)
Event.argument = instead.
public void sendToTarget()
public boolean modifierIsActive(int modifierMask)
EventType.EVENT_MODIFIER_TRACKBALL, this
indicates that the event originated from a movement of the trackball.
modifierMask - one or more of the following:
EventType.EVENT_MODIFIER_CAPS,
EventType.EVENT_MODIFIER_ALT,
EventType.EVENT_MODIFIER_SYM,
EventType.EVENT_MODIFIER_BACK_BUTTON,
EventType.EVENT_MODIFIER_MENU_BUTTON,
EventType.EVENT_MODIFIER_JUMP_BUTTON,
EventType.EVENT_MODIFIER_TRACKBALL.public boolean modifierIsChorded()
Determines if the event modifier signifies that a modifier key or button was held during the event.
Note that this is different from checking
Event.modifiers != 0, since the
modifiers field may
include EventType.EVENT_MODIFIER_TRACKBALL or
EventType.EVENT_MODIFIER_WHEEL even if the event was not
chorded.
public int getWheelCount()
public byte getHorizontalCount()
Return the horizontal component of a navigation event.
This returns the amount of horizontal movement of the
navigation device. It is only relevant for events where
the type is EventType.DEVICE_NAVIGATION.
getVerticalCount()public byte getVerticalCount()
Return the vertical component of a navigation event.
This returns the amount of vertical movement of the
navigation device. It is only relevant for events where
the type is EventType.DEVICE_NAVIGATION.
getHorizontalCount()public boolean isKeyEvent()
public boolean isMenuEvent()
public boolean isUIEvent()
public void debugPrint(String beforeMessage,
String afterMessage,
boolean ignoreTorrential)
public void debugPrint()
public void debugPrint(String beforeMessage,
String afterMessage)
public static void debugPrintFilterAdd(String name)
public static void debugPrintFilterRemove(String name)
public static void debugPrintFilterClear()
public static void debugPrintFilterDump()
public static void debugPrintFilterAddAll()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||