- void reset() {
- value.setText("");
- }
-
- abstract void show(AltosState state, int crc_errors);
-
- void show() {
- label.setVisible(true);
- value.setVisible(true);
- }
-
- void hide() {
- label.setVisible(false);
- value.setVisible(false);
- }
-
- void show(String v) {
- show();
- value.setText(v);
- }
-
- void show(AltosUnits units, double v) {
- show(units.show(8, v));
- }
-
- void show(String format, double v) {
- show(String.format(format, v));
- }
-
- void set_font() {
- label.setFont(Altos.label_font);
- value.setFont(Altos.value_font);
- }
-
- public DescentValue (GridBagLayout layout, int x, 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 = x + 1; c.gridy = y;
- c.insets = new Insets(Altos.tab_elt_pad, Altos.tab_elt_pad, Altos.tab_elt_pad, Altos.tab_elt_pad);
- c.anchor = GridBagConstraints.WEST;
- c.fill = GridBagConstraints.VERTICAL;
- c.weightx = 0;
- add(label, c);
-
- value = new JTextField(Altos.text_width);
- value.setFont(Altos.value_font);
- value.setHorizontalAlignment(SwingConstants.RIGHT);
- c.gridx = x + 2; c.gridy = y;
- c.gridwidth = 1;
- c.anchor = GridBagConstraints.WEST;
- c.fill = GridBagConstraints.BOTH;
- c.weightx = 1;
- add(value, c);
+ public Speed (Container container, int x, int y) {
+ super (container, x, y, AltosConvert.speed, "Speed");