Methods Summary |
---|
void | callSeriallyEvent()Process all pending call serially's
try {
synchronized (eventLock) {
displayManager.callSerially();
}
} catch (Throwable t) {
handleThrowable(t);
}
|
public void | clearSystemScreen()Called to force the event handler to clear whatever system screen
has interrupted the current Displayable and allow the foreground
Display to resume painting.
inMenu = false;
dismissMenu();
|
void | commandEvent(int type)Process a command event
try {
synchronized (eventLock) {
if (type == MENU_REQUESTED) {
displayManager.suspendPainting();
paintMenu();
inMenu = true;
} else {
if (inMenu) {
displayManager.resumePainting();
}
inMenu = false;
if (type >= 0) {
displayManager.commandAction(type);
}
}
}
} catch (Throwable t) {
handleThrowable(t);
}
|
native void | dismissMenu()Native method to dismiss the current menu in the case of setCurrent()
being called while the Display is suspended by a system screen.
|
public native int | getGameAction(int keyCode)Get the abstract gameAction corresponding to the given keyCode.
|
public native int | getKeyCode(int gameAction)Get the system-specific key code corresponding to the given gameAction.
|
public native java.lang.String | getKeyName(int keyCode)Get the informative key string corresponding to the given keyCode.
|
public native int | getSystemKey(int keyCode)Get the abstract system key that corresponds to keyCode.
|
static void | handleThrowable(java.lang.Throwable t)Handle an unexpected exception while processing an event
if (t != null) {
System.err.println("\nError occurred while dispatching event:");
t.printStackTrace();
}
|
native void | incomingCall()Simulate an incoming phone call in the RI. This method
would be removed in an actual port. It exists solely to
simulate one possible behavior of a system whereby MIDP
needs to be suspended for the device to handle some task.
|
public boolean | isDispatchThread()Returns true if the current thread is the EventHandler's dispatch
thread.
return (Thread.currentThread() == eventThread);
|
void | itemStateChangedEvent(javax.microedition.lcdui.Item src)Process an item state change
try {
synchronized (eventLock) {
displayManager.callItemStateChanged(src);
}
} catch (Throwable t) {
handleThrowable(t);
}
|
void | keyEvent(int type, java.lang.String str, int code)Process a key event
try {
if (type == IME) {
synchronized (eventLock) {
displayManager.inputMethodEvent(str);
}
} else if (getSystemKey(code) == SYSTEM_KEY_END &&
type == RELEASED) {
synchronized (eventLock) {
displayManager.killCurrent();
}
} else if (inMenu) {
// native method, no need to synchronize
inMenu = menuKeyEvent(type, code);
} else {
synchronized (eventLock) {
displayManager.keyEvent(type, code);
}
}
} catch (Throwable t) {
handleThrowable(t);
}
|
native boolean | menuKeyEvent(int type, int code)Handle the key event when the menu is the current display.
|
native boolean | menuPointerEvent(int type, int x, int y)Handle the pointer event when the menu is the current display.
|
void | multiMediaEvent(int playerID, int curMTime)Process a multimedia event
try {
BasicPlayer p = BasicPlayer.get(playerID);
if (p != null) {
p.sendEvent(PlayerListener.END_OF_MEDIA, new Long(curMTime));
}
} catch (Throwable t) {
handleThrowable(t);
}
|
native void | paintMenu()Native method to draw the command menu on the screen
|
void | pointerEvent(int type, int x, int y)Process a pointer event
try {
if (inMenu) {
// native method, no need to synchronize
inMenu = menuPointerEvent(type, x, y);
} else {
synchronized (eventLock) {
displayManager.pointerEvent(type, x, y);
}
}
} catch (Throwable t) {
handleThrowable(t);
}
|
void | repaintScreenEvent(int x1, int y1, int x2, int y2, java.lang.Object target)Process a repaint event
try {
synchronized (eventLock) {
displayManager.repaint(x1, y1, x2, y2, target);
}
} catch (Throwable t) {
handleThrowable(t);
}
|
public void | scheduleCallSerially()Called to schedule a serial callback of a Runnable object passed
into Display's callSerially() method.
eventQueue.push();
|
public void | scheduleInvalidate(javax.microedition.lcdui.Item src)Called to schedule an invalidation of a Form
eventQueue.push(src, true);
|
public void | scheduleItemStateChanged(javax.microedition.lcdui.Item src)Called to schedule a call to an ItemStateChangeListener
eventQueue.push(src, false);
|
public void | scheduleRepaint(int x, int y, int w, int h, java.lang.Object target)Called to schedule a repaint of the current Displayable
as soon as possible
eventQueue.push(x, y, w, h, target);
|
public void | scheduleScreenChange(javax.microedition.lcdui.Display parent, javax.microedition.lcdui.Displayable d)Called to schedule a screen change to the given Displayable
as soon as possible
eventQueue.push(parent, d);
|
void | screenChangeEvent(javax.microedition.lcdui.Display parent, javax.microedition.lcdui.Displayable d)Process a screen change event
try {
synchronized (eventLock) {
displayManager.screenChange(parent, d);
}
} catch (Throwable t) {
handleThrowable(t);
}
|
public void | serviceRepaints()Called to service any pending repaint operations
try {
eventQueue.serviceRepaints();
} catch (Throwable t) {
t.printStackTrace();
}
|
void | systemEvent(int type)Process a system event
try {
synchronized (eventLock) {
switch (type) {
case SUSPEND_ALL:
displayManager.suspendAll();
// NOTE: A real port would not use 'incomingCall()'
// and the line below would be removed.
// It exists solely in the RI to simulate the fact
// that the system is doing something which has
// suspended MIDP
incomingCall();
break;
case RESUME_ALL:
displayManager.resumeAll();
break;
case SHUTDOWN:
displayManager.shutdown();
case SUSPEND_CURRENT:
displayManager.suspendCurrent();
break;
case RESUME_PREVIOUS:
displayManager.resumePrevious();
break;
case KILL_CURRENT:
displayManager.killCurrent();
break;
default:
break;
}
} // synchronized
} catch (Throwable t) {
handleThrowable(t);
}
|
void | unknownVMEvent(int event, Events queue)Handle an undefined VM Event. Designed for subclasses to
easily override and process new event types.
System.err.println("Unknown VM Event: " + event);
|
public native void | updateCommandSet(javax.microedition.lcdui.Command[] itemCommands, int numItemCommands, javax.microedition.lcdui.Command[] commands, int numCommands)Set the current set of active Abstract Commands.
|
void | validateEvent(javax.microedition.lcdui.Item src)Process a Form invalidation
try {
synchronized (eventLock) {
displayManager.callInvalidate(src);
}
} catch (Throwable t) {
handleThrowable(t);
}
|