import javax.swing.event.*;
import java.io.*;
import java.util.concurrent.*;
-import org.altusmetrum.altoslib_1.*;
+import java.util.Arrays;
+import org.altusmetrum.altoslib_3.*;
import org.altusmetrum.altosuilib_1.*;
public class AltosIdleMonitorUI extends AltosUIFrame implements AltosFlightDisplay, AltosFontListener, AltosIdleMonitorListener, DocumentListener {
void stop_display() {
if (thread != null) {
- thread.abort();
+ try {
+ thread.abort();
+ } catch (InterruptedException ie) {
+ }
}
thread = null;
}
AltosFlightStatusUpdate status_update;
- public void show(AltosState state, int crc_errors) {
+ public void show(AltosState state, AltosListenerState listener_state) {
status_update.saved_state = state;
- try {
- pad.show(state, crc_errors);
- flightStatus.show(state, crc_errors);
- flightInfo.show(state, crc_errors);
- } catch (Exception e) {
- System.out.print("Show exception" + e);
- }
+// try {
+ pad.show(state, listener_state);
+ flightStatus.show(state, listener_state);
+ flightInfo.show(state, listener_state);
+// } catch (Exception e) {
+// System.out.print("Show exception " + e);
+// }
}
- public void update(final AltosState state) {
+ public void update(final AltosState state, final AltosListenerState listener_state) {
Runnable r = new Runnable() {
public void run() {
- show(state, 0);
+ show(state, listener_state);
}
};
SwingUtilities.invokeLater(r);
addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
- disconnect();
+ try {
+ disconnect();
+ } catch (Exception ex) {
+ System.out.println(Arrays.toString(ex.getStackTrace()));
+ }
setVisible(false);
dispose();
AltosUIPreferences.unregister_font_listener(AltosIdleMonitorUI.this);