?? trichessmanmidlet.java
字號:
/*
* 創建日期 2005-6-28
*
* TODO 要更改此生成的文件的模板,請轉至
* 窗口 - 首選項 - Java - 代碼樣式 - 代碼模板
*/
package game;
import java.io.IOException;
import javax.microedition.lcdui.Alert;
import javax.microedition.lcdui.AlertType;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.Image;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;
/**
* @author Administrator
*
* TODO 要更改此生成的類型注釋的模板,請轉至
* 窗口 - 首選項 - Java - 代碼樣式 - 代碼模板
*/
public class TriChessmanMIDlet extends MIDlet {
private ChoosePieceScreen choosePieceScreen;
private GameScreen gameScreen;
public Display display;
/**
*
*/
public TriChessmanMIDlet() {
super();
// TODO 自動生成構造函數存根
}
/* (非 Javadoc)
* @see javax.microedition.midlet.MIDlet#startApp()
*/
protected void startApp() throws MIDletStateChangeException {
// 獲得Display
display = Display.getDisplay(this);
// 獲得Displayable
Displayable current = display.getCurrent();
if (current == null) {
// 裝載logo圖象
Image logo = null;
try
{
logo = Image.createImage("/logo.png");
}
catch (IOException e) { }
// 顯示logo
Alert splashScreen = new Alert(null, "郎銳2005年作\n版權所有(c)\n2005--2006", logo, AlertType.INFO);
// 延遲4秒
splashScreen.setTimeout(4000);
//新建ChoosePieceScreen對象
choosePieceScreen = new ChoosePieceScreen(this);
// 顯示游戲界面
Display.getDisplay(this).setCurrent(splashScreen, choosePieceScreen);
}
else
{
// 顯示當前界面
Display.getDisplay(this).setCurrent(current);
}
}
/* (非 Javadoc)
* @see javax.microedition.midlet.MIDlet#pauseApp()
*/
protected void pauseApp() {
// TODO 自動生成方法存根
}
/* (非 Javadoc)
* @see javax.microedition.midlet.MIDlet#destroyApp(boolean)
*/
protected void destroyApp(boolean arg0) throws MIDletStateChangeException {
// TODO 自動生成方法存根
}
public void quit() throws MIDletStateChangeException
{
// 退出程序
destroyApp(false);
notifyDestroyed();
}
public void choosePieceDone(boolean isPlayerCat)
{
// 新建GameScreen對象
gameScreen = new GameScreen(this, isPlayerCat);
// 設置游戲界面
display.setCurrent(gameScreen);
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -