altosui: Move telemetry reader &c to altoslib
[fw/altos] / altosui / AltosUI.java
index 3e5bcf434fc5b8b8276fe2074873e528d8032d74..125653d351e640b6ee20fe4cd523c279a7c17955 100644 (file)
@@ -27,10 +27,11 @@ import java.util.*;
 import java.text.*;
 import java.util.prefs.*;
 import java.util.concurrent.*;
+import org.altusmetrum.AltosLib.*;
 
 import libaltosJNI.*;
 
-public class AltosUI extends JFrame {
+public class AltosUI extends AltosFrame {
        public AltosVoice voice = new AltosVoice();
 
        public static boolean load_library(Frame frame) {
@@ -47,7 +48,7 @@ public class AltosUI extends JFrame {
 
        void telemetry_window(AltosDevice device) {
                try {
-                       AltosFlightReader reader = new AltosTelemetryReader(device);
+                       AltosFlightReader reader = new AltosTelemetryReader(new AltosSerial(device));
                        if (reader != null)
                                new AltosFlightUI(voice, reader, device.getSerial());
                } catch (FileNotFoundException ee) {
@@ -108,7 +109,7 @@ public class AltosUI extends JFrame {
                if (imgURL != null)
                        setIconImage(new ImageIcon(imgURL).getImage());
 
-               AltosPreferences.set_component(this);
+               AltosUIPreferences.set_component(this);
 
                pane = getContentPane();
                gridbag = new GridBagLayout();
@@ -253,9 +254,9 @@ public class AltosUI extends JFrame {
                String  result;
                result = JOptionPane.showInputDialog(AltosUI.this,
                                                     "Configure Callsign",
-                                                    AltosPreferences.callsign());
+                                                    AltosUIPreferences.callsign());
                if (result != null)
-                       AltosPreferences.set_callsign(result);
+                       AltosUIPreferences.set_callsign(result);
        }
 
        void ConfigureTeleMetrum() {
@@ -519,7 +520,7 @@ public class AltosUI extends JFrame {
        
        public static void main(final String[] args) {
                try {
-                       UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+                       UIManager.setLookAndFeel(AltosUIPreferences.look_and_feel());
                } catch (Exception e) {
                }
                /* Handle batch-mode */