- void hide() {
- label.setVisible(false);
- value1.setVisible(false);
- value2.setVisible(false);
- }
-
- public void font_size_changed(int font_size) {
- label.setFont(Altos.label_font);
- value1.setFont(Altos.value_font);
- value2.setFont(Altos.value_font);
- }
-
- public void units_changed(boolean imperial_units) {
- }
-
- abstract void show(AltosState state, AltosListenerState listener_state);
-
- void show(String v1, String v2) {
- show();
- value1.setText(v1);
- value2.setText(v2);
- }
- void show(String f1, double v1, String f2, double v2) {
- show();
- value1.setText(String.format(f1, v1));
- value2.setText(String.format(f2, v2));
- }
-
- public DescentDualValue (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;
- layout.setConstraints(label, c);
- add(label);
-
- value1 = new JTextField(Altos.text_width);
- value1.setEditable(false);
- value1.setFont(Altos.value_font);
- value1.setHorizontalAlignment(SwingConstants.RIGHT);
- c.gridx = x + 2; c.gridy = y;
- c.anchor = GridBagConstraints.WEST;
- c.fill = GridBagConstraints.BOTH;
- c.weightx = 1;
- layout.setConstraints(value1, c);
- add(value1);
-
- value2 = new JTextField(Altos.text_width);
- value2.setEditable(false);
- value2.setFont(Altos.value_font);
- value2.setHorizontalAlignment(SwingConstants.RIGHT);
- c.gridx = x + 4; c.gridy = y;
- c.anchor = GridBagConstraints.WEST;
- c.fill = GridBagConstraints.BOTH;
- c.weightx = 1;
- c.gridwidth = 1;
- layout.setConstraints(value2, c);
- add(value2);
- }
- }
-
- class Height extends DescentValue {
- void show (AltosState state, AltosListenerState listener_state) {
- show(state.height());
- }
- public Height (GridBagLayout layout, int x, int y) {
- super (layout, x, y, AltosConvert.height, "Height");