Merge remote-tracking branch 'origin/micropeak-logging'
[fw/altos] / altosui / AltosBTManage.java
index 98a8b757f326d34325d5e7968e138545291b48ee..b7b632a72bc5729438f851cbea98209a253cfc56 100644 (file)
@@ -20,19 +20,12 @@ package altosui;
 import java.awt.*;
 import java.awt.event.*;
 import javax.swing.*;
-import javax.swing.filechooser.FileNameExtensionFilter;
-import javax.swing.table.*;
-import javax.swing.event.*;
 import javax.swing.plaf.basic.*;
-import java.io.*;
 import java.util.*;
-import java.text.*;
-import java.util.prefs.*;
 import java.util.concurrent.*;
+import org.altusmetrum.altosuilib.*;
 
-import libaltosJNI.*;
-
-public class AltosBTManage extends JDialog implements ActionListener, Iterable<AltosBTDevice> {
+public class AltosBTManage extends AltosUIDialog implements ActionListener, Iterable<AltosBTDevice> {
        LinkedBlockingQueue<AltosBTDevice> found_devices;
        Frame frame;
        LinkedList<ActionListener> listeners;
@@ -125,7 +118,6 @@ public class AltosBTManage extends JDialog implements ActionListener, Iterable<A
 
        public void add_known() {
                for (AltosBTDevice device : visible_devices.selected_list()) {
-                       System.out.printf("Add known %s\n", device.toString());
                        known_devices.add(device);
                        visible_devices.remove(device);
                }
@@ -133,7 +125,6 @@ public class AltosBTManage extends JDialog implements ActionListener, Iterable<A
 
        public void remove_known() {
                for (AltosBTDevice device : known_devices.selected_list()) {
-                       System.out.printf("Remove known %s\n", device.toString());
                        known_devices.remove(device);
                        visible_devices.add(device);
                }
@@ -150,7 +141,6 @@ public class AltosBTManage extends JDialog implements ActionListener, Iterable<A
 
        public void actionPerformed(ActionEvent e) {
                String  command = e.getActionCommand();
-               System.out.printf("manage command %s\n", command);
                if ("ok".equals(command)) {
                        bt_thread.interrupt();
                        commit();
@@ -241,6 +231,8 @@ public class AltosBTManage extends JDialog implements ActionListener, Iterable<A
                c.gridy = 0;
                c.gridwidth = 1;
                c.gridheight = 1;
+               c.weightx = 0;
+               c.weighty = 0;
                pane.add(new JLabel("Known Devices"), c);
 
                known_devices = new DeviceList();
@@ -256,6 +248,8 @@ public class AltosBTManage extends JDialog implements ActionListener, Iterable<A
                c.gridy = 1;
                c.gridwidth = 1;
                c.gridheight = 2;
+               c.weightx = 1;
+               c.weighty = 1;
                pane.add(known_list_scroller, c);
 
                /*
@@ -267,6 +261,9 @@ public class AltosBTManage extends JDialog implements ActionListener, Iterable<A
                c.gridy = 0;
                c.gridwidth = 1;
                c.gridheight = 1;
+               c.weightx = 0;
+               c.weighty = 0;
+
                pane.add(new JLabel("Visible Devices"), c);
 
                visible_devices = new DeviceList();
@@ -279,6 +276,8 @@ public class AltosBTManage extends JDialog implements ActionListener, Iterable<A
                c.gridy = 1;
                c.gridheight = 2;
                c.gridwidth = 1;
+               c.weightx = 1;
+               c.weighty = 1;
                pane.add(visible_list_scroller, c);
 
                /*
@@ -293,6 +292,8 @@ public class AltosBTManage extends JDialog implements ActionListener, Iterable<A
                c.gridy = 1;
                c.gridheight = 1;
                c.gridwidth = 1;
+               c.weightx = 0;
+               c.weighty = 0;
                pane.add(select_arrow, c);
 
                BasicArrowButton deselect_arrow = new BasicArrowButton(SwingConstants.EAST);
@@ -304,6 +305,8 @@ public class AltosBTManage extends JDialog implements ActionListener, Iterable<A
                c.gridy = 2;
                c.gridheight = 1;
                c.gridwidth = 1;
+               c.weightx = 0;
+               c.weighty = 0;
                pane.add(deselect_arrow, c);
 
                JButton cancel_button = new JButton("Cancel");
@@ -315,6 +318,8 @@ public class AltosBTManage extends JDialog implements ActionListener, Iterable<A
                c.gridy = 3;
                c.gridheight = 1;
                c.gridwidth = 1;
+               c.weightx = 0;
+               c.weighty = 0;
                pane.add(cancel_button, c);
 
                JButton ok_button = new JButton("OK");
@@ -326,6 +331,8 @@ public class AltosBTManage extends JDialog implements ActionListener, Iterable<A
                c.gridy = 3;
                c.gridheight = 1;
                c.gridwidth = 1;
+               c.weightx = 0;
+               c.weighty = 0;
                pane.add(ok_button, c);
 
                getRootPane().setDefaultButton(ok_button);