Examples of NumericTextField


Examples of com.sshtools.common.ui.NumericTextField

        gbc.insets = indentedInsets;
        bitsLabel = new JLabel("Bits");
        UIUtil.jGridBagAdd(keyPanel, bitsLabel, gbc, 1);
        gbc.weightx = 2.0;
        gbc.insets = normalInsets;
        bits = new NumericTextField(new Integer(512), new Integer(1024),
                new Integer(1024));
        bitsLabel.setLabelFor(bits);
        UIUtil.jGridBagAdd(keyPanel, bits, gbc, GridBagConstraints.RELATIVE);
        UIUtil.jGridBagAdd(keyPanel, new JLabel(), gbc,
            GridBagConstraints.REMAINDER);
View Full Code Here

Examples of com.sshtools.common.ui.NumericTextField

        gbc.insets = indentedInsets;
        bitsLabel = new JLabel("Bits");
        UIUtil.jGridBagAdd(keyPanel, bitsLabel, gbc, 1);
        gbc.weightx = 2.0;
        gbc.insets = normalInsets;
        bits = new NumericTextField(new Integer(512), new Integer(1024),
                new Integer(1024));
        bitsLabel.setLabelFor(bits);
        UIUtil.jGridBagAdd(keyPanel, bits, gbc, GridBagConstraints.RELATIVE);
        UIUtil.jGridBagAdd(keyPanel, new JLabel(), gbc,
            GridBagConstraints.REMAINDER);
View Full Code Here

Examples of gov.nasa.arc.mct.fastplot.view.NumericTextField

  public void testNonTimeAutoMatchesSpan() {
    PlotSettingsAxisGroupTester axisGroup = new PlotSettingsAxisGroupTester(false);
    axisGroup.reset(settings, true);
    axisGroup.updateFrom(view);
   
    NumericTextField span =  (NumericTextField) axisGroup.getSpanControl(true);
    span.setValue(SPAN);   
   
    JLabel min = (JLabel) axisGroup.getControl(false, BoundOption.AUTO, true);
    JLabel max = (JLabel) axisGroup.getControl(true , BoundOption.AUTO, true);
   
    ((JRadioButton) axisGroup.getControl(false, BoundOption.MANUAL, false)).doClick();
    span.setValue(SPAN)
    ((JRadioButton) axisGroup.getControl(true , BoundOption.AUTO, false)).doClick();     
    Assert.assertEquals(Double.parseDouble(max.getText().replaceAll("[\\(\\)]", "")),
        SETTINGS_MIN + SPAN, EPSILON);   

    ((JRadioButton) axisGroup.getControl(true , BoundOption.MANUAL, false)).doClick();
    span.setValue(SPAN)
    ((JRadioButton) axisGroup.getControl(false, BoundOption.AUTO, false)).doClick();     
    Assert.assertEquals(Double.parseDouble(min.getText().replaceAll("[\\(\\)]", "")),
        SETTINGS_MAX - SPAN, EPSILON);   

  }
View Full Code Here

Examples of gov.nasa.arc.mct.fastplot.view.NumericTextField

          return panel.currentValue.getValue();         
        } else if (panel.manual.isSelected()) {
          return ((ManualTimeEntryArea)panel.manualValue).getValue();
        }
      } else {
        NumericTextField field = (NumericTextField) spanControls.spanValue;
        if (panel.auto.isSelected()) {
          return getValue(other) + (maximum ? 1 : -1) * field.getDoubleValue();
        } else if (panel.current.isSelected()) {
          return panel.currentValue.getValue();
        } else if (panel.manual.isSelected()) {
          field = (NumericTextField) panel.manualValue;
          return field.getDoubleValue();
        }
      }
    } catch (ParseException pe) {
      logger.error("Parse exception in axis bounds panel.")
    }
View Full Code Here

Examples of gov.nasa.arc.mct.fastplot.view.NumericTextField

    }
   
    private JComponent getNonTimeManualValue() {
      DecimalFormat format = new DecimalFormat("###.######");
      format.setParseIntegerOnly(false);
      manualValue = new NumericTextField(NUMERIC_TEXTFIELD_COLS1, format);
      ((NumericTextField)manualValue).addFocusListener(this);
      ((NumericTextField)manualValue).addActionListener(this);
      ((JTextField)manualValue).setColumns(JTEXTFIELD_COLS);
      return manualValue;
    }
View Full Code Here

Examples of gov.nasa.arc.mct.fastplot.view.NumericTextField

            spanControls.setSpanValue(getValue(maxControls) - getValue(minControls));
          }
          manualUpdates &= !manual.isSelected();
        }
      } else {
        NumericTextField field = (NumericTextField) manualValue;
        if (hard) {
          manual.setSelected(true);           
          cachedManualValue = maximal ? getBoundMaximum(settings) : getBoundMinimum(settings);
          field.setValue(cachedManualValue);
        }
        // Prevent empty manual value field
        if (field.getText().isEmpty()) {
          field.setValue(cachedManualValue);
        }
        autoControlsCallback.run(); // Update enabled state
      }
    }
View Full Code Here

Examples of gov.nasa.arc.mct.fastplot.view.NumericTextField

            // Instrument
            spanTag.setName("spanTag");
    }

    JTextField getNonTimeTextField() {
      NumericTextField nonTimeSpanValue = new NumericTextField(NUMERIC_TEXTFIELD_COLS1, PARENTHESIZED_LABEL_FORMAT);
      nonTimeSpanValue.setColumns(JTEXTFIELD_COLS);
      nonTimeSpanValue.setValue(NONTIME_AXIS_SPAN_INIT_VALUE);
      return nonTimeSpanValue;
    }
View Full Code Here

Examples of gov.nasa.arc.mct.fastplot.view.NumericTextField

      try {
        if (temporal) {
          TimeSpanTextField field = (TimeSpanTextField) spanValue;
          return field.getDurationInMillis();         
        } else {
          NumericTextField field = (NumericTextField) spanValue;
          return field.getDoubleValue();
        }
      } catch (ParseException pe) {
        return Double.NaN;
      }
    }
View Full Code Here

Examples of gov.nasa.arc.mct.fastplot.view.NumericTextField

      if (value > 0) {
        if (temporal) {
          TimeSpanTextField field = (TimeSpanTextField) spanValue;
          field.setTime(new TimeDuration((long)value));
        } else {
          NumericTextField field = (NumericTextField) spanValue;
          field.setValue(value);     
        }
      }
    }
View Full Code Here

Examples of gov.nasa.arc.mct.fastplot.view.NumericTextField

    public void reset(PlotConfiguration settings, boolean hard) {
      if (temporal) {
        spanValue.setEnabled(maxControls.auto.isSelected());
      } else {
        spanValue.setEnabled(minControls.auto.isSelected() || maxControls.auto.isSelected());
        NumericTextField field = (NumericTextField) spanValue;
        field.setValue(getBoundMaximum(settings) - getBoundMinimum(settings));
      }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.