2 * Copyright © 2010 Anthony Towns
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 2 or any later version of the License.
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * General Public License for more details.
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
18 package org.altusmetrum.telegps;
21 import java.util.ArrayList;
24 import java.awt.event.*;
27 import java.util.concurrent.*;
29 import org.altusmetrum.altoslib_4.*;
30 import org.altusmetrum.altosuilib_2.*;
32 import org.jfree.chart.ChartPanel;
33 import org.jfree.chart.JFreeChart;
34 import org.jfree.ui.RefineryUtilities;
36 public class TeleGPSGraphUI extends AltosUIFrame
43 AltosFlightStats stats;
44 AltosGraphDataSet graphDataSet;
46 void fill_map(AltosStateIterable states) {
47 for (AltosState state : states) {
48 if (state.gps != null && state.gps.locked && state.gps.nsat >= 4)
49 map.show(state, null);
53 private void close() {
56 TeleGPS.subtract_window();
59 TeleGPSGraphUI(AltosStateIterable states, File file) throws InterruptedException, IOException {
60 super(file.getName());
63 pane = new JTabbedPane();
65 enable = new AltosUIEnable();
66 stats = new AltosFlightStats(states);
67 graphDataSet = new AltosGraphDataSet(states);
68 graph = new AltosGraph(enable, stats, graphDataSet);
69 map = new AltosSiteMap();
71 pane.add("Flight Graph", graph.panel);
72 pane.add("Configure Graph", enable);
76 setContentPane (pane);
78 addWindowListener(new WindowAdapter() {
80 public void windowClosing(WindowEvent e) {
87 setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);