diff options
author | Keith Packard <keithp@keithp.com> | 2012-12-07 17:27:48 -0800 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2012-12-07 17:27:48 -0800 |
commit | 1489c7f75f7b9ce547ac49c157b440c4f9131ef4 (patch) | |
tree | 60eb9b3d9d25c4e6cb0920385a3c3eee3396b815 /altosui/AltosConfigUI.java | |
parent | c10f9a438ed5789479d21c78153ca7f14c05534c (diff) |
altosui: Call config UI from AltosConfigData directly
Don't make AltosConfig have a pile of config code, stick that in
AltosConfigData instead. This uses a new interface, AltosConfigValues
to get from AltosConfigData to the UI.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altosui/AltosConfigUI.java')
-rw-r--r-- | altosui/AltosConfigUI.java | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/altosui/AltosConfigUI.java b/altosui/AltosConfigUI.java index feac053b..2c3435c1 100644 --- a/altosui/AltosConfigUI.java +++ b/altosui/AltosConfigUI.java @@ -25,7 +25,7 @@ import org.altusmetrum.AltosLib.*; public class AltosConfigUI extends AltosDialog - implements ActionListener, ItemListener, DocumentListener + implements ActionListener, ItemListener, DocumentListener, AltosConfigValues { Container pane; @@ -684,6 +684,7 @@ public class AltosConfigUI public void set_apogee_delay(int new_apogee_delay) { apogee_delay_value.setSelectedItem(Integer.toString(new_apogee_delay)); + apogee_delay_value.setEnabled(new_apogee_delay >= 0); } public int apogee_delay() { @@ -692,6 +693,7 @@ public class AltosConfigUI public void set_apogee_lockout(int new_apogee_lockout) { apogee_lockout_value.setSelectedItem(Integer.toString(new_apogee_lockout)); + apogee_lockout_value.setEnabled(new_apogee_lockout >= 0); } public int apogee_lockout() { @@ -829,13 +831,10 @@ public class AltosConfigUI return -1; } - public void set_has_pyro(boolean has_pyro) { - pyro.setEnabled(has_pyro); - } - public void set_pyros(AltosPyro[] new_pyros) { pyros = new_pyros; - if (pyro_ui != null) + pyro.setEnabled(pyros != null); + if (pyros != null && pyro_ui != null) pyro_ui.set_pyros(pyros); } |