import javax.swing.*;
import java.io.*;
import java.util.concurrent.*;
-import org.altusmetrum.AltosLib.*;
import java.text.*;
+import org.altusmetrum.altoslib_4.*;
+import org.altusmetrum.altosuilib_2.*;
public class AltosConfig implements ActionListener {
} finally {
try {
stop_serial();
+ serial_line.close();
} catch (InterruptedException ie) {
}
- serial_line.close();
}
}
/* Pull data out of the UI and stuff back into our local data record */
- data.get_values(config_ui);
-
- run_serial_thread(serial_mode_save);
+ try {
+ data.get_values(config_ui);
+ run_serial_thread(serial_mode_save);
+ } catch (AltosConfigDataException ae) {
+ JOptionPane.showMessageDialog(owner,
+ ae.getMessage(),
+ "Configuration Data Error",
+ JOptionPane.ERROR_MESSAGE);
+ }
}
public void actionPerformed(ActionEvent e) {
public AltosConfig(JFrame given_owner) {
owner = given_owner;
- device = AltosDeviceDialog.show(owner, Altos.product_any);
+ device = AltosDeviceUIDialog.show(owner, Altos.product_any);
if (device != null) {
try {
serial_line = new AltosSerial(device);
}
}
}
-}
\ No newline at end of file
+}