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

📄 midletmain.java

📁 SEMC_Java3D_041103_final.pdf主要描述java在3d方面的开发
💻 JAVA
字号:
/************************************************************************* MIDletMain is a demo application that shows the use of various JSR 184 API caqlls to generate a 3D scene with animation. This file has the basic code for implementing the MIDlet and starting a Timer thread that's used to animate the 3D object. Based on example code from Sony Ericsson. IMPORTANT: This code requires use of the M3G (JSR-184) API to function.   File: MIDletMain.java Needs: MyCanvas.java Resources: cubeface.png, backdrop.png Created by: Tom Thompson  COPYRIGHT All rights reserved Sony Ericsson Mobile Communications AB 2004. The software is the copyrighted work of Sony Ericsson Mobile Communications AB. The use of the software is subject to the terms of the end-user license agreement which accompanies or is included with the software. The software is provided "as is" and Sony Ericsson specifically disclaim any warranty or condition whatsoever regarding merchantability or fitness for a specific purpose, title or non-infringement. No warranty of any kind is made in relation to the condition, suitability, availability, accuracy, reliability, merchantability and/or non-infringement of the software provided herein. *************************************************************************/import javax.microedition.midlet.*;import javax.microedition.lcdui.*;import java.util.*;// Our custom MIDlet public class MIDletMain extends MIDlet{    static MIDletMain instance;    MyCanvas displayable = new MyCanvas(); // Custom Canvas does 3D graphics    Timer iTimer = new Timer();    // Timer to implement animation    // MIDlet's constructor    public MIDletMain() {        this.instance = this;    } // end constructor    // Main entry point    public void startApp() {        Display.getDisplay(this).setCurrent(displayable);        iTimer.schedule( new MyTimerTask(), 0, 40 ); // Start timer    } // end startApp()    // Manage pausing the MIDlet    public void pauseApp() {    } // end pauseApp    // Manage terminating the MIDlet    public void destroyApp(boolean unconditional) {    } // end destroyApp()    // Quit the MIDlet, doing any clean-up before calling destroyApp()    public static void quitApp() {        instance.destroyApp(true);        instance.notifyDestroyed();        instance = null;    } // end quitApp()    // Our timer task for providing animation    class MyTimerTask extends TimerTask {        public void run() {            if( displayable != null ) { // If Canvas is present...                displayable.repaint(); // ... call its repaint()            } // end if        } // end run    } // end TimerTask     } // end MIDletMain

⌨️ 快捷键说明

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