예제 #1
0
  public void setValue(float newValue, boolean fireEvent) {
    if (newValue > max) current = max;
    else if (newValue < min) current = min;
    else current = newValue;

    valueChanged(fireEvent);
  }
예제 #2
0
  /** Sets max value, if current is greater than max, the current value is set to max value */
  public void setMax(float max) {
    this.max = max;

    if (current > max) {
      current = max;
      valueChanged(true);
    }
  }
예제 #3
0
  /** Sets min value, if current is lesser than min, the current value is set to min value */
  public void setMin(float min) {
    this.min = min;

    if (current < min) {
      current = min;
      valueChanged(true);
    }
  }
예제 #4
0
  private void decrement(boolean fireEvent) {
    if (current - step < min) this.current = min;
    else this.current -= step;

    valueChanged(fireEvent);
  }
예제 #5
0
  private void increment(boolean fireEvent) {
    if (current + step > max) this.current = max;
    else this.current += step;

    valueChanged(fireEvent);
  }