📄 about.java
字号:
package com.ismyway.anyview.win;
import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.Graphics;
import com.ismyway.anyview.others.Configure;
import com.ismyway.anyview.others.Settings;
import com.ismyway.fairyui.Component;
import com.ismyway.fairyui.Handset;
import com.ismyway.fairyui.HyperLink;
import com.ismyway.fairyui.NewLine;
import com.ismyway.fairyui.Panel;
import com.ismyway.fairyui.Row;
import com.ismyway.fairyui.TextBlock;
import com.ismyway.util.Res;
import com.ismyway.util.Theme;
public class About extends Panel {
public static String ver = "Anyview ";
static {
ver += Handset.getAppProperty("MIDlet-Version");
}
public About() {
setTitle(Res.get("About"));
StringBuffer sb = new StringBuffer();
sb.append(ver).append('').append('');
sb.append(Res.get("UsedTime")).append(Configure.totalUsedTimes).append('');
sb.append(Res.get("ReadTime")).append(formatTime(Configure.totalReadTimes)).append('');
sb.append(Res.get("ReadBooks")).append(Configure.totalReadBooks).append('');
sb.append(Res.get("ReadBytes")).append(formatLong(Configure.totalReadCharacter))
.append('');
sb.append(" ");
Row row = new Row();
row.add(new TextBlock(sb.toString()));
row.add(new NewLine(1, new Integer(Theme.ComponentLight), Graphics.DOTTED));
row.add(new TextBlock(Res.get("Check Update")));
row.add(new NewLine(1, new Integer(Theme.ComponentLight), Graphics.DOTTED));
row.add(new HyperLink("http://www.ismyway.com",
"http://www.ismyway.com/anyview.asp"));
row.add(new NewLine(1, new Integer(Theme.ComponentLight), Graphics.DOTTED));
add(row);
addCommand(new Command(Res.get("System Info"), Command.OK, 1));
addCommand(new Command(Res.get("Close"), Command.EXIT, 1));
}
public void commandAction(Command cmd, Component c) {
String str = cmd.getLabel();
if (str.equals(Res.get("Close"))) {
mainCanvas.closePopup();
return;
} else if (str.equals(Res.get("System Info"))) {
mainCanvas.closePopup();
mainCanvas.showPopup(new SysInfo(), Settings.ANIMATE_DOWN);
return;
}
if (c instanceof HyperLink) {
Handset.platformRequest(((HyperLink) c).getLink());
}
}
private String formatTime(long l) {
long hour = l / 3600;
l -= hour * 3600;
long min = l / 60;
l -= min * 60;
long sec = l;
return new StringBuffer().append(hour).append(" HH ").append(min).append(" MM ")
.append(sec).append(" SS").toString();
}
private String formatLong(long num) {
if (num < 1000) {
return "" + num;
} else {
StringBuffer sb = new StringBuffer();
long quotient = num / 1000;
long rest = num - (quotient * 1000);
sb.insert(0, rest);
num = quotient;
while (num > 1000) {
quotient = num / 1000;
rest = num - (quotient * 1000);
sb.insert(0, rest + ",");
num = quotient;
}
if (num > 0) {
sb.insert(0, num + ",");
}
return sb.toString();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -