exportmapprogress.java
来自「GPS Track connects to a GPS and records 」· Java 代码 · 共 46 行
JAVA
46 行
// J2ME GPS Track
// Copyright (C) 2006 Dana Peters
// http://www.qcontinuum.org/gpstrack
package org.qcontinuum.gpstrack;
import javax.microedition.lcdui.*;
public class ExportMapProgress extends Form implements CommandListener, Runnable {
private Displayable mParent;
private String mTrackName;
private String mUserName;
private Gauge mProgressGauge;
private Command mCancelCommand;
public ExportMapProgress(Displayable parent, String trackName, String userName) {
super("Web Site");
mParent = parent;
mTrackName = trackName;
mUserName = userName;
append(new StringItem("Uploading...", "\n"));
mProgressGauge = new Gauge(null, false, 10, 0);
append(mProgressGauge);
addCommand(mCancelCommand = new Command("Cancel", Command.CANCEL, 0));
setCommandListener(this);
new Thread(this).start();
}
public void commandAction(Command c, Displayable d) {
if (c == mCancelCommand) {
GpsTrack.display(mParent);
}
}
public void run() {
Thread.currentThread().yield();
try {
Track.writeHttp(Track.FORMAT_NONE, mTrackName, mUserName, mProgressGauge);
GpsTrack.display("Go to http://qcontinuum.org/map/ with username \"" + mUserName + "\" to view your track.", mParent);
} catch (Exception ex) {
GpsTrack.display(ex, mParent);
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?