import java.text.*;
import java.util.prefs.*;
import java.util.concurrent.*;
+import org.altusmetrum.AltosLib.*;
public class AltosIgniteUI
- extends JDialog
+ extends AltosDialog
implements ActionListener
{
AltosDevice device;
JToggleButton arm;
JButton fire;
javax.swing.Timer timer;
+ JButton close;
int apogee_status;
int main_status;
void ignite_exception(Exception e) {
if (e instanceof FileNotFoundException) {
JOptionPane.showMessageDialog(owner,
- String.format("Cannot open device \"%s\"",
- device.toShortString()),
+ ((FileNotFoundException) e).getMessage(),
"Cannot open target device",
JOptionPane.ERROR_MESSAGE);
} else if (e instanceof AltosSerialInUseException) {
c.fill = GridBagConstraints.NONE;
c.anchor = GridBagConstraints.CENTER;
c.insets = i;
- c.weightx = 1;
- c.weighty = 1;
+ c.weightx = 0;
+ c.weighty = 0;
c.gridx = 0;
c.gridy = 0;
fire.addActionListener(this);
fire.setActionCommand("fire");
+ c.gridx = 0;
+ c.gridy = 4;
+ c.gridwidth = 2;
+ c.anchor = GridBagConstraints.CENTER;
+ close = new JButton ("Close");
+ pane.add(close, c);
+ close.addActionListener(this);
+ close.setActionCommand("close");
+
pack();
setLocationRelativeTo(owner);