|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.microedition.midlet.MIDlet mome.MoMIDlet mome.MoXMIDlet
public abstract class MoXMIDlet
Class MoXMIDlet is an abstract class. It extends MoMIDlet
.
Applications that want to use commands execution thread should subclass this
class. This Class implements CommandListener
,
ItemCommandListener
, ItemStateListener
and
XCommandListener
. Action methods of LCDUI CommandListeners just push
command events (command associated with source on which it has occurred) to
commands execution thread. ItemStateListener.itemStateChanged(Item)
method uses constant ITEM_STATE_CHANGED
as command object. Method
XCommandListener.xCommandAction(Object, Object)
is the method where
the actual command events processing should occur. Implementation of this
method in MoXMIDlet does nothing. Subclasses should override this method. It
is executed in commands execution thread. This class also introduces a
pushCommand(Object, Object)
method via which application can push
user command events to the commands execution thread. Commands execution
thread is of course started when application enters the active state and
stopped when application is paused or exits.
Field Summary | |
---|---|
static Object |
ITEM_STATE_CHANGED
Command passed to xCommandAction method on ItemStateChanged event. |
Constructor Summary | |
---|---|
MoXMIDlet()
|
Method Summary | |
---|---|
void |
commandAction(Command cmd,
Displayable src)
Indicates that command event cmd has occurred on Displayable
src . |
void |
commandAction(Command cmd,
Item src)
Indicates that command event cmd has occurred on Item
src . |
protected void |
destroyApp(boolean unconditional)
Signals the MIDlet to terminate and enter the Destroyed state. |
Executor |
getExecutor()
Returns the Executor associated with this MoxMIDlet instance. |
protected void |
initApp()
Initialization method called from startApp. |
void |
itemStateChanged(Item i)
Indicates that items state has changed. |
protected void |
pauseApp()
Signals the MIDlet to enter the Paused state. |
void |
pushCommand(Object cmd,
Object src)
Pushes the command event (command associated with object) to the commands execution thread. |
protected void |
setCommandEventsHeapSize(int commandEventsHeapSize)
Sets the size of CommandEvents heap of executor. |
protected void |
startApp()
Signals the MIDlet that it has entered the Active state. |
void |
startExecutor()
Starts the commands execution thread. |
void |
stopExecutor()
Stops the commands execution thread. |
void |
xCommandAction(Object cmd,
Object src)
Indicates that a command event has occurred. |
Methods inherited from class mome.MoMIDlet |
---|
exit, getDisplay, isInitialized |
Methods inherited from class javax.microedition.midlet.MIDlet |
---|
checkPermission, getAppProperty, notifyDestroyed, notifyPaused, platformRequest, resumeRequest |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final Object ITEM_STATE_CHANGED
Constructor Detail |
---|
public MoXMIDlet()
Method Detail |
---|
public Executor getExecutor()
protected void initApp() throws MIDletStateChangeException
protected void initApp() throws MIDletStateChangeException { .... super.initApp(); ... }
Note
As method is called from StartApp: MIDletStateChangeException thrown indicates transient failure; runtime exception - non transient failure. Any exception will prevent setting initialized flag to true. This method is called after Display instance was saved.
initApp
in class MoMIDlet
MIDletStateChangeException
- is thrown if the MIDlet cannot start now but might be able to
start at a later time.MoMIDlet.initApp()
protected void setCommandEventsHeapSize(int commandEventsHeapSize)
commandEventsHeapSize
- Size of CommandEvents heap in executorpublic void startExecutor()
public void stopExecutor()
protected void startApp() throws MIDletStateChangeException
Note To maintain the proper invocation of initApp method subclasses overriding this method must call super method before other operations.
protected void startApp() throws MIDletStateChangeException { super.startApp(); ... }
startApp
in class MoMIDlet
MIDletStateChangeException
MIDlet.startApp()
protected void pauseApp()
protected void pauseApp() { ... super.pauseApp(); ... }
pauseApp
in class MIDlet
MIDlet.pauseApp()
protected void destroyApp(boolean unconditional) throws MIDletStateChangeException
protected void destroyApp(boolean unconditional) throws MIDletStateChangeException { ... super.destroyApp(unconditional); ... }
destroyApp
in class MIDlet
MIDletStateChangeException
MIDlet.destroyApp(boolean)
public void pushCommand(Object cmd, Object src)
cmd
- An object identifying the command. This can be any object.src
- An object associated with command object. Can be Displayable or
Item on which this command has occurred or any other object.public void commandAction(Command cmd, Displayable src)
cmd
has occurred on Displayable
src
. Pushes event to the execution thread. Subclasses
overriding this method and still wanted to use execution of commands in
separate thread should call super method.
commandAction
in interface CommandListener
CommandListener.commandAction(javax.microedition.lcdui.Command,
javax.microedition.lcdui.Displayable)
public void commandAction(Command cmd, Item src)
cmd
has occurred on Item
src
. Pushes event to the execution thread. Subclasses
overriding this method and still wanted to use execution of commands in
separate thread should call super method.
commandAction
in interface ItemCommandListener
ItemCommandListener.commandAction(javax.microedition.lcdui.Command,
javax.microedition.lcdui.Item)
public void itemStateChanged(Item i)
ITEM_STATE_CHANGED
constant is used as a command in
this case. Subclasses overriding this method and still wanted to use
execution of commands in separate thread should call super method.
itemStateChanged
in interface ItemStateListener
ItemStateListener.itemStateChanged(javax.microedition.lcdui.Item)
public void xCommandAction(Object cmd, Object src)
xCommandAction
in interface XCommandListener
cmd
- An object identifying the command. This can be any object.
Implementation should test on specific command by identity not
equality.src
- An object on which this event has occurred. Either Displayable or
Item or can be used as parameter for any user command.XCommandListener.xCommandAction(java.lang.Object,
java.lang.Object)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |