- Timestamp:
- 05/02/08 15:04:09 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
bbtracker/trunk/src/org/bbtracker/mobile/gui/MainCanvas.java
r194 r197 65 65 private final Command stopTrackingCommand; 66 66 67 private final Command pauseTrackingCommand; 68 69 private final Command continueTrackingCommand; 70 67 71 private final Command tracksCommand; 68 72 … … 101 105 newTrackCommand = new Command("Start Track", Command.SCREEN, 2); 102 106 stopTrackingCommand = new Command("Stop Track", Command.STOP, 3); 103 tracksCommand = new Command("Tracks", Command.SCREEN, 4); 104 optionsCommand = new Command("Options", Command.SCREEN, 5); 105 aboutCommand = new Command("About", Command.SCREEN, 6); 107 pauseTrackingCommand = new Command("Pause Track", Command.SCREEN, 4); 108 continueTrackingCommand = new Command("Continue Track", Command.SCREEN, 4); 109 tracksCommand = new Command("Tracks", Command.SCREEN, 5); 110 optionsCommand = new Command("Options", Command.SCREEN, 6); 111 aboutCommand = new Command("About", Command.SCREEN, 7); 106 112 // #ifndef AVOID_FILE_API 107 113 exportCommand = new Command("Export Track", Command.SCREEN, 1); … … 149 155 protected void setStatusMessage(final String statusMessage, final int duration) { 150 156 this.statusMessage = statusMessage; 151 statusMessageEndTime = System.currentTimeMillis() + duration; 152 BBTracker.getTimer().schedule(new RepaintTask(), duration + 10); 157 if (duration != -1) { 158 statusMessageEndTime = System.currentTimeMillis() + duration; 159 BBTracker.getTimer().schedule(new RepaintTask(), duration + 10); 160 } else { 161 statusMessageEndTime = Long.MAX_VALUE; 162 } 153 163 repaint(); 154 164 } … … 211 221 setStatusMessage("Static Track"); 212 222 removeCommand(stopTrackingCommand); 223 removeCommand(pauseTrackingCommand); 224 removeCommand(continueTrackingCommand); 213 225 removeCommand(markPointCommand); 214 226 // #ifndef AVOID_FILE_API … … 219 231 setStatusMessage("Tracking"); 220 232 addCommand(stopTrackingCommand); 233 addCommand(pauseTrackingCommand); 221 234 addCommand(markPointCommand); 222 235 // #ifndef AVOID_FILE_API … … 226 239 default: 227 240 removeCommand(stopTrackingCommand); 241 removeCommand(pauseTrackingCommand); 242 removeCommand(continueTrackingCommand); 243 removeCommand(markPointCommand); 228 244 // #ifndef AVOID_FILE_API 229 245 removeCommand(exportCommand); … … 276 292 } else if (command == markPointCommand) { 277 293 markPointAction(); 294 } else if (command == pauseTrackingCommand) { 295 pauseTrackingAction(); 296 } else if (command == continueTrackingCommand) { 297 continueTrackingAction(); 278 298 } else if (command == switchViewCommand) { 279 299 nextTileConfiguration(); … … 421 441 } 422 442 443 private void pauseTrackingAction() { 444 removeCommand(pauseTrackingCommand); 445 addCommand(continueTrackingCommand); 446 manager.pauseTracking(); 447 setStatusMessage("Paused!", -1); 448 } 449 450 private void continueTrackingAction() { 451 removeCommand(continueTrackingCommand); 452 addCommand(pauseTrackingCommand); 453 manager.continueTracking(); 454 setStatusMessage("Continuing..."); 455 } 456 423 457 protected void keyReleased(final int keyCode) { 424 458 final int gameAction = getGameAction(keyCode);
Note: See TracChangeset
for help on using the changeset viewer.