📄 sysinfo.java
字号:
package com.ismyway.anyview.win;
import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.Display;
import com.ismyway.fairyui.Component;
import com.ismyway.fairyui.Handset;
import com.ismyway.fairyui.Panel;
import com.ismyway.fairyui.Row;
import com.ismyway.fairyui.TextBlock;
import com.ismyway.util.Res;
public class SysInfo extends Panel {
StringBuffer sb = new StringBuffer();
void addInfo(String key, String value) {
sb.append(key).append(value).append((char) 8);
}
public SysInfo() {
setTitle(Res.get("System Info"));
Display display = Display.getDisplay(Handset.getMIDlet());
boolean isColor = display.isColor();
int numColors = display.numColors();
if (!isColor) {
addInfo("Levels: ", Integer.toString(numColors));
} else {
addInfo(Res.get("Color") + " :", Integer.toString(numColors));
}
addInfo(Res.get("Canvas Width") + ": ", Integer.toString(mainCanvas.getWidth()));
addInfo(Res.get("Canvas Height") + ": ", Integer.toString(mainCanvas.getHeight()));
try {
Class.forName("javax.microedition.media.control.VideoControl");
addInfo("MMAPI: ", Res.get("Support"));
addInfo("MMAPI-Version: ", System.getProperty("microedition.media.version"));
} catch (ClassNotFoundException e) {
addInfo("MMAPI: ", Res.get("Unsupport"));
}
try {
Class.forName("javax.wireless.messaging.Message");
addInfo("WMAPI 1.1: ", Res.get("Support"));
try {
Class.forName("javax.wireless.messaging.MultipartMessage");
addInfo("WMAPI 2.0: ", Res.get("Support"));
} catch (ClassNotFoundException e) {
addInfo("WMAPI 2.0: ", Res.get("Unsupport"));
}
} catch (ClassNotFoundException e) {
addInfo("WMAPI 1.1: ", Res.get("Unsupport"));
}
try {
Class.forName("javax.bluetooth.DiscoveryAgent");
addInfo("Bluetooth-API: ", Res.get("Support"));
try {
Class.forName("javax.obex.ClientSession");
addInfo("Bluetooth-Obex-API: ", Res.get("Support"));
} catch (ClassNotFoundException e) {
addInfo("Bluetooth-Obex-API: ", Res.get("Unsupport"));
}
} catch (ClassNotFoundException e) {
addInfo("Bluetooth-API: ", Res.get("Unsupport"));
}
try {
Class.forName("javax.microedition.m3g.Graphics3D");
addInfo("M3G-API: ", Res.get("Support"));
} catch (ClassNotFoundException e) {
addInfo("M3G-API: ", Res.get("Unsupport"));
}
try {
Class.forName("javax.microedition.pim.PIM");
addInfo("PIM-API: ", Res.get("Support"));
} catch (ClassNotFoundException e) {
addInfo("PIM-API: ", Res.get("Unsupport"));
}
try {
Class.forName("javax.microedition.io.file.FileSystemRegistry");
addInfo("FileConnection-API: ", Res.get("Support"));
} catch (ClassNotFoundException e) {
addInfo("FileConnection-API: ", Res.get("Unsupport"));
}
try {
Class.forName("javax.microedition.location.Location");
addInfo("Location-API: ", Res.get("Support"));
} catch (ClassNotFoundException e) {
addInfo("Location-API: ", Res.get("Unsupport"));
}
try {
Class.forName("javax.microedition.xml.rpc.Operation");
addInfo("WebServices-API: ", Res.get("Support"));
} catch (ClassNotFoundException e) {
addInfo("WebServices-API: ", Res.get("Unsupport"));
}
try {
Class.forName("javax.microedition.sip.SipConnection");
addInfo("SIP-API: ", Res.get("Support"));
} catch (ClassNotFoundException e) {
addInfo("SIP-API: ", Res.get("Unsupport"));
}
try {
Class.forName("com.nokia.mid.ui.FullCanvas");
addInfo("Nokia-UI-API: ", Res.get("Support"));
} catch (ClassNotFoundException e) {
addInfo("Nokia-UI-API: ", Res.get("Unsupport"));
}
try {
Class.forName("com.siemens.mp.MIDlet");
addInfo("Siemens-Extension-API: ", Res.get("Support"));
try {
Class.forName("com.siemens.mp.color_game.GameCanvas");
addInfo("Siemens-ColorGame-API: ", Res.get("Support"));
} catch (ClassNotFoundException e) {
addInfo("Siemens-ColorGame-API: ", Res.get("Unsupport"));
}
} catch (ClassNotFoundException e) {
addInfo("Siemens-Extension-API: ", Res.get("Unsupport"));
}
addInfo("supports.video.capture: ", System.getProperty("supports.video.capture"));
addInfo("video.encodings: ", System.getProperty("video.encodings"));
addInfo("video.snapshot.encodings: ", System.getProperty("video.snapshot.encodings"));
addInfo("audio.encoding: ", System.getProperty("audio.encoding"));
addInfo("supports.audio.capture: ", System.getProperty("supports.audio.capture"));
addInfo("supports.recording: ", System.getProperty("supports.recording"));
addInfo("supports.mixing: ", System.getProperty("supports.mixing"));
try {
Class.forName("javax.microedition.media.Manager");
addInfo("MMAPI present:", Res.get("Support"));
addInfo("microedition.media.version: ", System.getProperty("microedition.media.version"));
addInfo("streamable.contents: ", System.getProperty("streamable.contents"));
} catch (Exception e) {
addInfo("MMAPI present:", Res.get("Unsupport"));
}
String nokiaSound = Res.get("Unsupport");
try {
Class.forName("com.nokia.mid.sound.Sound");
nokiaSound = Res.get("Support");
} catch (Exception e) {
// Nokia UI API is not present
}
addInfo("Nokia Sound: ", nokiaSound);
addInfo("Microedition Configuration: ", System.getProperty("microedition.configuration"));
addInfo("Microedition Profiles: ", System.getProperty("microedition.profiles"));
addInfo("microedition.jtwi.version:", System.getProperty("microedition.jtwi.version"));
addInfo("microedition.platform:", System.getProperty("microedition.platform"));
addInfo("microedition.locale:", System.getProperty("microedition.locale"));
addInfo(Res.get("Default") + Res.get("Encoding") + " :", System.getProperty("microedition.encoding"));
addInfo(Res.get("Total Memory") + " :", Long.toString(Runtime.getRuntime().totalMemory()) + " bytes");
addInfo(Res.get("Free Memory") + " :", Long.toString(Runtime.getRuntime().freeMemory()) + " bytes");
addInfo(Res.get("Default") + Res.get("TimeZone") + " :", java.util.TimeZone.getDefault().getID());
Row row = new Row();
row.add(new TextBlock(sb.toString()));
add(row);
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();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -