-import org.altusmetrum.altoslib_3.*;
-
-public class AltosLanded extends JComponent implements AltosFlightDisplay, ActionListener {
- GridBagLayout layout;
-
- public class LandedValue {
- JLabel label;
- JTextField value;
- void show(AltosState state, AltosListenerState listener_state) {}
-
- void reset() {
- value.setText("");
- }
-
- void show() {
- label.setVisible(true);
- value.setVisible(true);
- }
-
- void show(String s) {
- show();
- value.setText(s);
- }
-
- void show(AltosUnits units, double v) {
- show(units.show(8, v));
- }
-
- void show(String format, double v) {
- show(String.format(format, v));
- }
-
- public void set_font() {
- label.setFont(Altos.label_font);
- value.setFont(Altos.value_font);
- }
-
- void hide() {
- label.setVisible(false);
- value.setVisible(false);
- }
-
- public LandedValue (GridBagLayout layout, int y, String text) {
- GridBagConstraints c = new GridBagConstraints();
- c.weighty = 1;
-
- label = new JLabel(text);
- label.setFont(Altos.label_font);
- label.setHorizontalAlignment(SwingConstants.LEFT);
- c.gridx = 0; c.gridy = y;
- c.insets = new Insets(10, 10, 10, 10);
- c.anchor = GridBagConstraints.WEST;
- c.weightx = 0;
- c.fill = GridBagConstraints.VERTICAL;
- layout.setConstraints(label, c);
- add(label);
-
- value = new JTextField(Altos.text_width);
- value.setFont(Altos.value_font);
- value.setHorizontalAlignment(SwingConstants.RIGHT);
- c.gridx = 1; c.gridy = y;
- c.anchor = GridBagConstraints.WEST;
- c.weightx = 1;
- c.fill = GridBagConstraints.BOTH;
- layout.setConstraints(value, c);
- add(value);
+import org.altusmetrum.altoslib_12.*;
+import org.altusmetrum.altosuilib_12.*;
+
+public class AltosLanded extends AltosUIFlightTab implements ActionListener {
+
+ class Bearing extends AltosUIIndicator {
+ public void show (AltosState state, AltosListenerState listener_state) {
+ if (state.from_pad != null && state.from_pad.bearing != AltosLib.MISSING) {
+ show( String.format("%3.0f°", state.from_pad.bearing),
+ state.from_pad.bearing_words(
+ AltosGreatCircle.BEARING_LONG));
+ } else {
+ show("Missing", "Missing");
+ }