Methods Summary |
---|
public void | commandAction(javax.microedition.lcdui.Command c, javax.microedition.lcdui.Displayable d)
if (c == exitCommand) {
destroyApp(false);
notifyDestroyed();
} else if (c == solveCommand) {
if (!m_Canvas.isSolving()) {
m_Canvas.solve();
}
m_Canvas.removeCommand(solveCommand);
m_Canvas.addCommand(stopCommand);
} else if (c == stopCommand) {
m_Canvas.stop();
m_Canvas.removeCommand(stopCommand);
m_Canvas.addCommand(resetCommand);
} else if (c == resetCommand) {
m_Canvas.resetTowers();
m_Canvas.removeCommand(resetCommand);
m_Canvas.addCommand(solveCommand);
}
|
public void | destroyApp(boolean force)
m_Canvas.exit();
m_Hanoi = null;
m_Display.setCurrent(null);
|
public void | pauseApp()
m_Canvas.exit();
m_Hanoi = null;
|
public void | run()
do {
synchronized(m_Canvas) {
try {
m_Canvas.wait();
} catch (InterruptedException ie) {
continue; // Go back through while(true) loop
}
while (m_Canvas.isSolving()) {
m_Canvas.updateInfo();
}
if (!m_Canvas.isSolving()) {
m_Canvas.removeCommand(stopCommand);
m_Canvas.addCommand(resetCommand);
}
}
}
while(!m_Canvas.isExiting());
m_Canvas = null;
|
public void | startApp()
m_Display.setCurrent(m_Canvas);
if(m_Hanoi == null) {
m_Hanoi = new Thread(this);
m_Hanoi.start();
}
|