?? firmidlet.java
字號:
import java.io.IOException;
import javax.microedition.lcdui.*;
import javax.microedition.midlet.MIDlet;
public class FIRMIDlet extends MIDlet implements CommandListener
{
private Display display;
private Form form;
private Image imgSplash;
private Command CMD_EXIT;
private Command CMD_GO;
private Command CMD_OPTION;
private Command CMD_ABOUT;
private FIRCanvas myCanvas;
private Options options;
private About about;
public FIRMIDlet()
{
display = Display.getDisplay(this);
form = new Form(null);
try
{
imgSplash = Image.createImage("/splash.png");
}
catch(IOException _ex)
{
imgSplash = Image.createImage(1, 1);
}
form.append(imgSplash);
CMD_EXIT = new Command("退出", 7, 1);
CMD_GO = new Command("開局", 4, 2);
CMD_OPTION = new Command("設置", 1, 3);
CMD_ABOUT = new Command("關于", 5, 3);
form.addCommand(CMD_GO);
form.addCommand(CMD_OPTION);
form.addCommand(CMD_ABOUT);
form.addCommand(CMD_EXIT);
form.setCommandListener(this);
myCanvas = new FIRCanvas(this);
options = new Options(this);
about = new About(this);
}
public void startApp()
{
display.setCurrent(form);
}
public void pauseApp()
{
}
public void destroyApp(boolean arg0)
{
}
public void commandAction(Command c, Displayable s)
{
if(c == CMD_EXIT)
{
destroyApp(false);
notifyDestroyed();
} else
if(c == CMD_GO)
{
display.setCurrent(myCanvas);
myCanvas.setOptions(options.getBoardSize(), options.isComputerFirst(), options.getDegree());
myCanvas.newStage();
} else
if(c == CMD_OPTION)
display.setCurrent(options.getForm());
else
if(c == CMD_ABOUT)
display.setCurrent(about.getForm());
}
public void comeBack()
{
display.setCurrent(form);
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -