*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
import java.io.*;
import java.util.concurrent.*;
import java.util.*;
-import org.altusmetrum.altoslib_4.*;
-import org.altusmetrum.altosuilib_2.*;
+import org.altusmetrum.altoslib_12.*;
+import org.altusmetrum.altosuilib_12.*;
public class MicroPeak extends MicroFrame implements ActionListener, ItemListener {
File filename;
- MicroGraph graph;
+ AltosGraph graph;
AltosUIEnable enable;
- MicroStatsTable statsTable;
+ AltosFlightStatsTable statsTable;
MicroRaw raw;
MicroData data;
- MicroStats stats;
Container container;
JTabbedPane pane;
static int number_of_windows;
return mp.SetData(data);
}
this.data = data;
- stats = new MicroStats(data);
- graph.setDataSet(data);
- statsTable.setStats(stats);
+ 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;
private void DownloadData() {
AltosDevice device = MicroDeviceDialog.show(this);
-
+
if (device != null)
new MicroDownload(this, device);
}
if (save.runDialog())
SetName(data.name);
}
-
+
private void Export() {
if (data == null) {
no_data();
public void itemStateChanged(ItemEvent e) {
}
+ /* OSXAdapter interfaces */
+ public void macosx_file_handler(String path) {
+ CommandGraph(new File(path));
+ }
+
+ public void macosx_quit_handler() {
+ System.exit(0);
+ }
+
+ public void macosx_preferences_handler() {
+ Preferences();
+ }
+
public MicroPeak() {
++number_of_windows;
+ register_for_macosx_events();
+
AltosUIPreferences.set_component(this);
container = getContentPane();
});
enable = new AltosUIEnable();
- graph = new MicroGraph(enable);
- statsTable = new MicroStatsTable();
+
+ graph = new AltosGraph(enable);
+ statsTable = new AltosFlightStatsTable();
raw = new MicroRaw();
pane.add(graph.panel, "Graph");
pane.add(enable, "Configure Graph");
CommandExport(file);
opened = true;
} catch (Exception e) {
- System.err.printf("Error processing \"%s\": %s\n",
- file.getName(), e.getMessage());
+ System.err.printf("Error processing \"%s\": %s %s\n",
+ file.getName(), e.toString(), e.getMessage());
+ e.printStackTrace();
}
}
}