X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=altosui%2FAltosFlightUI.java;h=3160fd957a26672c7b32780868594a2991cbce31;hb=c63617415553d97f9be2f19b94365b53d4480c68;hp=6af345ea909068c09fdf1cb887badd0e7532b540;hpb=efb86669b5a74f244e2218f3385db633c36208af;p=fw%2Faltos diff --git a/altosui/AltosFlightUI.java b/altosui/AltosFlightUI.java index 6af345ea..3160fd95 100644 --- a/altosui/AltosFlightUI.java +++ b/altosui/AltosFlightUI.java @@ -22,8 +22,8 @@ import java.awt.event.*; import javax.swing.*; import java.util.*; import java.util.concurrent.*; -import org.altusmetrum.altoslib_5.*; -import org.altusmetrum.altosuilib_3.*; +import org.altusmetrum.altoslib_7.*; +import org.altusmetrum.altosuilib_7.*; public class AltosFlightUI extends AltosUIFrame implements AltosFlightDisplay { AltosVoice voice; @@ -40,7 +40,7 @@ public class AltosFlightUI extends AltosUIFrame implements AltosFlightDisplay { AltosDescent descent; AltosLanded landed; AltosCompanionInfo companion; - AltosUIMap sitemap; + AltosUIMapNew sitemap; boolean has_map; boolean has_companion; boolean has_state; @@ -97,6 +97,7 @@ public class AltosFlightUI extends AltosUIFrame implements AltosFlightDisplay { public void show(AltosState state, AltosListenerState listener_state) { status_update.saved_state = state; + status_update.saved_listener_state = listener_state; if (state == null) state = new AltosState(); @@ -318,7 +319,7 @@ public class AltosFlightUI extends AltosUIFrame implements AltosFlightDisplay { has_companion = false; has_state = false; - sitemap = new AltosUIMap(); + sitemap = new AltosUIMapNew(); displays.add(sitemap); has_map = false; @@ -335,9 +336,14 @@ public class AltosFlightUI extends AltosUIFrame implements AltosFlightDisplay { AltosUIPreferences.register_font_listener(this); AltosPreferences.register_units_listener(this); + status_update = new AltosFlightStatusUpdate(flightStatus); + + flightStatus.start(status_update); + addWindowListener(new WindowAdapter() { @Override public void windowClosing(WindowEvent e) { + flightStatus.stop(); disconnect(); setVisible(false); dispose(); @@ -353,10 +359,6 @@ public class AltosFlightUI extends AltosUIFrame implements AltosFlightDisplay { thread = new AltosDisplayThread(this, voice, this, reader); - status_update = new AltosFlightStatusUpdate(flightStatus); - - new javax.swing.Timer(100, status_update).start(); - thread.start(); }