*
* 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 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
import java.awt.*;
import javax.swing.*;
-import org.altusmetrum.altoslib_7.*;
-import org.altusmetrum.altosuilib_7.*;
+import org.altusmetrum.altoslib_11.*;
+import org.altusmetrum.altosuilib_11.*;
public class AltosFlightStatus extends JComponent implements AltosFlightDisplay {
GridBagLayout layout;
}
void show(AltosState state, AltosListenerState listener_state) {
- if (!same_call(state.callsign)) {
+ if (!same_call(state.cal_data.callsign)) {
show();
- value.setText(state.callsign);
- if (state.callsign == null)
+ value.setText(state.cal_data.callsign);
+ if (state.cal_data.callsign == null)
setVisible(false);
else
setVisible(true);
- last_call = state.callsign;
+ last_call = state.cal_data.callsign;
}
}
int last_serial = -1;
void show(AltosState state, AltosListenerState listener_state) {
- if (state.serial != last_serial) {
+ AltosCalData cal_data = state.cal_data;
+ if (cal_data.serial != last_serial) {
show();
- if (state.serial == AltosLib.MISSING)
+ if (cal_data.serial == AltosLib.MISSING)
value.setText("none");
else
- value.setText(String.format("%d", state.serial));
- last_serial = state.serial;
+ value.setText(String.format("%d", cal_data.serial));
+ last_serial = cal_data.serial;
}
}
int last_flight = -1;
void show(AltosState state, AltosListenerState listener_state) {
- if (state.flight != last_flight) {
+ AltosCalData cal_data = state.cal_data;
+ if (cal_data.flight != last_flight) {
show();
- if (state.flight == AltosLib.MISSING)
+ if (cal_data.flight == AltosLib.MISSING)
value.setText("none");
else
- value.setText(String.format("%d", state.flight));
- last_flight = state.flight;
+ value.setText(String.format("%d", cal_data.flight));
+ last_flight = cal_data.flight;
}
}
int last_state = -1;
void show(AltosState state, AltosListenerState listener_state) {
- if (state.state != last_state) {
- if (state.state == AltosLib.ao_flight_stateless)
+ if (state.state() != last_state) {
+ if (state.state() == AltosLib.ao_flight_stateless)
hide();
else {
show();
value.setText(state.state_name());
}
- last_state = state.state;
+ last_state = state.state();
}
}