startconfirm.java

来自「GPS Track connects to a GPS and records 」· Java 代码 · 共 38 行

JAVA
38
字号
// J2ME GPS Track
// Copyright (C) 2006 Dana Peters
// http://www.qcontinuum.org/gpstrack

package org.qcontinuum.gpstrack;

import javax.microedition.lcdui.*;

public class StartConfirm extends Form implements CommandListener {

    private Displayable mParent;
    private Command mYesCommand, mNoCommand;

    public StartConfirm(Displayable parent) {
        super("Start");
        mParent = parent;
        Preferences preferences = GpsTrack.getPreferences();
        append(new StringItem(null, "Connect to GPS?\n"));
        if (preferences.getConnectType() == Preferences.CONNECTTYPE_BLUETOOTH)
            append(new StringItem("Bluetooth:", preferences.getBluetoothHost()));
         else {
            append(new StringItem("Serial Port:", preferences.getPort()) + "\n");
            append(new StringItem("Baud:", preferences.getBaud()));
        }
        addCommand(mYesCommand = new Command("Yes", Command.OK, 0));
        addCommand(mNoCommand = new Command("No", Command.CANCEL, 0));
        setCommandListener(this);
    }
    
    public void commandAction(Command c, Displayable d)  {
        if (c == mYesCommand)
            GpsTrack.display(new StartProgress(mParent));
        else if (c == mNoCommand)
            GpsTrack.display(new StartMenu(mParent));
    }

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?