Add version numbers to java libraries
[fw/altos] / altosui / AltosUI.java
index 52b6b128c16bf411b7a3521d1aa2749ee6697c79..49e3097e34b99843669fd4f33d360b9f489563b8 100644 (file)
@@ -22,9 +22,10 @@ import java.awt.event.*;
 import javax.swing.*;
 import java.io.*;
 import java.util.concurrent.*;
-import org.altusmetrum.AltosLib.*;
+import org.altusmetrum.altoslib_1.*;
+import org.altusmetrum.altosuilib_1.*;
 
-public class AltosUI extends AltosFrame {
+public class AltosUI extends AltosUIFrame {
        public AltosVoice voice = new AltosVoice();
 
        public static boolean load_library(Frame frame) {
@@ -98,7 +99,6 @@ public class AltosUI extends AltosFrame {
 
                load_library(null);
 
-               AltosUIPreferences.init(new AltosUIPreferencesBackend());
                AltosUIPreferences.set_component(this);
 
                pane = getContentPane();
@@ -224,14 +224,6 @@ public class AltosUI extends AltosFrame {
                doLayout();
                validate();
 
-               setVisible(true);
-
-               Insets i = getInsets();
-               Dimension ps = rootPane.getPreferredSize();
-               ps.width += i.left + i.right;
-               ps.height += i.top + i.bottom;
-               setPreferredSize(ps);
-               setSize(ps);
                setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
                addWindowListener(new WindowAdapter() {
                        @Override
@@ -239,10 +231,15 @@ public class AltosUI extends AltosFrame {
                                System.exit(0);
                        }
                });
+
+               setLocationByPlatform(false);
+               
+               /* Insets aren't set before the window is visible */
+               setVisible(true);
        }
 
        private void ConnectToDevice() {
-               AltosDevice     device = AltosDeviceDialog.show(AltosUI.this,
+               AltosDevice     device = AltosDeviceUIDialog.show(AltosUI.this,
                                                                Altos.product_basestation);
 
                if (device != null)
@@ -445,6 +442,8 @@ public class AltosUI extends AltosFrame {
                //AltosReplayReader reader;
                if (file.getName().endsWith("eeprom")) {
                        recs = new AltosEepromIterable(in);
+               } else if (file.getName().endsWith("mega")) {
+                       recs = new AltosEepromMegaIterable(in);
                } else {
                        recs = new AltosTelemetryIterable(in);
                }
@@ -550,7 +549,6 @@ public class AltosUI extends AltosFrame {
                /* Handle batch-mode */
                if (args.length == 0) {
                        AltosUI altosui = new AltosUI();
-                       altosui.setVisible(true);
 
                        java.util.List<AltosDevice> devices = AltosUSBDevice.list(Altos.product_basestation);
                        for (AltosDevice device : devices)