+ Container container;
+ JTabbedPane pane;
+ JMenuBar menu_bar;
+ static int number_of_windows;
+
+ /* File menu */
+ final static String open_command = "open";
+ final static String save_command = "save";
+ final static String export_command = "export";
+ final static String preferences_command = "preferences";
+ final static String close_command = "close";
+ final static String exit_command = "exit";
+
+ static final String[][] file_menu_entries = new String[][] {
+ { "Open", open_command },
+ { "Save a Copy", save_command },
+ { "Export Data", export_command },
+ { "Preferences", preferences_command },
+ { "Close", close_command },
+ { "Exit", exit_command },
+ };
+
+ /* Download menu */
+ final static String download_command = "download";
+ final static String download_label = "Download";
+
+ static final String[][] download_menu_entries = new String[][] {
+ { download_label, download_command }
+ };
+
+ MicroPeak SetData(MicroData data) {
+ MicroPeak mp = this;
+ if (this.data != null) {
+ mp = new MicroPeak();
+ return mp.SetData(data);
+ }
+ this.data = data;
+ if (data.flight_series == null)
+ System.out.printf("no data in flight\n");
+ if (data.flight_stats == null)
+ System.out.printf("no stats in flight\n");
+ graph.set_data(data.flight_stats, data.flight_series);
+ statsTable.set_stats(data.flight_stats);
+ raw.setData(data);
+ setTitle(data.name);
+ return this;
+ }
+
+ void SetName(String name) {
+ graph.setName(name);
+ setTitle(name);
+ }
+
+ private static MicroData ReadFile(File filename) throws IOException, FileNotFoundException {
+ MicroData data = null;
+ FileInputStream fis = new FileInputStream(filename);
+ try {
+ data = new MicroData((InputStream) fis, filename.getName());
+ AltosUIPreferences.set_last_logdir(filename);
+ } catch (MicroData.NonHexcharException nhe) {
+ data = null;
+ } catch (MicroData.FileEndedException nhe) {
+ data = null;
+ } catch (InterruptedException ie) {
+ data = null;
+ } finally {
+ fis.close();
+ }
+ return data;
+ }