Module MaterialFX
Class AbstractSpinnerModel<T>
java.lang.Object
io.github.palexdev.materialfx.controls.models.spinner.AbstractSpinnerModel<T>
- All Implemented Interfaces:
SpinnerModel<T>
- Direct Known Subclasses:
ListSpinnerModel,LocalDateSpinnerModel,NumberSpinnerModel
Base implementation for
SpinnerModel.
This is still not enough to use with a spinner but it's a good base to implement
new models.
Defines all the specification from the SpinnerModel interface and adds a
new property, defaultValueProperty(), which is the spinner's value when calling reset().
-
Property Summary
PropertiesTypePropertyDescriptionSpecifies the default value of the spinner.Specifies the spinner's value.Properties inherited from interface io.github.palexdev.materialfx.controls.models.spinner.SpinnerModel
converter -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ObjectProperty<T>protected final ObjectProperty<T>protected boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSpecifies the default value of the spinner.Gets the value of the property defaultValue.getValue()Gets the value of the property value.booleanvoidreset()Sets the spinner's value to the value specified bydefaultValueProperty().voidsetDefaultValue(T defaultValue) Sets the value of the property defaultValue.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.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.github.palexdev.materialfx.controls.models.spinner.SpinnerModel
converterProperty, getConverter, next, previous, setConverter
-
Property Details
-
value
- Specified by:
valuePropertyin interfaceSpinnerModel<T>- See Also:
-
defaultValue
Specifies the default value of the spinner. Note that this may not be the spinner's initial value, and usually this is used when calling thereset()method (depends on the implementation).- See Also:
-
-
Field Details
-
value
-
defaultValue
-
wrapAround
protected boolean wrapAround
-
-
Constructor Details
-
AbstractSpinnerModel
public AbstractSpinnerModel()
-
-
Method Details
-
reset
public void reset()Sets the spinner's value to the value specified bydefaultValueProperty().- Specified by:
resetin interfaceSpinnerModel<T>
-
getValue
Gets the value of the property value.- Specified by:
getValuein interfaceSpinnerModel<T>- Property description:
-
valueProperty
Description copied from interface:SpinnerModelSpecifies the spinner's value.- Specified by:
valuePropertyin interfaceSpinnerModel<T>- See Also:
-
setValue
Sets the value of the property value.- Specified by:
setValuein interfaceSpinnerModel<T>- Property description:
-
isWrapAround
public boolean isWrapAround()- Specified by:
isWrapAroundin interfaceSpinnerModel<T>- Returns:
- whether the spinner can cycle through the values when reaching the last/first value
-
setWrapAround
public void setWrapAround(boolean wrapAround) Description copied from interface:SpinnerModelSets whether the spinner can cycle through the values when reaching the last/first value- Specified by:
setWrapAroundin interfaceSpinnerModel<T>
-
getDefaultValue
Gets the value of the property defaultValue.- Property description:
- Specifies the default value of the spinner.
Note that this may not be the spinner's initial value, and usually this
is used when calling the
reset()method (depends on the implementation).
-
defaultValueProperty
Specifies the default value of the spinner. Note that this may not be the spinner's initial value, and usually this is used when calling thereset()method (depends on the implementation).- See Also:
-
setDefaultValue
Sets the value of the property defaultValue.- Property description:
- Specifies the default value of the spinner.
Note that this may not be the spinner's initial value, and usually this
is used when calling the
reset()method (depends on the implementation).
-