summaryrefslogtreecommitdiff
path: root/altosui/AltosConfigPyroUI.java
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2013-12-21 06:46:46 -0800
committerKeith Packard <keithp@keithp.com>2013-12-21 06:46:46 -0800
commit9cf9a67f937185c0c0bb5b2bae4f420755965799 (patch)
tree504f696ae3c482b93dc748fb130517c0f517382a /altosui/AltosConfigPyroUI.java
parent9289200ccb661b10ff892760ecbc752c7745de6b (diff)
altosui: Switch from radio buttons to check boxes in pyro config. Add close
First of (we hope) many review comments from Troj. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altosui/AltosConfigPyroUI.java')
-rw-r--r--altosui/AltosConfigPyroUI.java25
1 files changed, 22 insertions, 3 deletions
diff --git a/altosui/AltosConfigPyroUI.java b/altosui/AltosConfigPyroUI.java
index f59a0f0d..47b2b662 100644
--- a/altosui/AltosConfigPyroUI.java
+++ b/altosui/AltosConfigPyroUI.java
@@ -26,7 +26,7 @@ import org.altusmetrum.altosuilib_1.*;
public class AltosConfigPyroUI
extends AltosUIDialog
- implements ItemListener, DocumentListener, AltosUnitsListener
+ implements ItemListener, DocumentListener, AltosUnitsListener, ActionListener
{
AltosConfigUI owner;
Container pane;
@@ -48,7 +48,7 @@ public class AltosConfigPyroUI
class PyroItem implements ItemListener, DocumentListener, AltosUnitsListener
{
public int flag;
- public JRadioButton enable;
+ public JCheckBox enable;
public JTextField value;
public JComboBox combo;
AltosConfigPyroUI ui;
@@ -146,7 +146,7 @@ public class AltosConfigPyroUI
c.fill = GridBagConstraints.NONE;
c.anchor = GridBagConstraints.LINE_START;
c.insets = il;
- enable = new JRadioButton();
+ enable = new JCheckBox();
enable.addItemListener(this);
pane.add(enable, c);
@@ -309,6 +309,14 @@ public class AltosConfigPyroUI
}
}
+ /* Listen for events from our buttons */
+ public void actionPerformed(ActionEvent e) {
+ String cmd = e.getActionCommand();
+
+ if (cmd.equals("Close"))
+ setVisible(false);
+ }
+
public AltosConfigPyroUI(AltosConfigUI in_owner, AltosPyro[] pyros) {
super(in_owner, "Configure Pyro Channels", false);
@@ -353,6 +361,17 @@ public class AltosConfigPyroUI
columns[i] = new PyroColumn(this, i*2 + 1, 0, i);
columns[i].set(pyros[i]);
}
+
+ c = new GridBagConstraints();
+ c.gridx = pyros.length*2-1;
+ c.fill = GridBagConstraints.HORIZONTAL;
+ c.gridwidth = 2;
+ c.gridy = 1000;
+ JButton close = new JButton("Close");
+ pane.add(close, c);
+ close.addActionListener(this);
+ close.setActionCommand("Close");
+
addWindowListener(new ConfigListener(this, owner));
AltosPreferences.register_units_listener(this);
}