Class DefaultSliderModel

java.lang.Object
com.ardor3d.extension.ui.model.DefaultSliderModel
All Implemented Interfaces:
SliderModel

public class DefaultSliderModel extends Object implements SliderModel
A backing data model for UISlider.
  • Constructor Details

    • DefaultSliderModel

      public DefaultSliderModel(int minValue, int maxValue)
      Construct a new model
      Parameters:
      minValue - lowest possible value (inclusive)
      maxValue - highest possible value (inclusive)
  • Method Details

    • getCurrentValue

      public int getCurrentValue()
      Specified by:
      getCurrentValue in interface SliderModel
      Returns:
      the current set value
    • setCurrentValue

      public void setCurrentValue(int currentValue)
      Description copied from interface: SliderModel
      Set a new current value. No change event will be fired.
      Specified by:
      setCurrentValue in interface SliderModel
      Parameters:
      currentValue - the new current value
    • setCurrentValue

      public void setCurrentValue(int currentValue, UISlider slider)
      Description copied from interface: SliderModel
      Set a new current value. If a slider is provided, fireChangeEvent will be called on it.
      Specified by:
      setCurrentValue in interface SliderModel
      Parameters:
      currentValue - the new current value
      slider - the slider to call fireChangeEvent, if not null.
    • getMaxValue

      public int getMaxValue()
      Specified by:
      getMaxValue in interface SliderModel
      Returns:
      the highest possible value (inclusive)
    • setMaxValue

      public void setMaxValue(int maxValue)
      Specified by:
      setMaxValue in interface SliderModel
      Parameters:
      maxValue - the new highest possible value (inclusive)
    • getMinValue

      public int getMinValue()
      Specified by:
      getMinValue in interface SliderModel
      Returns:
      the lowest possible value (inclusive)
    • setMinValue

      public void setMinValue(int minValue)
      Specified by:
      setMinValue in interface SliderModel
      Parameters:
      minValue - the new lowest possible value (inclusive)