Пример #1
0
 /**
  * tokenize the pattern string as a numeric range
  *
  * @return min max range values
  * @throws Exception On badness
  */
 public Real[] getNumericRange() throws Exception {
   if (range == null) {
     range = new Real[] {null, null};
     List toks = StringUtil.split(pattern, ",");
     if (toks.size() == 0) {
       throw new IllegalStateException("Bad format for numeric range:" + pattern);
     }
     String tok1 = toks.get(0).toString();
     String tok2 = ((toks.size() == 1) ? tok1 : toks.get(1).toString());
     range[0] = ucar.visad.Util.toReal(tok1);
     range[1] = ucar.visad.Util.toReal(tok2);
   }
   return range;
 }
Пример #2
0
  /**
   * Apply the properties
   *
   * @param compMap Optional map that holds components
   * @return Success
   * @throws RemoteException On badness
   * @throws VisADException On badness
   */
  protected boolean applyProperties(Hashtable compMap) throws VisADException, RemoteException {
    if (!super.applyProperties(compMap)) {
      return false;
    }
    setStartText(startTextFld.getText().trim());
    setEndText(endTextFld.getText().trim());
    try {
      if (maxDistanceFld != null) {
        Real oldMaxDataDistance = maxDataDistance;
        maxDataDistance = ucar.visad.Util.toReal(maxDistanceFld.getText().trim());
        tvm.setMaxDataDistance(maxDataDistance);
        updateLocation();
      }
    } catch (Exception exc) {
      LogUtil.userErrorMessage("Bad value:" + maxDistanceFld.getText().trim());
      return false;
    }

    return true;
  }