summaryrefslogtreecommitdiff
path: root/ao-tools/altosui/AltosChannelMenu.java
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2010-11-20 00:13:58 -0800
committerKeith Packard <keithp@keithp.com>2010-11-20 00:13:58 -0800
commit9a99cabc1c34c657fc95246192ba6d330f5f22d3 (patch)
tree18823288d3b3c3444d3efbdd46c238ffe9a316d2 /ao-tools/altosui/AltosChannelMenu.java
parent71c41eadd12c3ece5fffce7669e4991778046d4e (diff)
altosui: Fix channel changing in flight UI to actually work
Replacing the menu with a combo box required reworking the way events are delivered from that widget back to the channel changing function. Just delete the old magic and use the JComboBox action listener directly. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'ao-tools/altosui/AltosChannelMenu.java')
-rw-r--r--ao-tools/altosui/AltosChannelMenu.java20
1 files changed, 0 insertions, 20 deletions
diff --git a/ao-tools/altosui/AltosChannelMenu.java b/ao-tools/altosui/AltosChannelMenu.java
index 8069c853..abbb86f4 100644
--- a/ao-tools/altosui/AltosChannelMenu.java
+++ b/ao-tools/altosui/AltosChannelMenu.java
@@ -30,31 +30,11 @@ import java.util.concurrent.LinkedBlockingQueue;
public class AltosChannelMenu extends JComboBox implements ActionListener {
int channel;
- LinkedList<ActionListener> listeners;
-
- public void addActionListener(ActionListener l) {
- listeners.add(l);
- }
-
- public void actionPerformed(ActionEvent e) {
- channel = getSelectedIndex();
-
- ActionEvent newe = new ActionEvent(this, channel, e.getActionCommand());
-
- ListIterator<ActionListener> i = listeners.listIterator();
-
- while (i.hasNext()) {
- ActionListener listener = i.next();
- listener.actionPerformed(newe);
- }
- setMaximumSize(getPreferredSize());
- }
public AltosChannelMenu(int current_channel) {
channel = current_channel;
- listeners = new LinkedList<ActionListener>();
for (int c = 0; c <= 9; c++)
addItem(String.format("Channel %1d (%7.3fMHz)", c, 434.550 + c * 0.1));
setSelectedIndex(channel);