telegps: Auto-connect to any base stations plugged in at startup
[fw/altos] / altosui / AltosRomconfigUI.java
index e1dc974e67ac4e520b0a0cf89594bf4ac926a243..d2fe54d94d9a7f395c189bbc67993835060770e7 100644 (file)
@@ -20,16 +20,11 @@ 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 java.io.*;
-import java.util.*;
-import java.text.*;
-import java.util.prefs.*;
+import org.altusmetrum.altoslib_4.*;
+import org.altusmetrum.altosuilib_2.*;
 
 public class AltosRomconfigUI
-       extends JDialog
+       extends AltosUIDialog
        implements ActionListener
 {
        Container       pane;
@@ -74,7 +69,7 @@ public class AltosRomconfigUI
                c.weightx = 1;
                c.anchor = GridBagConstraints.LINE_START;
                c.insets = ir;
-               serial_value = new JTextField("0");
+               serial_value = new JTextField("00000000");
                pane.add(serial_value, c);
 
                /* Radio calibration value */
@@ -96,7 +91,7 @@ public class AltosRomconfigUI
                c.anchor = GridBagConstraints.LINE_START;
                c.insets = ir;
                c.ipady = 5;
-               radio_calibration_value = new JTextField("1186611");
+               radio_calibration_value = new JTextField("00000000");
                pane.add(radio_calibration_value, c);
 
                /* Buttons */
@@ -126,6 +121,11 @@ public class AltosRomconfigUI
                setLocationRelativeTo(owner);
        }
 
+       public AltosRomconfigUI(JFrame frame, AltosRomconfig config) {
+               this(frame);
+               set(config);
+       }
+
        boolean selected;
 
        /* Listen for events from our buttons */
@@ -183,4 +183,9 @@ public class AltosRomconfigUI
                        return romconfig();
                return null;
        }
+
+       public static AltosRomconfig show(JFrame frame, AltosRomconfig config) {
+               AltosRomconfigUI ui = new AltosRomconfigUI(frame, config);
+               return ui.showDialog();
+       }
 }