+ return new int[] { iVal };
+ }
+ else if (isLogarithmic)
+ {
+ dVal = 0d;
+ try
+ {
+ valueField.setText(valueField.getText().trim());
+ double eValue = Double.valueOf(valueField.getText());
+
+ dVal = Math.log(eValue) / Math
+ .log(((LogarithmicParameter) parameter).getBase())
+ * LOGSLIDERSCALE;
+
+ if (validator.getMin() != null
+ && validator.getMin().doubleValue() > dVal)
+ {
+ dVal = validator.getMin().doubleValue();
+ // TODO: provide visual indication that hard limit was reached for
+ // this parameter
+ // update value field to reflect any bound checking we performed.
+ valueField.setText(formatDouble(eValue));
+ }
+ if (validator.getMax() != null
+ && validator.getMax().doubleValue() < dVal)
+ {
+ dVal = validator.getMax().doubleValue();
+ // TODO: provide visual indication that hard limit was reached for
+ // this parameter
+ // update value field to reflect any bound checking we performed.
+ valueField.setText(formatDouble(eValue));
+ }
+ } catch (Exception e)
+ {
+ }
+
+ if (validator.getMin() != null && validator.getMax() != null)
+ {
+ slider.getModel().setRangeProperties((int) (dVal), 1,
+ (int) (validator.getMin().doubleValue()),
+ 1 + (int) (validator.getMax().doubleValue()),
+ true);
+ }
+ else
+ {
+ slider.setVisible(false);
+ }
+ return new double[] { dVal };