X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=altosui%2FAltosAscent.java;h=8a4aa58b02de03234e4d070886ceaf208f84dcb6;hp=64bdcf3097cc5eae63ad395e96eded6ef6ad4a9f;hb=573edcd7dfe10ac3251396eae88eece55d82bcb6;hpb=3fbefb3eea981d34a09496cf8abf0119de2e35bf diff --git a/altosui/AltosAscent.java b/altosui/AltosAscent.java index 64bdcf30..8a4aa58b 100644 --- a/altosui/AltosAscent.java +++ b/altosui/AltosAscent.java @@ -87,6 +87,16 @@ public class AltosAscent extends JComponent implements AltosFlightDisplay { void reset() { value.setText(""); } + + void show() { + label.setVisible(true); + value.setVisible(true); + } + + void hide() { + label.setVisible(false); + value.setVisible(false); + } public AscentValue (GridBagLayout layout, int y, String text) { GridBagConstraints c = new GridBagConstraints(); c.weighty = 1; @@ -247,6 +257,7 @@ public class AltosAscent extends JComponent implements AltosFlightDisplay { class Lat extends AscentValue { void show (AltosState state, int crc_errors) { + show(); if (state.gps != null) value.setText(pos(state.gps.lat,"N", "S")); else @@ -261,6 +272,7 @@ public class AltosAscent extends JComponent implements AltosFlightDisplay { class Lon extends AscentValue { void show (AltosState state, int crc_errors) { + show(); if (state.gps != null) value.setText(pos(state.gps.lon,"E", "W")); else @@ -284,8 +296,13 @@ public class AltosAscent extends JComponent implements AltosFlightDisplay { } public void show(AltosState state, int crc_errors) { - lat.show(state, crc_errors); - lon.show(state, crc_errors); + if (state.gps != null) { + lat.show(state, crc_errors); + lon.show(state, crc_errors); + } else { + lat.hide(); + lon.hide(); + } height.show(state, crc_errors); main.show(state, crc_errors); apogee.show(state, crc_errors);