📄 settingform.java
字号:
import javax.microedition.lcdui.*;
/**
* <p>Title: </p>
*
* <p>Description: </p>
*
* <p>Copyright: Copyright (c) 2005</p>
*
* <p>Company: </p>
*
* @author not attributable
* @version 1.0
*/
public class SettingForm extends Form implements CommandListener {
public SettingForm() {
super("设置");
setCommandListener(this);
addCommand(new Command("返回", Command.BACK, 1));
addCommand(new Command("确认", Command.OK, 1));
cGSound.setLabel("声音");
cGSound.append("开启", null);
cGSound.append("关闭", null);
cGVibrate.setLabel("震动");
cGVibrate.append("开启", null);
cGVibrate.append("关闭", null);
cGSound.setSelectedIndex(MainMIDlet.isSoundOpen ? 0 : 1, true);
cGVibrate.setSelectedIndex(MainMIDlet.isVibrateOpen ? 0 : 1, true);
this.append(cGSound);
this.append(cGVibrate);
this.append(tfGameLoop);
}
public void commandAction(Command command, Displayable displayable) {
switch (command.getCommandType()) {
case Command.OK:
MainMIDlet.isSoundOpen = (cGSound.getSelectedIndex() == 0);
MainMIDlet.isVibrateOpen = (cGVibrate.getSelectedIndex() == 0);
MainMIDlet.gameLoop = Integer.parseInt(tfGameLoop.getString());
break;
case Command.BACK:
MainMIDlet.showMainCanvas();
break;
}
}
ChoiceGroup cGSound = new ChoiceGroup("", ChoiceGroup.EXCLUSIVE);
ChoiceGroup cGVibrate = new ChoiceGroup("", ChoiceGroup.EXCLUSIVE);
TextField tfGameLoop = new TextField("游戏速度", Integer.toString(MainMIDlet.gameLoop), 2, TextField.NUMERIC);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -