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 thedefaultValueproperty.getValue()Gets the value of thevalueproperty.booleanvoidreset()Sets the spinner's value to the value specified bydefaultValueProperty().voidsetDefaultValue(T defaultValue) Sets the value of thedefaultValueproperty.voidSets the value of thevalueproperty.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).
-
-
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 thevalueproperty.- Specified by:
getValuein interfaceSpinnerModel<T>- Property description:
- Returns:
- the value of the
valueproperty - See Also:
-
valueProperty
Description copied from interface:SpinnerModelSpecifies the spinner's value.- Specified by:
valuePropertyin interfaceSpinnerModel<T>- Returns:
- the
valueproperty - See Also:
-
setValue
Sets the value of thevalueproperty.- Specified by:
setValuein interfaceSpinnerModel<T>- Property description:
- Parameters:
value- the value for thevalueproperty- See Also:
-
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 thedefaultValueproperty.- 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). - Returns:
- the value of the
defaultValueproperty - See Also:
-
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).- Returns:
- the
defaultValueproperty - See Also:
-
setDefaultValue
Sets the value of thedefaultValueproperty.- 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). - Parameters:
defaultValue- the value for thedefaultValueproperty- See Also:
-