📄 m3gmidlet.java
字号:
import java.util.Hashtable;
import javax.microedition.midlet.MIDlet;
import javax.microedition.lcdui.*;
import javax.microedition.m3g.Graphics3D;
public class M3GMIDlet extends MIDlet implements CommandListener
{
private Command exitCommand = new Command("Exit", Command.EXIT, 1);
/**
* Starts application and shows the list of samples. The user can
* select a sample for execution and return to the selection screen.
*/
public void startApp()
{
Form mForm = new Form("The 3D Properties:");
String s = new String();
Font.getFont(0, 1, 8);
mForm.append("\nM3G Version: ");
mForm.append(s + System.getProperty("microedition.m3g.version"));
Hashtable hashtable = Graphics3D.getProperties();
mForm.append("\nAntialiasing: ");
mForm.append(s + (Boolean)hashtable.get("supportAntialiasing"));
mForm.append("\nTrue color: ");
mForm.append(s + (Boolean)hashtable.get("supportTrueColor"));
mForm.append("\nDithering: ");
mForm.append(s + (Boolean)hashtable.get("supportDithering"));
mForm.append("\nMipmapping: ");
mForm.append(s + (Boolean)hashtable.get("supportMipmapping"));
mForm.append("\nPerpective Correction: ");
mForm.append(s + (Boolean)hashtable.get("supportPerspectiveCorrection"));
mForm.append("\nLocal Camera Lighting: ");
mForm.append(s + (Boolean)hashtable.get("supportLocalCameraLighting"));
mForm.append("\nMax Lights: ");
mForm.append(s + (Integer)hashtable.get("maxLights"));
mForm.append("\nMax Viewport Dimension: ");
mForm.append(s + (Integer)hashtable.get("maxViewportDimension"));
mForm.append("\nMax Texture Dimension: ");
mForm.append(s + (Integer)hashtable.get("maxTextureDimension"));
mForm.append("\nMax Sprite Crop Dimension: ");
mForm.append(s + (Integer)hashtable.get("maxSpriteCropDimension"));
mForm.append("\nMax Transforms Per Vertex: ");
mForm.append(s + (Integer)hashtable.get("maxTransformsPerVertex"));
mForm.append("\nNumber of Texture Units: ");
mForm.append(s + (Integer)hashtable.get("numTextureUnits"));
mForm.addCommand(exitCommand);
mForm.setCommandListener(this);
Display.getDisplay(this).setCurrent(mForm);
}
/**
* Not used.
*/
public void pauseApp()
{
}
/**
* Not used.
*/
public void destroyApp(boolean unconditional)
{
}
/**
* Receives the command actions from the selection screen as well as
* the sample screens.
*
* @param command command
* @param displayable source of the command
*/
public void commandAction(Command command, Displayable displayable)
{
if (command == exitCommand)
{
destroyApp(true);
notifyDestroyed();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -