projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'buttonbox' of git://git.gag.com/fw/altos into buttonbox
[fw/altos]
/
ao-tools
/
altosui
/
AltosFlightUI.java
diff --git
a/ao-tools/altosui/AltosFlightUI.java
b/ao-tools/altosui/AltosFlightUI.java
index f56b3d1bd4cf200a79e6e8736fc1234ceaf486c9..1372cc00d8da9368ded43ae3bb15c771d0862b71 100644
(file)
--- a/
ao-tools/altosui/AltosFlightUI.java
+++ b/
ao-tools/altosui/AltosFlightUI.java
@@
-46,7
+46,8
@@
public class AltosFlightUI extends JFrame implements AltosFlightDisplay {
AltosLanded landed;
AltosSiteMap sitemap;
AltosLanded landed;
AltosSiteMap sitemap;
- private AltosStatusTable flightStatus;
+ private AltosFlightStatus flightStatus;
+ private JScrollPane flightInfoPane;
private AltosInfoTable flightInfo;
static final int tab_pad = 1;
private AltosInfoTable flightInfo;
static final int tab_pad = 1;
@@
-56,6
+57,8
@@
public class AltosFlightUI extends JFrame implements AltosFlightDisplay {
int cur_tab = 0;
int cur_tab = 0;
+ boolean exit_on_close = false;
+
int which_tab(AltosState state) {
if (state.state < Altos.ao_flight_boost)
return tab_pad;
int which_tab(AltosState state) {
if (state.state < Altos.ao_flight_boost)
return tab_pad;
@@
-119,13
+122,17
@@
public class AltosFlightUI extends JFrame implements AltosFlightDisplay {
}
cur_tab = tab;
}
}
cur_tab = tab;
}
- flightStatus.s
et(state
);
+ flightStatus.s
how(state, crc_errors
);
flightInfo.show(state, crc_errors);
sitemap.show(state, crc_errors);
}
flightInfo.show(state, crc_errors);
sitemap.show(state, crc_errors);
}
+ public void set_exit_on_close() {
+ exit_on_close = true;
+ }
+
public AltosFlightUI(AltosVoice in_voice, AltosFlightReader in_reader, final int serial) {
public AltosFlightUI(AltosVoice in_voice, AltosFlightReader in_reader, final int serial) {
- AltosPreferences.init(this);
+
AltosPreferences.init(this);
voice = in_voice;
reader = in_reader;
voice = in_voice;
reader = in_reader;
@@
-136,7
+143,7
@@
public class AltosFlightUI extends JFrame implements AltosFlightDisplay {
setTitle(String.format("AltOS %s", reader.name));
setTitle(String.format("AltOS %s", reader.name));
- flightStatus = new Altos
StatusTable
();
+ flightStatus = new Altos
FlightStatus
();
vbox = new Box (BoxLayout.Y_AXIS);
vbox.add(flightStatus);
vbox = new Box (BoxLayout.Y_AXIS);
vbox.add(flightStatus);
@@
-156,7
+163,8
@@
public class AltosFlightUI extends JFrame implements AltosFlightDisplay {
pane.add("Landed", landed);
flightInfo = new AltosInfoTable();
pane.add("Landed", landed);
flightInfo = new AltosInfoTable();
- pane.add("Table", new JScrollPane(flightInfo.box()));
+ flightInfoPane = new JScrollPane(flightInfo.box());
+ pane.add("Table", flightInfoPane);
sitemap = new AltosSiteMap();
pane.add("Site Map", sitemap);
sitemap = new AltosSiteMap();
pane.add("Site Map", sitemap);
@@
-185,7
+193,7
@@
public class AltosFlightUI extends JFrame implements AltosFlightDisplay {
this.setJMenuBar(menubar);
}
this.setJMenuBar(menubar);
}
- this.setSize(
new Dimension (width(), height()
));
+ this.setSize(
this.getPreferredSize(
));
this.validate();
setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
this.validate();
setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
@@
-195,6
+203,8
@@
public class AltosFlightUI extends JFrame implements AltosFlightDisplay {
disconnect();
setVisible(false);
dispose();
disconnect();
setVisible(false);
dispose();
+ if (exit_on_close)
+ System.exit(0);
}
});
}
});