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;
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
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
}
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);