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; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
19 package org.altusmetrum.telegps;
22 import java.util.ArrayList;
25 import java.awt.event.*;
28 import java.util.concurrent.*;
30 import org.altusmetrum.altoslib_11.*;
31 import org.altusmetrum.altosuilib_11.*;
33 import org.jfree.chart.ChartPanel;
34 import org.jfree.chart.JFreeChart;
35 import org.jfree.ui.RefineryUtilities;
37 public class TeleGPSGraphUI extends AltosUIFrame
44 AltosFlightStats stats;
45 AltosGraphDataSet graphDataSet;
46 AltosFlightStatsTable statsTable;
48 void fill_map(AltosStateIterable states) {
49 for (AltosState state : states) {
50 if (state.gps != null && state.gps.locked && state.gps.nsat >= 4)
51 map.show(state, null);
55 private void close() {
58 TeleGPS.subtract_window();
61 TeleGPSGraphUI(AltosStateIterable states, File file) throws InterruptedException, IOException {
62 super(file.getName());
65 pane = new JTabbedPane();
67 enable = new AltosUIEnable();
68 stats = new AltosFlightStats(states);
69 graphDataSet = new AltosGraphDataSet(states);
70 graph = new AltosGraph(enable, stats, graphDataSet);
71 statsTable = new AltosFlightStatsTable(stats);
73 map = new AltosUIMap();
75 pane.add("Graph", graph.panel);
76 pane.add("Configure Graph", enable);
77 pane.add("Statistics", statsTable);
81 setContentPane (pane);
83 addWindowListener(new WindowAdapter() {
85 public void windowClosing(WindowEvent e) {
92 setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);