diff options
author | Bdale Garbee <bdale@gag.com> | 2014-06-24 21:17:53 -0600 |
---|---|---|
committer | Bdale Garbee <bdale@gag.com> | 2014-06-24 21:17:53 -0600 |
commit | bd440afc2a6e37b74fffcf1b977e149485095316 (patch) | |
tree | 3e42f1102d68d49dae3061b9592e23907e245f23 /altosui/AltosIdleMonitorUI.java | |
parent | 5d4f912bcc6784f975c82f7b0ed8dc360e60aae8 (diff) | |
parent | a0ccab8e4235934538a03f8be3b37aa1bbd6b144 (diff) |
Merge branch 'master' of ssh://git.gag.com/scm/git/fw/altos
Diffstat (limited to 'altosui/AltosIdleMonitorUI.java')
-rw-r--r-- | altosui/AltosIdleMonitorUI.java | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/altosui/AltosIdleMonitorUI.java b/altosui/AltosIdleMonitorUI.java index 042111ec..63d86291 100644 --- a/altosui/AltosIdleMonitorUI.java +++ b/altosui/AltosIdleMonitorUI.java @@ -24,8 +24,8 @@ import javax.swing.event.*; import java.io.*; import java.util.concurrent.*; import java.util.Arrays; -import org.altusmetrum.altoslib_4.*; -import org.altusmetrum.altosuilib_2.*; +import org.altusmetrum.altoslib_5.*; +import org.altusmetrum.altosuilib_3.*; public class AltosIdleMonitorUI extends AltosUIFrame implements AltosFlightDisplay, AltosIdleMonitorListener, DocumentListener { AltosDevice device; @@ -33,9 +33,11 @@ public class AltosIdleMonitorUI extends AltosUIFrame implements AltosFlightDispl AltosPad pad; AltosInfoTable flightInfo; AltosFlightStatus flightStatus; + AltosIgnitor ignitor; AltosIdleMonitor thread; int serial; boolean remote; + boolean has_ignitor; void stop_display() { if (thread != null) { @@ -70,10 +72,22 @@ public class AltosIdleMonitorUI extends AltosUIFrame implements AltosFlightDispl public void show(AltosState state, AltosListenerState listener_state) { status_update.saved_state = state; + if (ignitor.should_show(state)) { + if (!has_ignitor) { + pane.add("Ignitor", ignitor); + has_ignitor = true; + } + } else { + if (has_ignitor) { + pane.remove(ignitor); + has_ignitor = false; + } + } // try { pad.show(state, listener_state); flightStatus.show(state, listener_state); flightInfo.show(state, listener_state); + ignitor.show(state, listener_state); // } catch (Exception e) { // System.out.print("Show exception " + e); // } @@ -222,6 +236,8 @@ public class AltosIdleMonitorUI extends AltosUIFrame implements AltosFlightDispl flightInfo = new AltosInfoTable(); pane.add("Table", new JScrollPane(flightInfo)); + ignitor = new AltosIgnitor(); + /* Make the tabbed pane use the rest of the window space */ bag.add(pane, constraints(0, 3, GridBagConstraints.BOTH)); |