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 java.lang.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:
value
,Incrementing
and decrementing
the
value, with one or more steps per call,Converting
text input
from the user (via the Spinner editor
,objects to user-readable strings
for display on screenSpinnerValueFactory classes for some common types are provided with JavaFX, including:
Modifier and Type | Class and Description |
---|---|
static class |
SpinnerValueFactory.DoubleSpinnerValueFactory
A
SpinnerValueFactory implementation designed to iterate through
double values. |
static class |
SpinnerValueFactory.IntegerSpinnerValueFactory
A
SpinnerValueFactory implementation designed to iterate through
integer values. |
static class |
SpinnerValueFactory.ListSpinnerValueFactory<T>
A
SpinnerValueFactory implementation designed to iterate through
a list of values. |
(package private) static class |
SpinnerValueFactory.LocalDateSpinnerValueFactory
A
SpinnerValueFactory implementation designed to iterate through
LocalDate values. |
(package private) static class |
SpinnerValueFactory.LocalTimeSpinnerValueFactory
A
SpinnerValueFactory implementation designed to iterate through
LocalTime values. |
Modifier and Type | Field and Description |
---|---|
private ObjectProperty<StringConverter<T>> |
converter
|
private ObjectProperty<T> |
value
Represents the current value of the SpinnerValueFactory, or null if no
value has been set.
|
private BooleanProperty |
wrapAround
The wrapAround property is used to specify whether the value factory should
be circular.
|
Constructor and Description |
---|
SpinnerValueFactory() |
Modifier and Type | Method and Description |
---|---|
ObjectProperty<StringConverter<T>> |
converterProperty() |
abstract void |
decrement(int steps)
Attempts to decrement the
value by the given
number of steps. |
StringConverter<T> |
getConverter() |
T |
getValue() |
abstract void |
increment(int steps)
Attempts to omcrement the
value by the given
number of steps. |
boolean |
isWrapAround() |
void |
setConverter(StringConverter<T> newValue) |
void |
setValue(T newValue) |
void |
setWrapAround(boolean value) |
ObjectProperty<T> |
valueProperty() |
BooleanProperty |
wrapAroundProperty() |
private ObjectProperty<T> value
private ObjectProperty<StringConverter<T>> converter
private BooleanProperty wrapAround
public abstract void decrement(int steps)
value
by the given
number of steps.steps
- The number of decrements that should be performed on the value.public abstract void increment(int steps)
value
by the given
number of steps.steps
- The number of increments that should be performed on the value.public final T getValue()
public final void setValue(T newValue)
public final ObjectProperty<T> valueProperty()
public final StringConverter<T> getConverter()
public final void setConverter(StringConverter<T> newValue)
public final ObjectProperty<StringConverter<T>> converterProperty()
public final void setWrapAround(boolean value)
public final boolean isWrapAround()
public final BooleanProperty wrapAroundProperty()