altosui/altosuilib: Cleanup -Xlint:unchecked warnings
[fw/altos] / altosui / AltosAscent.java
index 3f74fdd1a481224c0db121c8dab2cc9ad7a5190a..81b08d2c3aa7cae5ee67c6124dc90199d7b71ee1 100644 (file)
@@ -48,7 +48,7 @@ public class AltosAscent extends JComponent implements AltosFlightDisplay {
                        show();
                        value.setText(s);
                }
-               
+
                void show(AltosUnits units, double v) {
                        show(units.show(8, v));
                }
@@ -122,7 +122,7 @@ public class AltosAscent extends JComponent implements AltosFlightDisplay {
                        show();
                        value.setText(s);
                }
-               
+
                void show(AltosUnits units, double v) {
                        show(units.show(8, v));
                }
@@ -200,6 +200,13 @@ public class AltosAscent extends JComponent implements AltosFlightDisplay {
                                }
                        }
                }
+
+               void hide() {
+                       label.setVisible(false);
+                       value.setVisible(false);
+                       max_value.setVisible(false);
+               }
+
                public AscentValueHold (GridBagLayout layout, int y, String text) {
                        GridBagConstraints      c = new GridBagConstraints();
                        c.weighty = 1;
@@ -388,7 +395,10 @@ public class AltosAscent extends JComponent implements AltosFlightDisplay {
                        apogee.hide();
                speed.show(state, listener_state);
                accel.show(state, listener_state);
-               orient.show(state, listener_state);
+               if (state.orient() != AltosLib.MISSING)
+                       orient.show(state, listener_state);
+               else
+                       orient.hide();
        }
 
        public void labels(GridBagLayout layout, int y) {