X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=altosui%2FAltosLaunchUI.java;h=8a24ed3e1f2a54beefac6eef78077cf3b5e1e541;hp=47365e03bd46a19bc933553d55beac501e3effd9;hb=54838e3d523953e3ce4cea2319b2820c21d2c576;hpb=31e3255b6cbfaf95c0e97e2d1ec8de72f845994c diff --git a/altosui/AltosLaunchUI.java b/altosui/AltosLaunchUI.java index 47365e03..8a24ed3e 100644 --- a/altosui/AltosLaunchUI.java +++ b/altosui/AltosLaunchUI.java @@ -3,7 +3,8 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of @@ -20,14 +21,10 @@ package altosui; import java.awt.*; import java.awt.event.*; import javax.swing.*; -import javax.swing.filechooser.FileNameExtensionFilter; -import javax.swing.table.*; -import javax.swing.event.*; import java.io.*; -import java.util.*; import java.text.*; -import java.util.prefs.*; import java.util.concurrent.*; +import org.altusmetrum.altosuilib_12.*; class FireButton extends JButton { protected void processMouseEvent(MouseEvent e) { @@ -50,7 +47,7 @@ class FireButton extends JButton { } public class AltosLaunchUI - extends JDialog + extends AltosUIDialog implements ActionListener { AltosDevice device; @@ -316,7 +313,7 @@ public class AltosLaunchUI void set_serial() { try { launcher_serial = Integer.parseInt(launcher_serial_text.getText()); - AltosPreferences.set_launcher_serial(launcher_serial); + AltosUIPreferences.set_launcher_serial(launcher_serial); send_command("set_remote"); } catch (NumberFormatException ne) { launcher_serial_text.setText(String.format("%d", launcher_serial)); @@ -326,7 +323,7 @@ public class AltosLaunchUI void set_channel() { try { launcher_channel = Integer.parseInt(launcher_channel_text.getText()); - AltosPreferences.set_launcher_serial(launcher_channel); + AltosUIPreferences.set_launcher_serial(launcher_channel); send_command("set_remote"); } catch (NumberFormatException ne) { launcher_channel_text.setText(String.format("%d", launcher_channel)); @@ -335,7 +332,6 @@ public class AltosLaunchUI public void actionPerformed(ActionEvent e) { String cmd = e.getActionCommand(); - System.out.printf("cmd %s\n", cmd); if (cmd.equals("armed") || cmd.equals("igniter")) { stop_arm_timer(); } @@ -376,7 +372,7 @@ public class AltosLaunchUI private boolean open() { command_queue = new LinkedBlockingQueue(); - device = AltosDeviceDialog.show(owner, Altos.product_any); + device = AltosDeviceUIDialog.show(owner, Altos.product_any); if (device != null) { LaunchHandler handler = new LaunchHandler(owner); Thread t = new Thread(handler); @@ -388,8 +384,8 @@ public class AltosLaunchUI public AltosLaunchUI(JFrame in_owner) { - launcher_channel = AltosPreferences.launcher_channel(); - launcher_serial = AltosPreferences.launcher_serial(); + launcher_channel = AltosUIPreferences.launcher_channel(); + launcher_serial = AltosUIPreferences.launcher_serial(); owner = in_owner; armed_status = AltosLaunch.Unknown; igniter_status = AltosLaunch.Unknown;