example.wormgame
Class WormMain

java.lang.Object
  extended by javax.microedition.midlet.MIDlet
      extended by example.wormgame.WormMain
All Implemented Interfaces:
javax.microedition.lcdui.CommandListener

public class WormMain
extends javax.microedition.midlet.MIDlet
implements javax.microedition.lcdui.CommandListener

Main routine for worm MIDlet.


Constructor Summary
WormMain()
          Default constructor for worm MIDlet game.
 
Method Summary
 void commandAction(javax.microedition.lcdui.Command c, javax.microedition.lcdui.Displayable d)
          Respond to a commands issued on any Screen.
protected  void destroyApp(boolean unconditional)
          Destroy must cleanup everything.
protected  void pauseApp()
          Pause signals the thread to stop by clearing the thread field.
protected  void startApp()
          Start creates the thread to do the timing.
 
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
 

Constructor Detail

WormMain

public WormMain()
Default constructor for worm MIDlet game. Creates the initial graphics objects and sets the command listener.

Method Detail

destroyApp

protected void destroyApp(boolean unconditional)
Destroy must cleanup everything. Only objects exist so the GC will do all the cleanup after the last reference is removed.

Specified by:
destroyApp in class javax.microedition.midlet.MIDlet
Parameters:
unconditional - if true, force MIDlet destroy processing

pauseApp

protected void pauseApp()
Pause signals the thread to stop by clearing the thread field. If stopped before done with the iterations it will be restarted from scratch later.

Specified by:
pauseApp in class javax.microedition.midlet.MIDlet

startApp

protected void startApp()
Start creates the thread to do the timing. It should return immediately to keep the dispatcher from hanging.

Specified by:
startApp in class javax.microedition.midlet.MIDlet

commandAction

public void commandAction(javax.microedition.lcdui.Command c,
                          javax.microedition.lcdui.Displayable d)
Respond to a commands issued on any Screen.

Specified by:
commandAction in interface javax.microedition.lcdui.CommandListener
Parameters:
c - command object source of action
d - screen object containing the item the action was performed on