iモード携帯電話用Java(iアプリ) Part10
■ このスレッドは過去ログ倉庫に格納されています
0251デフォルトの名無しさん
2005/12/09(金) 18:13:34public class Exec extends MApplication {
canvas can = null;
public void start() {
can = new canvas();
Display.setCurrent(can);
// 特に意味はありません。ゲーム的なループです
while( true ) { System.out.println(" >>[loop]"); }
}
public synchronized void processSystemEvent(int ptype,int param) {
if( ptype == MApplication.MODE_CHANGED_EVENT ) {
System.out.println("[event]");
((MApplication)IApplication.getCurrentApp()).deactivate();
can.stime.stop(); can.stime.start();
}
}
}
class canvas extends Canvas {
ShortTimer stime = null;
public canvas( ) { stime = ShortTimer.getShortTimer(this,1,100,false); }
public void paint( Graphics g ) {}
public synchronized void processEvent( int ptype, int param ) {
if( ptype == Display.TIMER_EXPIRED_EVENT ) {
try {
System.out.println(" >>[sleep]");
((MApplication)IApplication.getCurrentApp()).sleep();
}
catch(Exception e) { stime.stop(); stime.start(); }
}
}
}
■ このスレッドは過去ログ倉庫に格納されています