AltosAscent ascent;
AltosDescent descent;
AltosLanded landed;
+ AltosSiteMap sitemap;
private AltosFlightStatus flightStatus;
private JScrollPane flightInfoPane;
int cur_tab = 0;
+ boolean exit_on_close = false;
+
int which_tab(AltosState state) {
if (state.state < Altos.ao_flight_boost)
return tab_pad;
descent.reset();
landed.reset();
flightInfo.clear();
+ sitemap.reset();
}
public void show(AltosState state, int crc_errors) {
}
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;
flightInfoPane = new JScrollPane(flightInfo.box());
pane.add("Table", flightInfoPane);
+ sitemap = new AltosSiteMap();
+ pane.add("Site Map", sitemap);
+
vbox.add(pane);
this.add(vbox);
this.setJMenuBar(menubar);
}
- this.setSize(new Dimension (width(), height()));
+ this.setSize(this.getPreferredSize());
this.validate();
setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
disconnect();
setVisible(false);
dispose();
+ if (exit_on_close)
+ System.exit(0);
}
});