X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=telegps%2FTeleGPSGraphUI.java;h=55ee370e33b2a4e1dda1e3b3a0dd629114d1f7a4;hp=b7c17780d522e91f776ecaa3554ee8114ee12769;hb=238e56e0f6ab2f623e0faf25298b38dc3a4aff74;hpb=48074131ad05b4646e5d2dcf30ba4a1d17e249f8 diff --git a/telegps/TeleGPSGraphUI.java b/telegps/TeleGPSGraphUI.java index b7c17780..55ee370e 100644 --- a/telegps/TeleGPSGraphUI.java +++ b/telegps/TeleGPSGraphUI.java @@ -3,7 +3,8 @@ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 or any later version of the License. + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of @@ -21,9 +22,13 @@ import java.io.*; import java.util.ArrayList; import java.awt.*; +import java.awt.event.*; import javax.swing.*; -import org.altusmetrum.altoslib_4.*; -import org.altusmetrum.altosuilib_2.*; +import java.io.*; +import java.util.concurrent.*; +import java.util.*; +import org.altusmetrum.altoslib_11.*; +import org.altusmetrum.altosuilib_11.*; import org.jfree.chart.ChartPanel; import org.jfree.chart.JFreeChart; @@ -34,10 +39,11 @@ public class TeleGPSGraphUI extends AltosUIFrame JTabbedPane pane; AltosGraph graph; AltosUIEnable enable; - AltosSiteMap map; + AltosUIMap map; AltosState state; AltosFlightStats stats; AltosGraphDataSet graphDataSet; + AltosFlightStatsTable statsTable; void fill_map(AltosStateIterable states) { for (AltosState state : states) { @@ -46,6 +52,12 @@ public class TeleGPSGraphUI extends AltosUIFrame } } + private void close() { + setVisible(false); + dispose(); + TeleGPS.subtract_window(); + } + TeleGPSGraphUI(AltosStateIterable states, File file) throws InterruptedException, IOException { super(file.getName()); state = null; @@ -56,20 +68,35 @@ public class TeleGPSGraphUI extends AltosUIFrame stats = new AltosFlightStats(states); graphDataSet = new AltosGraphDataSet(states); graph = new AltosGraph(enable, stats, graphDataSet); - map = new AltosSiteMap(); + statsTable = new AltosFlightStatsTable(stats); - pane.add("Flight Graph", graph.panel); + map = new AltosUIMap(); + + pane.add("Graph", graph.panel); pane.add("Configure Graph", enable); + pane.add("Statistics", statsTable); fill_map(states); pane.add("Map", map); setContentPane (pane); + addWindowListener(new WindowAdapter() { + @Override + public void windowClosing(WindowEvent e) { + close(); + } + }); + pack(); - setDefaultCloseOperation(DISPOSE_ON_CLOSE); + setDefaultCloseOperation(DO_NOTHING_ON_CLOSE); + + TeleGPS.add_window(); + setVisible(true); + if (state != null) map.centre(state); + } }