X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=altosui%2FAltosUI.java;h=0efe27a0b92985eb662948784860979936f6c272;hb=3454592169dcb61b81de9af2b631b87e7dd86231;hp=b5cbefe73a352ae78362c3d1c4679b5eef21a8c9;hpb=19243ecc9b5bbdcc069ae24acf1ca807322c84d8;p=fw%2Faltos diff --git a/altosui/AltosUI.java b/altosui/AltosUI.java index b5cbefe7..0efe27a0 100644 --- a/altosui/AltosUI.java +++ b/altosui/AltosUI.java @@ -23,8 +23,9 @@ import javax.swing.*; import java.io.*; import java.util.concurrent.*; import org.altusmetrum.AltosLib.*; +import org.altusmetrum.altosuilib.*; -public class AltosUI extends AltosFrame { +public class AltosUI extends AltosUIFrame { public AltosVoice voice = new AltosVoice(); public static boolean load_library(Frame frame) { @@ -223,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 @@ -238,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) @@ -444,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); } @@ -549,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 devices = AltosUSBDevice.list(Altos.product_basestation); for (AltosDevice device : devices)