altoslib: Hide 'state' member and use accessor function
[fw/altos] / altosui / AltosUI.java
index a1bc0dbbec2fc035c8af7c60700f8aa505f7a043..c29f0db36147f8b786c88fe805ea94624031617c 100644 (file)
@@ -22,8 +22,8 @@ import java.awt.event.*;
 import javax.swing.*;
 import java.io.*;
 import java.util.concurrent.*;
-import org.altusmetrum.altoslib_5.*;
-import org.altusmetrum.altosuilib_3.*;
+import org.altusmetrum.altoslib_8.*;
+import org.altusmetrum.altosuilib_8.*;
 
 public class AltosUI extends AltosUIFrame {
        public AltosVoice voice = new AltosVoice();
@@ -295,7 +295,7 @@ public class AltosUI extends AltosUIFrame {
        }
 
        void LoadMaps() {
-               new AltosUIMapPreload(AltosUI.this);
+               new AltosUIMapPreloadNew(AltosUI.this);
        }
 
        void LaunchController() {
@@ -463,7 +463,7 @@ public class AltosUI extends AltosUIFrame {
                AltosStateIterable states = record_iterable(file);
                if (states == null)
                        return null;
-               return new AltosReplayReader(states.iterator(), file, true);
+               return new AltosReplayReader(states.iterator(), file);
        }
 
        static boolean process_replay(File file) {
@@ -539,7 +539,7 @@ public class AltosUI extends AltosUIFrame {
                        System.out.printf ("process cat\n");
                        for (AltosState state : eef) {
                                System.out.printf ("tick %d state %d height %g\n",
-                                                  state.tick, state.state, state.height());
+                                                  state.tick, state.state(), state.height());
                                if ((state.set & AltosState.set_gps) != 0)
                                        System.out.printf ("time %g lat %g lon %g alt %g\n",
                                                           state.time_since_boost(),
@@ -587,16 +587,7 @@ public class AltosUI extends AltosUIFrame {
                        for (int i = 0; i < args.length; i++) {
                                if (args[i].equals("--help"))
                                        help(0);
-                               else if (args[i].equals("--fetchmaps")) {
-                                       if (args.length < i + 3) {
-                                               help(1);
-                                       } else {
-                                               double lat = Double.parseDouble(args[i+1]);
-                                               double lon = Double.parseDouble(args[i+2]);
-//                                             AltosSiteMap.prefetchMaps(lat, lon);
-                                               i += 2;
-                                       }
-                               } else if (args[i].equals("--replay"))
+                               else if (args[i].equals("--replay"))
                                        process = process_replay;
                                else if (args[i].equals("--kml"))
                                        process = process_kml;