📄 photopuzzle.java
字号:
import java.util.Timer;
import java.util.TimerTask;
import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Displayable;
import javax.microedition.midlet.MIDlet;
public class PhotoPuzzle extends MIDlet
implements CommandListener
{
private Command menuCmd_EXIT = new Command("EXIT", 1, 2);
private Command menuCmd_ABOUT = new Command("NEXT", 1, 1);
private Display display;
private Timer timer = new Timer();
private PhotoPuzzleCanvas canvas = new PhotoPuzzleCanvas();
private PhotoPuzzle.paintCanvas_onEveryClockTick paintCanvas;
public PhotoPuzzle()
{
this.paintCanvas = new PhotoPuzzle.paintCanvas_onEveryClockTick(this);
this.display = Display.getDisplay(this);
this.canvas.myScreen_isColor = this.display.isColor();
this.canvas.addCommand(this.menuCmd_EXIT);
this.canvas.addCommand(this.menuCmd_ABOUT);
this.canvas.setCommandListener(this);
this.timer.schedule(this.paintCanvas, 0L, 100L);
}
public void startApp()
{
this.display.setCurrent(this.canvas);
}
public void pauseApp()
{
}
public void destroyApp(boolean paramBoolean)
{
}
public void commandAction(Command paramCommand, Displayable paramDisplayable)
{
if (paramCommand == this.menuCmd_EXIT)
{
this.timer.cancel();
destroyApp(false);
super.notifyDestroyed();
}
else if (paramCommand == this.menuCmd_ABOUT)
{
this.canvas.processMenuCmd_NEXT();
}
}
static PhotoPuzzleCanvas access$000(PhotoPuzzle paramPhotoPuzzle)
{
return paramPhotoPuzzle.canvas;
}
class paintCanvas_onEveryClockTick extends TimerTask
{
private final PhotoPuzzle this$0;
paintCanvas_onEveryClockTick()
{
this.this$0 = paramPhotoPuzzle;
}
public void run()
{
PhotoPuzzle.access$000(this.this$0).clockTick();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -