diff options
author | Keith Packard <keithp@keithp.com> | 2010-11-25 16:09:37 -0800 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2010-11-25 16:30:19 -0800 |
commit | 6d3612e267cd4c1e7fdd74fc33952b3f26f870f5 (patch) | |
tree | ba9f10ec8478274518b0e169e49bed02b6f8764d | |
parent | 12fb7f0e70cd244475d84469f93283112478d1e1 (diff) |
altosui: Eliminate unnecessary thread from config UI
There's no reason to use a thread to run a dialog box, and
swing doesn't like threads anyways.
Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r-- | altosui/AltosConfig.java | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/altosui/AltosConfig.java b/altosui/AltosConfig.java index 1c42870f..38e1484e 100644 --- a/altosui/AltosConfig.java +++ b/altosui/AltosConfig.java @@ -30,7 +30,7 @@ import java.util.concurrent.*; import libaltosJNI.*; -public class AltosConfig implements Runnable, ActionListener { +public class AltosConfig implements ActionListener { class int_ref { int value; @@ -64,7 +64,6 @@ public class AltosConfig implements Runnable, ActionListener { AltosDevice device; AltosSerial serial_line; boolean remote; - Thread config_thread; int_ref serial; int_ref main_deploy; int_ref apogee_delay; @@ -241,17 +240,6 @@ public class AltosConfig implements Runnable, ActionListener { } } - public void run () { - try { - init_ui(); - config_ui.make_visible(); - } catch (InterruptedException ie) { - abort(); - } catch (TimeoutException te) { - abort(); - } - } - public AltosConfig(JFrame given_owner) { owner = given_owner; @@ -270,8 +258,14 @@ public class AltosConfig implements Runnable, ActionListener { serial_line = new AltosSerial(device); if (!device.matchProduct(AltosDevice.product_telemetrum)) remote = true; - config_thread = new Thread(this); - config_thread.start(); + try { + init_ui(); + config_ui.make_visible(); + } catch (InterruptedException ie) { + abort(); + } catch (TimeoutException te) { + abort(); + } } catch (FileNotFoundException ee) { JOptionPane.showMessageDialog(owner, String.format("Cannot open device \"%s\"", |