summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
8d9c79f)
When doing Monitor Idle with EasyMini, it's nice to not put fields on
the screen which won't ever have useful data in them.
Signed-off-by: Keith Packard <keithp@keithp.com>
value.setFont(Altos.status_font);
}
value.setFont(Altos.status_font);
}
+ void setVisible(boolean visible) {
+ label.setVisible(visible);
+ value.setVisible(visible);
+ }
+
public FlightValue (GridBagLayout layout, int x, String text) {
GridBagConstraints c = new GridBagConstraints();
c.insets = new Insets(5, 5, 5, 5);
public FlightValue (GridBagLayout layout, int x, String text) {
GridBagConstraints c = new GridBagConstraints();
c.insets = new Insets(5, 5, 5, 5);
class Call extends FlightValue {
void show(AltosState state, AltosListenerState listener_state) {
value.setText(state.callsign);
class Call extends FlightValue {
void show(AltosState state, AltosListenerState listener_state) {
value.setText(state.callsign);
+ if (state.callsign == null)
+ setVisible(false);
+ else
+ setVisible(true);
}
public Call (GridBagLayout layout, int x) {
super (layout, x, "Callsign");
}
public Call (GridBagLayout layout, int x) {
super (layout, x, "Callsign");
class RSSI extends FlightValue {
void show(AltosState state, AltosListenerState listener_state) {
value.setText(String.format("%d", state.rssi()));
class RSSI extends FlightValue {
void show(AltosState state, AltosListenerState listener_state) {
value.setText(String.format("%d", state.rssi()));
+ if (state.rssi == AltosLib.MISSING)
+ setVisible(false);
+ else
+ setVisible(true);
}
public RSSI (GridBagLayout layout, int x) {
super (layout, x, "RSSI");
}
public RSSI (GridBagLayout layout, int x) {
super (layout, x, "RSSI");