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

📄 optionsunits.java

📁 GPS Track connects to a GPS and records the path that you travel. Tracks can be uploaded to a web s
💻 JAVA
字号:
// J2ME GPS Track
// Copyright (C) 2006 Dana Peters
// http://www.qcontinuum.org/gpstrack

package org.qcontinuum.gpstrack;

import javax.microedition.lcdui.*;

public class OptionsUnits extends List implements CommandListener {
    
    private Displayable mParent;
    private Command mOkCommand, mCancelCommand;
    
    public OptionsUnits(Displayable parent) {
        super("Units", List.EXCLUSIVE);
        mParent = parent;
        append("Metric", null);
        append("U.S.", null);
        Preferences preferences = GpsTrack.getPreferences();
        int units = preferences.getUnitType();
        setSelectedIndex(units, true);
        addCommand(mOkCommand = new Command("OK", Command.OK, 0));
        addCommand(mCancelCommand = new Command("Cancel", Command.CANCEL, 0));
        setCommandListener(this);
    }

    public void commandAction(Command c, Displayable d)  {
        if (c == mOkCommand) {
            Preferences preferences = GpsTrack.getPreferences();
            preferences.setUnitType(getSelectedIndex());
            preferences.save();
            GpsTrack.display(mParent);
        } else if (c == mCancelCommand) {
            GpsTrack.display(mParent);
        }
    }
}

⌨️ 快捷键说明

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