summaryrefslogtreecommitdiff
path: root/altosui/AltosGraphUI.java
diff options
context:
space:
mode:
Diffstat (limited to 'altosui/AltosGraphUI.java')
-rw-r--r--altosui/AltosGraphUI.java23
1 files changed, 23 insertions, 0 deletions
diff --git a/altosui/AltosGraphUI.java b/altosui/AltosGraphUI.java
index b376f7de..ac20f84b 100644
--- a/altosui/AltosGraphUI.java
+++ b/altosui/AltosGraphUI.java
@@ -21,8 +21,24 @@ public class AltosGraphUI extends AltosUIFrame
JTabbedPane pane;
AltosGraph graph;
AltosUIEnable enable;
+ AltosSiteMap map;
+ AltosState state;
+
+ boolean fill_map(AltosRecordIterable records) {
+ boolean any_gps = false;
+ for (AltosRecord record : records) {
+ state = new AltosState(record, state);
+ if (state.data.gps != null) {
+ map.show(state, 0);
+ any_gps = true;
+ }
+ }
+ return any_gps;
+ }
AltosGraphUI(AltosRecordIterable records, String file) throws InterruptedException, IOException {
+ state = null;
+
pane = new JTabbedPane();
enable = new AltosUIEnable();
@@ -31,17 +47,24 @@ public class AltosGraphUI extends AltosUIFrame
graph.setDataSet(new AltosGraphDataSet(records));
+ map = new AltosSiteMap();
+
pane.add("Flight Graph", graph.panel);
pane.add("Configure Graph", enable);
AltosFlightStatsTable stats = new AltosFlightStatsTable(new AltosFlightStats(records));
pane.add("Flight Statistics", stats);
+ if (fill_map(records))
+ pane.add("Map", map);
+
setContentPane (pane);
pack();
setDefaultCloseOperation(DISPOSE_ON_CLOSE);
setVisible(true);
+ if (state != null)
+ map.centre(state);
}
}