Module MaterialFX

Interface SpinnerModel<T>

All Known Implementing Classes:
AbstractSpinnerModel, DoubleSpinnerModel, IntegerSpinnerModel, ListSpinnerModel, LocalDateSpinnerModel, NumberSpinnerModel

public interface SpinnerModel<T>
Defines the public API for all models to be used with MFXSpinner.

SpinnerModel is basically an helper class to allow the spinner to work on any object type as long as a model exists for it. The model is responsible for changing the spinner's value by going forward or backwards (or #previous().

Along this core functionality the model also specifies a StringConverter which will be used to convert the T value to a String, which will be the spinner's text.

The spinner should also allow to cycle through the values, meaning that when reaching the the last value, next() will go to the first value (and the other way around)

  • Property Details

  • Method Details

    • next

      void next()
      Steps to the next value.
    • previous

      void previous()
      Steps to the previous value.
    • reset

      void reset()
      Resets the spinner's value.
    • getValue

      T getValue()
      Gets the value of the property value.
      Property description:
      Specifies the spinner's value.
    • valueProperty

      ObjectProperty<T> valueProperty()
      Specifies the spinner's value.
      See Also:
    • setValue

      void setValue(T value)
      Sets the value of the property value.
      Property description:
      Specifies the spinner's value.
    • getConverter

      StringConverter<T> getConverter()
      Gets the value of the property converter.
      Property description:
      Specifies the StringConverter used to convert the spinner value to a String.
    • converterProperty

      ObjectProperty<StringConverter<T>> converterProperty()
      Specifies the StringConverter used to convert the spinner value to a String.
      See Also:
    • setConverter

      void setConverter(StringConverter<T> converter)
      Sets the value of the property converter.
      Property description:
      Specifies the StringConverter used to convert the spinner value to a String.
    • isWrapAround

      boolean isWrapAround()
      Returns:
      whether the spinner can cycle through the values when reaching the last/first value
    • setWrapAround

      void setWrapAround(boolean wrapAround)
      Sets whether the spinner can cycle through the values when reaching the last/first value