Rev 221 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
206 | ligi | 1 | /*********************************************************************** |
2 | * |
||
3 | * DUBwise == Digital UFO Broadcasting with intelligent service equipment |
||
4 | * main MIDLet Source file |
||
5 | * |
||
6 | * Author: Marcus -LiGi- Bueschleb |
||
7 | * Mailto: LiGi @at@ LiGi DOTT de |
||
8 | * |
||
9 | ************************************************************************/ |
||
10 | |||
11 | import javax.microedition.lcdui.*; |
||
12 | import javax.microedition.midlet.*; |
||
13 | |||
382 | ligi | 14 | //#if j2memap=="on" |
15 | import com.eightmotions.map.MapDisplay; |
||
16 | import com.eightmotions.util.UtilMidp; |
||
17 | //#endif |
||
206 | ligi | 18 | public class DUBwise |
19 | extends MIDlet |
||
20 | |||
21 | { |
||
22 | public Display display; |
||
23 | public DUBwiseCanvas canvas; |
||
24 | public boolean loaded=false; |
||
25 | |||
26 | public void log(String str) |
||
27 | { |
||
28 | // canvas.debug.log(str); |
||
29 | } |
||
30 | public void vibrate(int duration) |
||
31 | { |
||
32 | display.vibrate(duration); |
||
33 | } |
||
34 | |||
382 | ligi | 35 | //#if j2memap=="on" |
36 | MapDisplay m_map; |
||
37 | Canvas map_canvas; |
||
38 | //#endif |
||
39 | |||
206 | ligi | 40 | protected void startApp() |
41 | throws MIDletStateChangeException |
||
42 | { |
||
382 | ligi | 43 | if (loaded) |
44 | { |
||
45 | System.out.println("app already loaded"); |
||
46 | display.setCurrent(canvas); |
||
47 | return; // when allready done -> do not do it again |
||
48 | } |
||
206 | ligi | 49 | |
382 | ligi | 50 | // m_map.init(); |
51 | // Display.getDisplay(this).setCurrent(m_map.getCanvas()); |
||
221 | ligi | 52 | |
382 | ligi | 53 | //#if j2memap=="on" |
54 | UtilMidp.checkMIDP(this); //Initialise the utility library... |
||
55 | m_map=new MapDisplay(); |
||
56 | m_map.setModeProxy(true); |
||
57 | map_canvas=m_map.getCanvas(); |
||
58 | //#endif |
||
59 | |||
60 | display = Display.getDisplay(this); |
||
61 | canvas=new DUBwiseCanvas(this); |
||
62 | |||
63 | // fire up canvas |
||
64 | display.setCurrent(canvas); |
||
65 | loaded=true; |
||
66 | // System.out.println("DUBwise start done"); |
||
206 | ligi | 67 | } |
68 | |||
69 | |||
382 | ligi | 70 | public void quit() { |
71 | destroyApp(true); |
||
72 | notifyDestroyed(); |
||
73 | } |
||
74 | protected void pauseApp() { |
||
75 | quit(); |
||
76 | System.out.println("app paused"); |
||
77 | } |
||
206 | ligi | 78 | |
382 | ligi | 79 | protected void destroyApp(boolean arg0) |
80 | { |
||
81 | |||
82 | } |
||
83 | |||
206 | ligi | 84 | } |