X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=altosui%2FAltosGraphUI.java;h=ac20f84b26a23ad7bfc4b22b6374348829778318;hb=cbd9dd989a662f41ddcb0c9e0f4453840687fd4a;hp=b376f7de69ee29d4adea4d1d46e56b003bd21af9;hpb=2efd3ad80d4fefa8ccc1b80a2e657dbf9ba0c60f;p=fw%2Faltos 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); } }