code: public void setCurrentValue(double curValue, boolean fireEvent) {
  		// Confine the value to the range
  		this.curValue = Math.max(minValue, Math.min(maxValue, curValue));
  		double remainder = (this.curValue - minValue) % stepSize;
  		this.curValue -= remainder;
  
  		// Go to next step if more than halfway there
  		if ((remainder > (stepSize / 2)) && ((this.curValue + stepSize) <= maxValue)) {
  			this.curValue += stepSize;
  		}
  
  		// Redraw the knob
  		drawKnob();
  
  		// Fire the ValueChangeEvent
  		if (fireEvent) {
  			ValueChangeEvent.fire(this, this.curValue);
  		}
  	}
docs: Set the current value and optionally fire the onValueChange event.
  
  @param curValue
  the current value
  @param fireEvent
  fire the onValue change event if true