?? midpcanvas.java
字號:
package org.mcyrrer.ttff;import javax.microedition.lcdui.*;/** * The Canvas that handle all GUI interaction with MainClass * @author Mattias Gustavsson */public class MIDPCanvas extends Canvas implements CommandListener { private String text; public MIDPCanvas() { } /** * paint */ public void paint(Graphics g) { Font f3 = Font.getFont(Font.FACE_SYSTEM, Font.STYLE_PLAIN, Font.SIZE_SMALL); Font f1 = Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_PLAIN, Font.SIZE_LARGE); g.setColor(225, 225, 255); g.fillRect(0, 0, getWidth(), getHeight()); g.setColor(0, 0, 0); g.setFont(f1); g.drawString("TimeToFirstFix", getWidth() / 2, 0, Graphics.TOP | Graphics.HCENTER); g.drawString("Timer", getWidth() / 2, 20, Graphics.TOP | Graphics.HCENTER); g.setFont(f1); g.drawString(text, getWidth() / 2, getHeight() / 2, Graphics.TOP | Graphics.HCENTER); } /** * Called when a key is pressed. */ protected void keyPressed(int keyCode) { } /** * Called when a key is released. */ protected void keyReleased(int keyCode) { } /** * Called when a key is repeated (held down). */ protected void keyRepeated(int keyCode) { } /** * Called when the pointer is dragged. */ protected void pointerDragged(int x, int y) { } /** * Called when the pointer is pressed. */ protected void pointerPressed(int x, int y) { } /** * Called when the pointer is released. */ protected void pointerReleased(int x, int y) { } /** * Called when action should be handled */ public void commandAction(Command command, Displayable displayable) { } /** * * @param text - number of seconds that is visible in the midle of the screen */ public void setText(String text) { this.text = text; }}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -