Class SpinnerValueFactory<T>
java.lang.Object
javafx.scene.control.SpinnerValueFactory<T>
- Type Parameters:
- T- The type of the data this value factory deals with, which must coincide with the type of the Spinner that the value factory is set on.
- Direct Known Subclasses:
- SpinnerValueFactory.DoubleSpinnerValueFactory,- SpinnerValueFactory.IntegerSpinnerValueFactory,- SpinnerValueFactory.ListSpinnerValueFactory
The SpinnerValueFactory is the model behind the JavaFX
 
Spinner control - without a value factory installed a
 Spinner is unusable. It is the role of the value factory to handle almost all
 aspects of the Spinner, including:
 - Representing the current state of the value,
- Incrementingand- decrementingthe value, with one or more steps per call,
- Convertingtext input from the user (via the Spinner- editor,
- Converting objects to user-readable stringsfor display on screen
SpinnerValueFactory classes for some common types are provided with JavaFX, including:
- Since:
- JavaFX 8u40
- See Also:
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classASpinnerValueFactoryimplementation designed to iterate through double values.static classASpinnerValueFactoryimplementation designed to iterate through integer values.static classASpinnerValueFactoryimplementation designed to iterate through a list of values.
- 
Property SummaryPropertiesTypePropertyDescriptionfinal ObjectProperty<StringConverter<T>> final ObjectProperty<T> Represents the current value of the SpinnerValueFactory, or null if no value has been set.final BooleanPropertySpecifies whether thisSpinnerValueFactorywraps around from the maximum value to the minimum value, and vice versa.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionfinal ObjectProperty<StringConverter<T>> abstract voiddecrement(int steps) Attempts to decrement thevalueby the given number of steps.final StringConverter<T> Gets the value of theconverterproperty.final TgetValue()Gets the value of thevalueproperty.abstract voidincrement(int steps) Attempts to increment thevalueby the given number of steps.final booleanGets the value of thewrapAroundproperty.final voidsetConverter(StringConverter<T> newValue) Sets the value of theconverterproperty.final voidSets the value of thevalueproperty.final voidsetWrapAround(boolean value) Sets the value of thewrapAroundproperty.final ObjectProperty<T> Represents the current value of the SpinnerValueFactory, or null if no value has been set.final BooleanPropertySpecifies whether thisSpinnerValueFactorywraps around from the maximum value to the minimum value, and vice versa.
- 
Property Details- 
valueRepresents the current value of the SpinnerValueFactory, or null if no value has been set.- See Also:
 
- 
converter
- 
wrapAroundSpecifies whether thisSpinnerValueFactorywraps around from the maximum value to the minimum value, and vice versa. The semantics of the wrap-around behavior are specified by implementations of this class.- See Also:
 
 
- 
- 
Constructor Details- 
SpinnerValueFactorypublic SpinnerValueFactory()Creates a default SpinnerValueFactory.
 
- 
- 
Method Details- 
decrementpublic abstract void decrement(int steps) Attempts to decrement thevalueby the given number of steps.- Parameters:
- steps- The number of decrements that should be performed on the value. If the number is negative, the call is equivalent to calling- increment(int)with the absolute value of- steps.
 
- 
incrementpublic abstract void increment(int steps) Attempts to increment thevalueby the given number of steps.- Parameters:
- steps- The number of increments that should be performed on the value. If the number is negative, the call is equivalent to calling- decrement(int)with the absolute number of- steps.
 
- 
getValueGets the value of thevalueproperty.- Property description:
- Represents the current value of the SpinnerValueFactory, or null if no value has been set.
- Returns:
- the value of the valueproperty
- See Also:
 
- 
setValueSets the value of thevalueproperty.- Property description:
- Represents the current value of the SpinnerValueFactory, or null if no value has been set.
- Parameters:
- newValue- the value for the- valueproperty
- See Also:
 
- 
valuePropertyRepresents the current value of the SpinnerValueFactory, or null if no value has been set.- Returns:
- the valueproperty
- See Also:
 
- 
getConverterGets the value of theconverterproperty.
- 
setConverterSets the value of theconverterproperty.
- 
converterProperty
- 
setWrapAroundpublic final void setWrapAround(boolean value) Sets the value of thewrapAroundproperty.- Property description:
- Specifies whether this SpinnerValueFactorywraps around from the maximum value to the minimum value, and vice versa. The semantics of the wrap-around behavior are specified by implementations of this class.
- Parameters:
- value- the value for the- wrapAroundproperty
- See Also:
 
- 
isWrapAroundpublic final boolean isWrapAround()Gets the value of thewrapAroundproperty.- Property description:
- Specifies whether this SpinnerValueFactorywraps around from the maximum value to the minimum value, and vice versa. The semantics of the wrap-around behavior are specified by implementations of this class.
- Returns:
- the value of the wrapAroundproperty
- See Also:
 
- 
wrapAroundPropertySpecifies whether thisSpinnerValueFactorywraps around from the maximum value to the minimum value, and vice versa. The semantics of the wrap-around behavior are specified by implementations of this class.- Returns:
- the wrapAroundproperty
- See Also:
 
 
-