⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 midpcanvas.java

📁 A "Time To First Fix" duration evaluation (J2ME application) on Nokia S60
💻 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 + -