Class SpinnerValueFactory<T>
- 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.
public abstract class SpinnerValueFactory<T> extends Object
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, -
Incrementinganddecrementingthe value, with one or more steps per call, -
Convertingtext input from the user (via the Spinnereditor, - Converting
objects to user-readable stringsfor display on screen
SpinnerValueFactory classes for some common types are provided with JavaFX, including:
SpinnerValueFactory.IntegerSpinnerValueFactorySpinnerValueFactory.DoubleSpinnerValueFactorySpinnerValueFactory.ListSpinnerValueFactorySpinnerValueFactory.LocalDateSpinnerValueFactory
Since:
JavaFX 8u40
See Also:
Spinner, SpinnerValueFactory.IntegerSpinnerValueFactory, SpinnerValueFactory.DoubleSpinnerValueFactory, SpinnerValueFactory.ListSpinnerValueFactory, SpinnerValueFactory.LocalDateSpinnerValueFactory
-
Property Summary
All MethodsInstance MethodsConcrete Methods Type Property and Description ObjectProperty<StringConverter<T>>converterObjectProperty<T>valueRepresents the current value of the SpinnerValueFactory, or null if no value has been set.BooleanPropertywrapAroundThe wrapAround property is used to specify whether the value factory should be circular.
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static classSpinnerValueFactory.DoubleSpinnerValueFactoryASpinnerValueFactoryimplementation designed to iterate through double values.static classSpinnerValueFactory.IntegerSpinnerValueFactoryASpinnerValueFactoryimplementation designed to iterate through integer values.static classSpinnerValueFactory.ListSpinnerValueFactory<T>ASpinnerValueFactoryimplementation designed to iterate through a list of values.
-
Constructor Summary
Constructors Constructor and Description SpinnerValueFactory()
-
Method Summary
All MethodsInstance MethodsAbstract MethodsConcrete Methods Modifier and Type Method and Description ObjectProperty<StringConverter<T>>converterProperty()abstract voiddecrement(int steps)Attempts to decrement thevalueby the given number of steps.StringConverter<T>getConverter()Gets the value of the property converter.TgetValue()Gets the value of the property value.abstract voidincrement(int steps)Attempts to omcrement thevalueby the given number of steps.booleanisWrapAround()Gets the value of the property wrapAround.voidsetConverter(StringConverter<T> newValue)Sets the value of the property converter.voidsetValue(T newValue)Sets the value of the property value.voidsetWrapAround(boolean value)Sets the value of the property wrapAround.ObjectProperty<T>valueProperty()Represents the current value of the SpinnerValueFactory, or null if no value has been set.BooleanPropertywrapAroundProperty()The wrapAround property is used to specify whether the value factory should be circular.
-
Property Detail
-
value
public final ObjectProperty<T> valueProperty
Represents the current value of the SpinnerValueFactory, or null if no value has been set.See Also:
-
converter
public final ObjectProperty<StringConverter<T>> converterProperty
Converts the user-typed input (when the Spinner iseditable) to an object of type T, such that the input may be retrieved via thevalueproperty.See Also:
-
wrapAround
public final BooleanProperty wrapAroundProperty
The wrapAround property is used to specify whether the value factory should be circular. For example, should an integer-based value model increment from the maximum value back to the minimum value (and vice versa).See Also:
-
-
Constructor Detail
-
SpinnerValueFactory
public SpinnerValueFactory()
-
-
Method Detail
-
decrement
public 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.
-
increment
public abstract void increment(int steps)
Attempts to omcrement thevalueby the given number of steps.Parameters:
steps- The number of increments that should be performed on the value.
-
getValue
public final T getValue()
Gets the value of the property value.Property description:
Represents the current value of the SpinnerValueFactory, or null if no value has been set.
-
setValue
public final void setValue(T newValue)
Sets the value of the property value.Property description:
Represents the current value of the SpinnerValueFactory, or null if no value has been set.
-
valueProperty
public final ObjectProperty<T> valueProperty()
Represents the current value of the SpinnerValueFactory, or null if no value has been set.See Also:
-
getConverter
public final StringConverter<T> getConverter()
Gets the value of the property converter.
-
setConverter
public final void setConverter(StringConverter<T> newValue)
Sets the value of the property converter.
-
converterProperty
public final ObjectProperty<StringConverter<T>> converterProperty()
Converts the user-typed input (when the Spinner iseditable) to an object of type T, such that the input may be retrieved via thevalueproperty.See Also:
-
setWrapAround
public final void setWrapAround(boolean value)
Sets the value of the property wrapAround.Property description:
The wrapAround property is used to specify whether the value factory should be circular. For example, should an integer-based value model increment from the maximum value back to the minimum value (and vice versa).
-
isWrapAround
public final boolean isWrapAround()
Gets the value of the property wrapAround.Property description:
The wrapAround property is used to specify whether the value factory should be circular. For example, should an integer-based value model increment from the maximum value back to the minimum value (and vice versa).
-
wrapAroundProperty
public final BooleanProperty wrapAroundProperty()
The wrapAround property is used to specify whether the value factory should be circular. For example, should an integer-based value model increment from the maximum value back to the minimum value (and vice versa).See Also:
-
© 2008, 2025, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from JavaFX API Documentation.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Java, JavaFX and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.