summaryrefslogtreecommitdiff
path: root/trunk/build/preprocessed/gui/geoc.java
blob: ba540771fb34c19ad4d726baba3a2cf30b41be4e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
/*
 * geoc.java
 *
 * Created on July 14, 2007, 1:29 AM
 */

package gui;

import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import javax.microedition.location.LocationException;
import java.util.Timer;
import nav.*;

/**
 *
 * @author manut
 */
public class geoc extends MIDlet implements CommandListener {
    
    private navigate nav;
    
    /**
     * Creates a new instance of geoc
     */
    public geoc() {
 
       try {

          nav = new navigate(this);

       } catch (LocationException e) {

            this.get_stringItemHead1().setText("no GPS!/n");
            
       }
    }
    
    private Form editForm;//GEN-BEGIN:MVDFields
    private StringItem stringItemHead1;
    private Command exitCommand;
    private TextField textFieldEnterNorth;
    private TextField textFieldEnterEast;
    private Spacer spacer1;
    private StringItem stringItemEnterDest;
    private Command screenCommand1;
    private Command exitCommand1;
    private Command exitCommand2;
    private Command itemCommand1;
    private Command itemCommand2;
    private Form navForm;
    private Command exitCommand3;
    private Command exitCommand4;
    private Command screenCommand2;
    private StringItem stringItemHead2;
    private Spacer spacer2;
    private StringItem stringItemCourse;
    private StringItem stringItemDistance;
    private StringItem stringItemActNorth;
    private StringItem stringItemActEast;
    private StringItem stringItemActHeight;
    private StringItem stringItemDestination;
    private StringItem stringItemDestNorth;
    private StringItem stringItemDestEast;
    private Command okCommand1;//GEN-END:MVDFields

//GEN-LINE:MVDMethods

    /** This method initializes UI of the application.//GEN-BEGIN:MVDInitBegin
     */
    private void initialize() {//GEN-END:MVDInitBegin
        // Insert pre-init code here
        navForm = new Form(null, new Item[] {//GEN-BEGIN:MVDInitInit
            get_stringItemHead2(),
            get_spacer2(),
            get_stringItemCourse(),
            get_stringItemDistance(),
            get_stringItemActNorth(),
            get_stringItemActEast(),
            get_stringItemActHeight(),
            get_stringItemDestination(),
            get_stringItemDestNorth(),
            get_stringItemDestEast()
        });
        navForm.addCommand(get_exitCommand4());
        navForm.addCommand(get_screenCommand2());
        navForm.setCommandListener(this);
        editForm = new Form(null, new Item[] {
            get_stringItemHead1(),
            get_spacer1(),
            get_stringItemEnterDest(),
            get_textFieldEnterNorth(),
            get_textFieldEnterEast()
        });
        editForm.addCommand(get_exitCommand());
        editForm.addCommand(get_okCommand1());
        editForm.setCommandListener(this);
        getDisplay().setCurrent(editForm);//GEN-END:MVDInitInit
        // Insert post-init code here
    }//GEN-LINE:MVDInitEnd
    
    /** Called by the system to indicate that a command has been invoked on a particular displayable.//GEN-BEGIN:MVDCABegin
     * @param command the Command that ws invoked
     * @param displayable the Displayable on which the command was invoked
     */
    public void commandAction(Command command, Displayable displayable) {//GEN-END:MVDCABegin
        // Insert global pre-action code here
        if (displayable == editForm) {//GEN-BEGIN:MVDCABody
            if (command == exitCommand) {//GEN-END:MVDCABody
                // Insert pre-action code here
                exitMIDlet();//GEN-LINE:MVDCAAction3
                // Insert post-action code here        at gui.geoc.<init>(geoc.java:34)
            } else if (command == okCommand1) {//GEN-LINE:MVDCACase3
                // Insert pre-action code here
                javax.microedition.lcdui.Alert al = new javax.microedition.lcdui.Alert("Error");
                al.setString("Coord. parsing failed\nor no gps!");
                try {
                  nav.setDestination(get_textFieldEnterNorth().getString(), get_textFieldEnterEast().getString());
                } catch(Exception ae) {
                  getDisplay().setCurrent(al, navForm);
                }
                getDisplay().setCurrent(navForm);
                /*
getDisplay ().setCurrent (navForm);//GEN-LINE:MVDCAAction43
                // Iert post-action code here
                 */
            }//GEN-BEGIN:MVDCACase43
        } else if (displayable == navForm) {
            if (command == exitCommand4) {//GEN-END:MVDCACase43
                // Insert pre-action code here
                exitMIDlet();//GEN-LINE:MVDCAAction24
                // Insert post-action code here
            } else if (command == screenCommand2) {//GEN-LINE:MVDCACase24
                // Insert pre-action code here
                getDisplay().setCurrent(editForm);//GEN-LINE:MVDCAAction26
                // Insert post-action code here
            }//GEN-BEGIN:MVDCACase26
        }//GEN-END:MVDCACase26
        // Insert global post-action code here
}//GEN-LINE:MVDCAEnd
    
    /**
     * This method should return an instance of the display.
     */
    public Display getDisplay() {//GEN-FIRST:MVDGetDisplay
        return Display.getDisplay(this);
    }//GEN-LAST:MVDGetDisplay
    
    /**
     * This method should exit the midlet.
     */
    public void exitMIDlet() {//GEN-FIRST:MVDExitMidlet
        getDisplay().setCurrent(null);
        destroyApp(true);
        notifyDestroyed();
    }//GEN-LAST:MVDExitMidlet
    
    
    /** This method returns instance for stringItemHead1 component and should be called instead of accessing stringItemHead1 field directly.//GEN-BEGIN:MVDGetBegin4
     * @return Instance for stringItemHead1 component
     */
    public StringItem get_stringItemHead1() {
        if (stringItemHead1 == null) {//GEN-END:MVDGetBegin4
            // Insert pre-init code here
            stringItemHead1 = new StringItem("geoc", "v0.1");//GEN-LINE:MVDGetInit4
            // Insert post-init code here
        }//GEN-BEGIN:MVDGetEnd4
        return stringItemHead1;
    }//GEN-END:MVDGetEnd4
    
    /** This method returns instance for exitCommand component and should be called instead of accessing exitCommand field directly.//GEN-BEGIN:MVDGetBegin5
     * @return Instance for exitCommand component
     */
    public Command get_exitCommand() {
        if (exitCommand == null) {//GEN-END:MVDGetBegin5
            // Insert pre-init code here
            exitCommand = new Command("Exit", Command.EXIT, 1);//GEN-LINE:MVDGetInit5
            // Insert post-init code here
        }//GEN-BEGIN:MVDGetEnd5
        return exitCommand;
    }//GEN-END:MVDGetEnd5

    /** This method returns instance for textFieldEnterNorth component and should be called instead of accessing textFieldEnterNorth field directly.//GEN-BEGIN:MVDGetBegin6
     * @return Instance for textFieldEnterNorth component
     */
    public TextField get_textFieldEnterNorth() {
        if (textFieldEnterNorth == null) {//GEN-END:MVDGetBegin6
            // Insert pre-init code here
            textFieldEnterNorth = new TextField("North", "47:42.466", 120, TextField.ANY);//GEN-LINE:MVDGetInit6
            // Insert post-init code here
        }//GEN-BEGIN:MVDGetEnd6
        return textFieldEnterNorth;
    }//GEN-END:MVDGetEnd6

    /** This method returns instance for textFieldEnterEast component and should be called instead of accessing textFieldEnterEast field directly.//GEN-BEGIN:MVDGetBegin7
     * @return Instance for textFieldEnterEast component
     */
    public TextField get_textFieldEnterEast() {
        if (textFieldEnterEast == null) {//GEN-END:MVDGetBegin7
            // Insert pre-init code here
            textFieldEnterEast = new TextField("East", "9:36.620", 120, TextField.ANY);//GEN-LINE:MVDGetInit7
            // Insert post-init code here
        }//GEN-BEGIN:MVDGetEnd7
        return textFieldEnterEast;
    }//GEN-END:MVDGetEnd7

    /** This method returns instance for spacer1 component and should be called instead of accessing spacer1 field directly.//GEN-BEGIN:MVDGetBegin9
     * @return Instance for spacer1 component
     */
    public Spacer get_spacer1() {
        if (spacer1 == null) {//GEN-END:MVDGetBegin9
            // Insert pre-init code here
            spacer1 = new Spacer(1000, 1);//GEN-LINE:MVDGetInit9
            // Insert post-init code here
        }//GEN-BEGIN:MVDGetEnd9
        return spacer1;
    }//GEN-END:MVDGetEnd9

    /** This method returns instance for stringItemEnterDest component and should be called instead of accessing stringItemEnterDest field directly.//GEN-BEGIN:MVDGetBegin10
     * @return Instance for stringItemEnterDest component
     */
    public StringItem get_stringItemEnterDest() {
        if (stringItemEnterDest == null) {//GEN-END:MVDGetBegin10
            // Insert pre-init code here
            stringItemEnterDest = new StringItem("\nEnter Destination", "");//GEN-LINE:MVDGetInit10
            // Insert post-init code here
        }//GEN-BEGIN:MVDGetEnd10
        return stringItemEnterDest;
    }//GEN-END:MVDGetEnd10

    /** This method returns instance for screenCommand1 component and should be called instead of accessing screenCommand1 field directly.//GEN-BEGIN:MVDGetBegin11
     * @return Instance for screenCommand1 component
     */
    public Command get_screenCommand1() {
        if (screenCommand1 == null) {//GEN-END:MVDGetBegin11
            // Insert pre-init code here
            screenCommand1 = new Command("go to", Command.SCREEN, 1);//GEN-LINE:MVDGetInit11
            // Insert post-init code here
        }//GEN-BEGIN:MVDGetEnd11
        return screenCommand1;
    }//GEN-END:MVDGetEnd11

    /** This method returns instance for exitCommand1 component and should be called instead of accessing exitCommand1 field directly.//GEN-BEGIN:MVDGetBegin15
     * @return Instance for exitCommand1 component
     */
    public Command get_exitCommand1() {
        if (exitCommand1 == null) {//GEN-END:MVDGetBegin15
            // Insert pre-init code here
            exitCommand1 = new Command("Exit", Command.EXIT, 1);//GEN-LINE:MVDGetInit15
            // Insert post-init code here
        }//GEN-BEGIN:MVDGetEnd15
        return exitCommand1;
    }//GEN-END:MVDGetEnd15

    /** This method returns instance for exitCommand2 component and should be called instead of accessing exitCommand2 field directly.//GEN-BEGIN:MVDGetBegin16
     * @return Instance for exitCommand2 component
     */
    public Command get_exitCommand2() {
        if (exitCommand2 == null) {//GEN-END:MVDGetBegin16
            // Insert pre-init code here
            exitCommand2 = new Command("Exit", Command.EXIT, 1);//GEN-LINE:MVDGetInit16
            // Insert post-init code here
        }//GEN-BEGIN:MVDGetEnd16
        return exitCommand2;
    }//GEN-END:MVDGetEnd16

    /** This method returns instance for itemCommand1 component and should be called instead of accessing itemCommand1 field directly.//GEN-BEGIN:MVDGetBegin18
     * @return Instance for itemCommand1 component
     */
    public Command get_itemCommand1() {
        if (itemCommand1 == null) {//GEN-END:MVDGetBegin18
            // Insert pre-init code here
            itemCommand1 = new Command("Item", Command.ITEM, 1);//GEN-LINE:MVDGetInit18
            // Insert post-init code here
        }//GEN-BEGIN:MVDGetEnd18
        return itemCommand1;
    }//GEN-END:MVDGetEnd18

    /** This method returns instance for itemCommand2 component and should be called instead of accessing itemCommand2 field directly.//GEN-BEGIN:MVDGetBegin19
     * @return Instance for itemCommand2 component
     */
    public Command get_itemCommand2() {
        if (itemCommand2 == null) {//GEN-END:MVDGetBegin19
            // Insert pre-init code here
            itemCommand2 = new Command("Edit Coord.", Command.ITEM, 1);//GEN-LINE:MVDGetInit19
            // Insert post-init code here
        }//GEN-BEGIN:MVDGetEnd19
        return itemCommand2;
    }//GEN-END:MVDGetEnd19
 
    /** This method returns instance for exitCommand3 component and should be called instead of accessing exitCommand3 field directly.//GEN-BEGIN:MVDGetBegin22
     * @return Instance for exitCommand3 component
     */
    public Command get_exitCommand3() {
        if (exitCommand3 == null) {//GEN-END:MVDGetBegin22
            // Insert pre-init code here
            exitCommand3 = new Command("Exit", Command.EXIT, 1);//GEN-LINE:MVDGetInit22
            // Insert post-init code here
        }//GEN-BEGIN:MVDGetEnd22
        return exitCommand3;
    }//GEN-END:MVDGetEnd22

    /** This method returns instance for exitCommand4 component and should be called instead of accessing exitCommand4 field directly.//GEN-BEGIN:MVDGetBegin23
     * @return Instance for exitCommand4 component
     */
    public Command get_exitCommand4() {
        if (exitCommand4 == null) {//GEN-END:MVDGetBegin23
            // Insert pre-init code here
            exitCommand4 = new Command("Exit", Command.EXIT, 1);//GEN-LINE:MVDGetInit23
            // Insert post-init code here
        }//GEN-BEGIN:MVDGetEnd23
        return exitCommand4;
    }//GEN-END:MVDGetEnd23

    /** This method returns instance for screenCommand2 component and should be called instead of accessing screenCommand2 field directly.//GEN-BEGIN:MVDGetBegin25
     * @return Instance for screenCommand2 component
     */
    public Command get_screenCommand2() {
        if (screenCommand2 == null) {//GEN-END:MVDGetBegin25
            // Insert pre-init code here
            screenCommand2 = new Command("edit Coord.", Command.SCREEN, 1);//GEN-LINE:MVDGetInit25
            // Insert post-init code here
        }//GEN-BEGIN:MVDGetEnd25
        return screenCommand2;
    }//GEN-END:MVDGetEnd25

    /** This method returns instance for stringItemHead2 component and should be called instead of accessing stringItemHead2 field directly.//GEN-BEGIN:MVDGetBegin27
     * @return Instance for stringItemHead2 component
     */
    public StringItem get_stringItemHead2() {
        if (stringItemHead2 == null) {//GEN-END:MVDGetBegin27
            // Insert pre-init code here
            stringItemHead2 = new StringItem("geoc", "v0.1");//GEN-LINE:MVDGetInit27
            // Insert post-init code here
        }//GEN-BEGIN:MVDGetEnd27
        return stringItemHead2;
    }//GEN-END:MVDGetEnd27

    /** This method returns instance for spacer2 component and should be called instead of accessing spacer2 field directly.//GEN-BEGIN:MVDGetBegin28
     * @return Instance for spacer2 component
     */
    public Spacer get_spacer2() {
        if (spacer2 == null) {//GEN-END:MVDGetBegin28
            // Insert pre-init code here
            spacer2 = new Spacer(1000, 1);//GEN-LINE:MVDGetInit28
            // Insert post-init code here
        }//GEN-BEGIN:MVDGetEnd28
        return spacer2;
    }//GEN-END:MVDGetEnd28

    /** This method returns instance for stringItemCourse component and should be called instead of accessing stringItemCourse field directly.//GEN-BEGIN:MVDGetBegin29
     * @return Instance for stringItemCourse component
     */
    public StringItem get_stringItemCourse() {
        if (stringItemCourse == null) {//GEN-END:MVDGetBegin29
            // Insert pre-init code here
            stringItemCourse = new StringItem("\nCourse", "0");//GEN-LINE:MVDGetInit29
            // Insert post-init code here
        }//GEN-BEGIN:MVDGetEnd29
        return stringItemCourse;
    }//GEN-END:MVDGetEnd29

    /** This method returns instance for stringItemDistance component and should be called instead of accessing stringItemDistance field directly.//GEN-BEGIN:MVDGetBegin34
     * @return Instance for stringItemDistance component
     */
    public StringItem get_stringItemDistance() {
        if (stringItemDistance == null) {//GEN-END:MVDGetBegin34
            // Insert pre-init code here
            stringItemDistance = new StringItem("Distance", "0");//GEN-LINE:MVDGetInit34
            // Insert post-init code here
        }//GEN-BEGIN:MVDGetEnd34
        return stringItemDistance;
    }//GEN-END:MVDGetEnd34

    /** This method returns instance for stringItemActNorth component and should be called instead of accessing stringItemActNorth field directly.//GEN-BEGIN:MVDGetBegin35
     * @return Instance for stringItemActNorth component
     */
    public StringItem get_stringItemActNorth() {
        if (stringItemActNorth == null) {//GEN-END:MVDGetBegin35
            // Insert pre-init code here
            stringItemActNorth = new StringItem("\nNorth", "0");//GEN-LINE:MVDGetInit35
            // Insert post-init code here
        }//GEN-BEGIN:MVDGetEnd35
        return stringItemActNorth;
    }//GEN-END:MVDGetEnd35

    /** This method returns instance for stringItemActEast component and should be called instead of accessing stringItemActEast field directly.//GEN-BEGIN:MVDGetBegin36
     * @return Instance for stringItemActEast component
     */
    public StringItem get_stringItemActEast() {
        if (stringItemActEast == null) {//GEN-END:MVDGetBegin36
            // Insert pre-init code here
            stringItemActEast = new StringItem("East", "0");//GEN-LINE:MVDGetInit36
            // Insert post-init code here
        }//GEN-BEGIN:MVDGetEnd36
        return stringItemActEast;
    }//GEN-END:MVDGetEnd36

    /** This method returns instance for stringItemActHeight component and should be called instead of accessing stringItemActHeight field directly.//GEN-BEGIN:MVDGetBegin37
     * @return Instance for stringItemActHeight component
     */
    public StringItem get_stringItemActHeight() {
        if (stringItemActHeight == null) {//GEN-END:MVDGetBegin37
            // Insert pre-init code here
            stringItemActHeight = new StringItem("Height", "0");//GEN-LINE:MVDGetInit37
            // Insert post-init code here
        }//GEN-BEGIN:MVDGetEnd37
        return stringItemActHeight;
    }//GEN-END:MVDGetEnd37

    /** This method returns instance for stringItemDestination component and should be called instead of accessing stringItemDestination field directly.//GEN-BEGIN:MVDGetBegin38
     * @return Instance for stringItemDestination component
     */
    public StringItem get_stringItemDestination() {
        if (stringItemDestination == null) {//GEN-END:MVDGetBegin38
            // Insert pre-init code here
            stringItemDestination = new StringItem("\nDestination", "");//GEN-LINE:MVDGetInit38
            // Insert post-init code here
        }//GEN-BEGIN:MVDGetEnd38
        return stringItemDestination;
    }//GEN-END:MVDGetEnd38

    /** This method returns instance for stringItemDestNorth component and should be called instead of accessing stringItemDestNorth field directly.//GEN-BEGIN:MVDGetBegin40
     * @return Instance for stringItemDestNorth component
     */
    public StringItem get_stringItemDestNorth() {
        if (stringItemDestNorth == null) {//GEN-END:MVDGetBegin40
            // Insert pre-init code here
            stringItemDestNorth = new StringItem("North", "0");//GEN-LINE:MVDGetInit40
            // Insert post-init code here
        }//GEN-BEGIN:MVDGetEnd40
        return stringItemDestNorth;
    }//GEN-END:MVDGetEnd40

    /** This method returns instance for stringItemDestEast component and should be called instead of accessing stringItemDestEast field directly.//GEN-BEGIN:MVDGetBegin41
     * @return Instance for stringItemDestEast component
     */
    public StringItem get_stringItemDestEast() {
        if (stringItemDestEast == null) {//GEN-END:MVDGetBegin41
            // Insert pre-init code here
            stringItemDestEast = new StringItem("East", "0");//GEN-LINE:MVDGetInit41
            // Insert post-init code here
        }//GEN-BEGIN:MVDGetEnd41
        return stringItemDestEast;
    }//GEN-END:MVDGetEnd41

    /** This method returns instance for okCommand1 component and should be called instead of accessing okCommand1 field directly.//GEN-BEGIN:MVDGetBegin42
     * @return Instance for okCommand1 component
     */
    public Command get_okCommand1() {
        if (okCommand1 == null) {//GEN-END:MVDGetBegin42
            // Insert pre-init code here
            okCommand1 = new Command("goto", Command.OK, 1);//GEN-LINE:MVDGetInit42
            // Insert post-init code here
        }//GEN-BEGIN:MVDGetEnd42
        return okCommand1;
    }//GEN-END:MVDGetEnd42
    
    public void startApp() {
        initialize();
    }
    
    public void pauseApp() {
    }
    
    public void destroyApp(boolean unconditional) {
    }
    
}