📄 sketchtest.java
字号:
/** * */package gr.fire.test;import gr.fire.core.CommandListener;import gr.fire.core.Component;import gr.fire.core.FireScreen;import gr.fire.ui.FireTheme;import gr.fire.ui.SketchArea;import gr.fire.util.Log;import java.io.IOException;import javax.microedition.lcdui.Command;import javax.microedition.lcdui.Display;import javax.microedition.lcdui.Displayable;import javax.microedition.midlet.MIDlet;import javax.microedition.midlet.MIDletStateChangeException;/** * @author padeler * */public class SketchTest extends MIDlet implements CommandListener{ // Some commands exit, exits the application private gr.fire.browser.util.Command exit = new gr.fire.browser.util.Command("Exit",Command.EXIT,1); private gr.fire.browser.util.Command clear = new gr.fire.browser.util.Command("Clear",Command.CANCEL,1); private SketchArea sketch; /* (non-Javadoc) * @see javax.microedition.midlet.MIDlet#destroyApp(boolean) */ protected void destroyApp(boolean arg0) throws MIDletStateChangeException { // TODO Auto-generated method stub } /* (non-Javadoc) * @see javax.microedition.midlet.MIDlet#pauseApp() */ protected void pauseApp() { // TODO Auto-generated method stub } /* (non-Javadoc) * @see javax.microedition.midlet.MIDlet#startApp() */ protected void startApp() throws MIDletStateChangeException { // initialize the firescreen using the Display FireScreen screen = FireScreen.getScreen(Display.getDisplay(this)); screen.setFullScreenMode(true); // use the fireScreen in fullscreen mode. //screen.setOrientation(FireScreen.LANDSCAPELEFT); try { // load a theme. This is not necessery, but it improves the visual result a lot. FireScreen.setTheme(new FireTheme("file://theme.properties")); } catch (IOException e) { Log.logError("Failed to load theme.",e); } sketch = new SketchArea(); sketch.setPrefSize(screen.getWidth(),screen.getHeight()); sketch.setBackgroundColor(0x00000000); sketch.setForegroundColor(0xFFFFFFFF); sketch.setLeftSoftKeyCommand(exit); sketch.setRightSoftKeyCommand(clear); sketch.setCommandListener(this); screen.setCurrent(sketch); } /* (non-Javadoc) * @see gr.fire.core.CommandListener#commandAction(javax.microedition.lcdui.Command, gr.fire.core.Component) */ public void commandAction(Command cmd, Component c) { if(cmd==clear) { sketch.clear(); return; } if(cmd==exit) { notifyDestroyed(); } } /* (non-Javadoc) * @see javax.microedition.lcdui.CommandListener#commandAction(javax.microedition.lcdui.Command, javax.microedition.lcdui.Displayable) */ public void commandAction(Command arg0, Displayable arg1) { }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -