X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=telegps%2FTeleGPS.java;h=1898a668057b363751bb448b74433598407134aa;hp=7117443632dcfa9553a706be58dba74fefaef2a2;hb=8cb41ce9a64029b611b3595c86a4a8e74b952ff4;hpb=d550c3b3eccbb0283c588b5df69edb2e9b44b4cc diff --git a/telegps/TeleGPS.java b/telegps/TeleGPS.java index 71174436..1898a668 100644 --- a/telegps/TeleGPS.java +++ b/telegps/TeleGPS.java @@ -51,7 +51,7 @@ public class TeleGPS } AltosFlightReader reader; - AltosDisplayThread thread; + TeleGPSDisplayThread thread; JMenuBar menu_bar; @@ -67,7 +67,7 @@ public class TeleGPS JTabbedPane pane; - AltosSiteMap sitemap; + AltosUIMap map; TeleGPSInfo gps_info; AltosInfoTable info_table; @@ -167,7 +167,7 @@ public class TeleGPS } void load_maps() { - new AltosSiteMapPreload(this); + new AltosUIMapPreload(this); } void disconnect() { @@ -323,6 +323,9 @@ public class TeleGPS void add_frequency_menu(int serial, final AltosFlightReader reader) { // Channel menu + if (frequencies != null) + return; + frequencies = new AltosFreqList(AltosUIPreferences.frequency(serial)); frequencies.set_product("Monitor"); frequencies.set_serial(serial); @@ -343,13 +346,14 @@ public class TeleGPS void remove_frequency_menu() { if (frequencies != null) { menu_bar.remove(frequencies); + menu_bar.repaint(); frequencies = null; } } public void set_reader(AltosFlightReader reader) { setTitle(String.format("TeleGPS %s", reader.name)); - thread = new AltosDisplayThread(this, voice(), this, reader); + thread = new TeleGPSDisplayThread(this, voice(), this, reader); thread.start(); } @@ -366,6 +370,7 @@ public class TeleGPS } private void close() { + disconnect(); AltosUIPreferences.unregister_font_listener(this); AltosPreferences.unregister_units_listener(this); setVisible(false); @@ -438,9 +443,9 @@ public class TeleGPS c.gridwidth = 2; bag.add(pane, c); - sitemap = new AltosSiteMap(); - pane.add("Site Map", sitemap); - displays.add(sitemap); + map = new AltosUIMap(); + pane.add("Map", map); + displays.add(map); gps_info = new TeleGPSInfo(); pane.add("Info", gps_info); @@ -578,7 +583,7 @@ public class TeleGPS } else { double lat = Double.parseDouble(args[i+1]); double lon = Double.parseDouble(args[i+2]); - AltosSiteMap.prefetchMaps(lat, lon); + AltosUIMap.prefetch_maps(lat, lon); i += 2; } } else if (args[i].equals("--replay"))