import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
-import javax.swing.filechooser.FileNameExtensionFilter;
-import javax.swing.table.*;
import java.io.*;
-import java.util.*;
-import java.text.*;
-import java.util.prefs.*;
import java.util.concurrent.*;
-import org.altusmetrum.AltosLib.*;
+import org.altusmetrum.altoslib.*;
+import org.altusmetrum.altosuilib.*;
-import libaltosJNI.*;
-
-public class AltosUI extends AltosFrame {
+public class AltosUI extends AltosUIFrame {
public AltosVoice voice = new AltosVoice();
public static boolean load_library(Frame frame) {
c.weighty = 1;
b = new JButton(label);
- Dimension ps = b.getPreferredSize();
+ //Dimension ps = b.getPreferredSize();
gridbag.setConstraints(b, c);
add(b, c);
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
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)
return null;
}
AltosRecordIterable recs;
- AltosReplayReader reader;
+ //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);
}
/* 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)