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:
Type | Property and Description |
---|---|
<any> |
converter
|
<any> |
value
Represents the current value of the SpinnerValueFactory, or null if no
value has been set.
|
BooleanProperty |
wrapAround
The wrapAround property is used to specify whether the value factory should
be circular.
|
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 <any> |
converter
|
private <any> |
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 |
---|---|
<any> |
converterProperty()
|
abstract void |
decrement(int steps)
Attempts to decrement the
value by the given
number of steps. |
<any> |
getConverter()
Gets the value of the property converter.
|
T |
getValue()
Gets the value of the property value.
|
abstract void |
increment(int steps)
Attempts to omcrement the
value by the given
number of steps. |
boolean |
isWrapAround()
Gets the value of the property wrapAround.
|
void |
setConverter(<any> newValue)
Sets the value of the property converter.
|
void |
setValue(T newValue)
Sets the value of the property value.
|
void |
setWrapAround(boolean value)
Sets the value of the property wrapAround.
|
<any> |
valueProperty()
Represents the current value of the SpinnerValueFactory, or null if no
value has been set.
|
BooleanProperty |
wrapAroundProperty()
The wrapAround property is used to specify whether the value factory should
be circular.
|
public final <any> valueProperty
getValue()
,
setValue(T)
public final <any> converterProperty
editable
) to an object of type T,
such that the input may be retrieved via the value
property.getConverter()
,
#setConverter()
public final BooleanProperty wrapAroundProperty
isWrapAround()
,
setWrapAround(boolean)
private <any> value
private <any> 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 <any> valueProperty()
getValue()
,
setValue(T)
public final <any> getConverter()
public final void setConverter(<any> newValue)
public final <any> converterProperty()
editable
) to an object of type T,
such that the input may be retrieved via the value
property.getConverter()
,
#setConverter()
public final void setWrapAround(boolean value)
public final boolean isWrapAround()
public final BooleanProperty wrapAroundProperty()
isWrapAround()
,
setWrapAround(boolean)