import java.text.*;
import java.util.prefs.*;
import java.util.concurrent.*;
+import org.altusmetrum.AltosLib.*;
class FireButton extends JButton {
protected void processMouseEvent(MouseEvent e) {
}
public class AltosLaunchUI
- extends JDialog
+ extends AltosDialog
implements ActionListener
{
AltosDevice device;
void launch_exception(Exception e) {
if (e instanceof FileNotFoundException) {
JOptionPane.showMessageDialog(owner,
- String.format("Cannot open device \"%s\"",
- device.toShortString()),
+ ((FileNotFoundException) e).getMessage(),
"Cannot open target device",
JOptionPane.ERROR_MESSAGE);
} else if (e instanceof AltosSerialInUseException) {
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));
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));
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;