X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=telegps%2FTeleGPS.java;h=5a707547d480e131ee16332d1de2bd731cd23def;hp=d30d8dc53e632b6e98d4a75ec295275501fab4e3;hb=29d325f418b401f61580288b5947b0df8ac5b717;hpb=71715337eb532a1fbe1a753240e7417d5223489f diff --git a/telegps/TeleGPS.java b/telegps/TeleGPS.java index d30d8dc5..5a707547 100644 --- a/telegps/TeleGPS.java +++ b/telegps/TeleGPS.java @@ -26,7 +26,10 @@ import java.util.*; import org.altusmetrum.altoslib_4.*; import org.altusmetrum.altosuilib_2.*; -public class TeleGPS extends AltosUIFrame implements AltosFlightDisplay, AltosFontListener, ActionListener { +public class TeleGPS + extends AltosUIFrame + implements AltosFlightDisplay, AltosFontListener, AltosUnitsListener, ActionListener +{ static String[] telegps_icon_names = { "/telegps-16.png", @@ -126,13 +129,14 @@ public class TeleGPS extends AltosUIFrame implements AltosFlightDisplay, AltosFo display.reset(); } - public void set_font() { + public void font_size_changed(int font_size) { for (AltosFlightDisplay display : displays) - display.set_font(); + display.font_size_changed(font_size); } - public void font_size_changed(int font_size) { - set_font(); + public void units_changed(boolean imperial_units) { + for (AltosFlightDisplay display : displays) + display.units_changed(imperial_units); } public void show(AltosState state, AltosListenerState listener_state) { @@ -242,6 +246,16 @@ public class TeleGPS extends AltosUIFrame implements AltosFlightDisplay, AltosFo } void graph() { + AltosDataChooser chooser; + chooser = new AltosDataChooser(this); + AltosStateIterable states = chooser.runDialog(); + if (states == null) + return; + try { + new TeleGPSGraphUI(states, chooser.file()); + } catch (InterruptedException ie) { + } catch (IOException ie) { + } } void flash() { @@ -343,6 +357,7 @@ public class TeleGPS extends AltosUIFrame implements AltosFlightDisplay, AltosFo private void close() { AltosUIPreferences.unregister_font_listener(this); + AltosPreferences.unregister_units_listener(this); setVisible(false); dispose(); --number_of_windows; @@ -430,6 +445,7 @@ public class TeleGPS extends AltosUIFrame implements AltosFlightDisplay, AltosFo setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); AltosUIPreferences.register_font_listener(this); + AltosPreferences.register_units_listener(this); addWindowListener(new WindowAdapter() { @Override