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, String file) throws InterruptedException, IOException {
42 pane = new JTabbedPane();
44 enable = new AltosUIEnable();
46 AltosGraph graph = new AltosGraph(enable);
48 graph.setDataSet(new AltosGraphDataSet(records));
50 map = new AltosSiteMap();
52 pane.add("Flight Graph", graph.panel);
53 pane.add("Configure Graph", enable);
55 AltosFlightStatsTable stats = new AltosFlightStatsTable(new AltosFlightStats(records));
56 pane.add("Flight Statistics", stats);
58 if (fill_map(records))
61 setContentPane (pane);
65 setDefaultCloseOperation(DISPOSE_ON_CLOSE);