2 // Copyright (c) 2010 Anthony Towns
8 import java.util.ArrayList;
12 import org.altusmetrum.altoslib_2.*;
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(AltosStateIterable states) {
32 boolean any_gps = false;
33 for (AltosState state : states) {
34 if (state.gps != null && state.gps.locked && state.gps.nsat >= 4) {
36 map = new AltosSiteMap();
37 map.show(state, null);
43 AltosGraphUI(AltosStateIterable states, File file) throws InterruptedException, IOException {
44 super(file.getName());
47 pane = new JTabbedPane();
49 enable = new AltosUIEnable();
51 stats = new AltosFlightStats(states);
52 graphDataSet = new AltosGraphDataSet(states);
54 graph = new AltosGraph(enable, stats, graphDataSet);
56 statsTable = new AltosFlightStatsTable(stats);
58 pane.add("Flight Graph", graph.panel);
59 pane.add("Configure Graph", enable);
60 pane.add("Flight Statistics", statsTable);
67 setContentPane (pane);
71 setDefaultCloseOperation(DISPOSE_ON_CLOSE);
73 if (state != null && has_gps)