Blackberry JAVA DEVELOPMENT ENVIRONMENT - - CRYPTOGRAPHIC SMART CARD DRIVER - DEVELOPMENT GUIDE Průvodce řešením problémů Strana 210

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 286
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 209
210
BlackBerry Java Development Environment Development Guide
}
/* Marks a point in the persistent store. Calculations are based on
* all data collected since the previous waypoint, or from the start
* of the application if no previous waypoints exist.
*/
private void markPoint() {
long current = System.currentTimeMillis();
WayPoint p= new WayPoint(_startTime, current, _wayHorizontalDistance,
_verticalDistance);
addWayPoint(p);
// Reset the waypoint variables.
_startTime = current;
_wayHorizontalDistance = 0;
_verticalDistance = 0;
}
/**
* View the various options for this application
*/
public void viewOptions()
{
OptionScreen optionScreen = new OptionScreen();
pushScreen(optionScreen);
}
// View the saved waypoints.
private void viewPreviousPoints() {
PointScreen pointScreen = new PointScreen(_previousPoints, _resources);
pushScreen(pointScreen);
}
/* Adds a new waypoint and commits the set of saved waypoints
* to flash memory.
* @param p The point to add.
*/
/*package*/ synchronized static void addWayPoint(WayPoint p) {
_previousPoints.addElement(p);
commit();
}
/* Removes a waypoint from the set of saved points and commits the modifed set to flash
memory.
* @param p the point to remove
*/
/*package*/ synchronized static void removeWayPoint(WayPoint p) {
_previousPoints.removeElement(p);
commit();
}
// Commit the waypoint set to flash memory.
private static void commit() {
_store.setContents(_previousPoints);
_store.commit();
}
/**
Zobrazit stránku 209
1 2 ... 205 206 207 208 209 210 211 212 213 214 215 ... 285 286

Komentáře k této Příručce

Žádné komentáře