X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=altosui%2FAltosUI.java;h=9977e82b2483d83d93f4cdd63132c4bf97cb8191;hp=75a12ecef1b6d0f174e37281098ae49d76e7ebd6;hb=1b5340c2b75c500011355c4889da443c4b9c4891;hpb=cf1e95810559584705d0b8a787375938c68e07c6 diff --git a/altosui/AltosUI.java b/altosui/AltosUI.java index 75a12ece..9977e82b 100644 --- a/altosui/AltosUI.java +++ b/altosui/AltosUI.java @@ -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(); @@ -210,12 +207,12 @@ public class AltosUI extends AltosFrame { }); b.setToolTipText("Check flight readiness of altimeter in idle mode"); - b = addButton(3, 2, "Launch Controller"); - b.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - LaunchController(); - } - }); +// b = addButton(3, 2, "Launch Controller"); +// b.addActionListener(new ActionListener() { +// public void actionPerformed(ActionEvent e) { +// LaunchController(); +// } +// }); b = addButton(4, 2, "Quit"); b.addActionListener(new ActionListener() { @@ -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() { @@ -365,6 +362,8 @@ public class AltosUI extends AltosFrame { in = new FileInputStream(file); if (filename.endsWith("eeprom")) return new AltosEepromIterable(in); + else if (filename.endsWith("mega")) + return new AltosEepromMegaIterable(in); else return new AltosTelemetryIterable(in); } catch (FileNotFoundException fe) { @@ -535,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 */