2 // Copyright (c) 2010 Anthony Towns
8 import java.util.ArrayList;
12 import org.altusmetrum.altoslib_1.*;
13 import org.altusmetrum.altosuilib_1.*;
15 import org.jfree.chart.ChartPanel;
16 import org.jfree.chart.JFreeChart;
17 import org.jfree.ui.RefineryUtilities;
19 public class AltosGraphUI extends AltosUIFrame
26 AltosGraphDataSet graphDataSet;
27 AltosFlightStats stats;
28 AltosFlightStatsTable statsTable;
31 void fill_map(AltosRecordIterable records) {
32 boolean any_gps = false;
33 for (AltosRecord record : records) {
34 state = new AltosState(record, state);
35 if (state.gps != null && state.gps.locked && state.gps.nsat >= 4) {
37 map = new AltosSiteMap();
38 map.show(state, null);
44 AltosGraphUI(AltosRecordIterable records, File file) throws InterruptedException, IOException {
45 super(file.getName());
48 pane = new JTabbedPane();
50 enable = new AltosUIEnable();
52 stats = new AltosFlightStats(records);
53 graphDataSet = new AltosGraphDataSet(records);
55 graph = new AltosGraph(enable, stats, graphDataSet);
57 statsTable = new AltosFlightStatsTable(stats);
59 pane.add("Flight Graph", graph.panel);
60 pane.add("Configure Graph", enable);
61 pane.add("Flight Statistics", statsTable);
68 setContentPane (pane);
72 setDefaultCloseOperation(DISPOSE_ON_CLOSE);
74 if (state != null && has_gps)