altosui: Add multi-sized icons to all windows
[fw/altos] / altosui / AltosUI.java
index 7d4b2edbf4708892fd3e46d83665de6525745a1b..9977e82b2483d83d93f4cdd63132c4bf97cb8191 100644 (file)
@@ -27,6 +27,7 @@ import java.util.*;
 import java.text.*;
 import java.util.prefs.*;
 import java.util.concurrent.*;
+import org.altusmetrum.AltosLib.*;
 
 import libaltosJNI.*;
 
@@ -47,7 +48,7 @@ public class AltosUI extends AltosFrame {
 
        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) {
@@ -104,11 +105,7 @@ public class AltosUI extends AltosFrame {
 
                load_library(null);
 
-               java.net.URL imgURL = AltosUI.class.getResource("/altus-metrum-16x16.jpg");
-               if (imgURL != null)
-                       setIconImage(new ImageIcon(imgURL).getImage());
-
-               AltosPreferences.set_component(this);
+               AltosUIPreferences.set_component(this);
 
                pane = getContentPane();
                gridbag = new GridBagLayout();
@@ -262,9 +259,9 @@ public class AltosUI extends AltosFrame {
                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() {
@@ -537,8 +534,9 @@ public class AltosUI extends AltosFrame {
        }
        
        public static void main(final String[] args) {
+               load_library(null);
                try {
-                       UIManager.setLookAndFeel(AltosPreferences.look_and_feel());
+                       UIManager.setLookAndFeel(AltosUIPreferences.look_and_feel());
                } catch (Exception e) {
                }
                /* Handle batch-mode */