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 Summary
PropertiesTypePropertyDescriptionSpecifies theStringConverterused to convert the spinner value to a String.Specifies the spinner's value. -
Method Summary
Modifier and TypeMethodDescriptionSpecifies theStringConverterused to convert the spinner value to a String.Gets the value of the property converter.getValue()Gets the value of the property value.booleanvoidnext()Steps to the next value.voidprevious()Steps to the previous value.voidreset()Resets the spinner's value.voidsetConverter(StringConverter<T> converter) Sets the value of the property converter.voidSets the value of the property value.voidsetWrapAround(boolean wrapAround) Sets whether the spinner can cycle through the values when reaching the last/first valueSpecifies the spinner's value.
-
Property Details
-
value
ObjectProperty<T> valuePropertySpecifies the spinner's value.- See Also:
-
converter
ObjectProperty<StringConverter<T>> converterPropertySpecifies theStringConverterused to convert the spinner value to a String.- See Also:
-
-
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
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
StringConverterused to convert the spinner value to a String.
-
converterProperty
ObjectProperty<StringConverter<T>> converterProperty()Specifies theStringConverterused to convert the spinner value to a String.- See Also:
-
setConverter
Sets the value of the property converter.- Property description:
- Specifies the
StringConverterused 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
-