Package gov.nasa.arc.mct.fastplot.view

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


    axisGroup.reset(settings, true);
    axisGroup.updateFrom(view);
   
    JLabel max = (JLabel) axisGroup.getControl(true , BoundOption.AUTO, true);
   
    TimeSpanTextField span =  (TimeSpanTextField) axisGroup.getSpanControl(true);
   
    ((JRadioButton) axisGroup.getControl(false, BoundOption.CURRENT, false)).doClick();
    span.setTime(new TimeDuration(15000l));
    ((JRadioButton) axisGroup.getControl(true , BoundOption.AUTO, false)).doClick();     
    Assert.assertEquals(max.getText().replaceAll("[\\(\\)]", ""), "001/00:00:16 1969");
  }
View Full Code Here


  private double getValue(AxisBoundsPanel panel)  {
    try {
      boolean maximum = panel == maxControls;
      AxisBoundsPanel other = maximum ? minControls : maxControls;
      if (temporal) {
        TimeSpanTextField field = (TimeSpanTextField) spanControls.spanValue;
        if (panel.auto.isSelected()) {
          return maximum ? (field.getDurationInMillis() + getValue(other)) :
                         panel.autoValue.getValue(); // Now
        } else if (panel.current.isSelected()) {
          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

        formatter = new MaskFormatter("###/##:##:##");
        formatter.setPlaceholderCharacter('0');
      } catch (ParseException e) {
        logger.error("Error in creating a mask formatter", e);
      }
          return new TimeSpanTextField(formatter);
    }
View Full Code Here

    }
   
    public double getSpanValue() {
      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

    }
   
    public void setSpanValue(double value) {
      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

TOP

Related Classes of gov.nasa.arc.mct.fastplot.view.TimeSpanTextField

Copyright © 2018 www.massapicom. 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.