diff options
| author | Anthony Towns <aj@erisian.com.au> | 2010-11-18 05:54:06 +1000 |
|---|---|---|
| committer | Anthony Towns <aj@erisian.com.au> | 2010-11-18 05:54:06 +1000 |
| commit | 939be6793238a275b7682ecc376fed14379cf044 (patch) | |
| tree | f05feaf2572cccd5eb1e8565b70fc6948f607194 /ao-tools/altosui/AltosFlightUI.java | |
| parent | e68fe9454352087889c560d95797922493117acb (diff) | |
| parent | 1a4b6e96f823035b113f01d1bdfd61afc1f33e25 (diff) | |
Merge branch 'buttonbox' of git://git.gag.com/fw/altos into buttonbox
Conflicts:
ao-tools/altosui/AltosFlightUI.java
Diffstat (limited to 'ao-tools/altosui/AltosFlightUI.java')
| -rw-r--r-- | ao-tools/altosui/AltosFlightUI.java | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/ao-tools/altosui/AltosFlightUI.java b/ao-tools/altosui/AltosFlightUI.java index f56b3d1b..1372cc00 100644 --- 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; - private AltosStatusTable flightStatus; + private AltosFlightStatus flightStatus; + private JScrollPane flightInfoPane; private AltosInfoTable flightInfo; static final int tab_pad = 1; @@ -56,6 +57,8 @@ public class AltosFlightUI extends JFrame implements AltosFlightDisplay { int cur_tab = 0; + boolean exit_on_close = false; + 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; } - flightStatus.set(state); + flightStatus.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) { - AltosPreferences.init(this); + AltosPreferences.init(this); voice = in_voice; reader = in_reader; @@ -136,7 +143,7 @@ public class AltosFlightUI extends JFrame implements AltosFlightDisplay { setTitle(String.format("AltOS %s", reader.name)); - flightStatus = new AltosStatusTable(); + flightStatus = new AltosFlightStatus(); 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("Table", new JScrollPane(flightInfo.box())); + flightInfoPane = new JScrollPane(flightInfo.box()); + pane.add("Table", flightInfoPane); sitemap = new AltosSiteMap(); pane.add("Site Map", sitemap); @@ -185,7 +193,7 @@ public class AltosFlightUI extends JFrame implements AltosFlightDisplay { this.setJMenuBar(menubar); } - this.setSize(new Dimension (width(), height())); + this.setSize(this.getPreferredSize()); this.validate(); setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); @@ -195,6 +203,8 @@ public class AltosFlightUI extends JFrame implements AltosFlightDisplay { disconnect(); setVisible(false); dispose(); + if (exit_on_close) + System.exit(0); } }); |
