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
27 boolean fill_map(AltosRecordIterable records) {
28 boolean any_gps = false;
29 for (AltosRecord record : records) {
30 state = new AltosState(record, state);
31 if (state.data.gps != null) {
39 AltosGraphUI(AltosRecordIterable records, File file) throws InterruptedException, IOException {
40 super(file.getName());
43 pane = new JTabbedPane();
45 enable = new AltosUIEnable();
47 AltosGraph graph = new AltosGraph(enable);
49 graph.setDataSet(new AltosGraphDataSet(records));
51 map = new AltosSiteMap();
53 pane.add("Flight Graph", graph.panel);
54 pane.add("Configure Graph", enable);
56 AltosFlightStatsTable stats = new AltosFlightStatsTable(new AltosFlightStats(records));
57 pane.add("Flight Statistics", stats);
59 if (fill_map(records))
62 setContentPane (pane);
66 setDefaultCloseOperation(DISPOSE_ON_CLOSE);