static class SpinnerValueFactory.LocalTimeSpinnerValueFactory extends SpinnerValueFactory<java.time.LocalTime>
SpinnerValueFactory
implementation designed to iterate through
LocalTime
values.
Note that the default converter
is implemented
simply as shown below, which may be adequate in many cases, but it is important
for users to ensure that this suits their needs (and adjust when necessary):
setConverter(new StringConverter<LocalTime>() { @Override public String toString(LocalTime object) { if (object == null) { return ""; } return object.toString(); } @Override public LocalTime fromString(String string) { return LocalTime.parse(string); } });
Type | Property and Description |
---|---|
LongProperty |
amountToStepBy
Sets the amount to increment or decrement by, per step.
|
<any> |
max
Sets the maximum allowable value for this value factory
|
<any> |
min
Sets the minimum allowable value for this value factory
|
<any> |
temporalUnit
The size of each step (e.g.
|
converterProperty, valueProperty, wrapAroundProperty
SpinnerValueFactory.DoubleSpinnerValueFactory, SpinnerValueFactory.IntegerSpinnerValueFactory, SpinnerValueFactory.ListSpinnerValueFactory<T>, SpinnerValueFactory.LocalDateSpinnerValueFactory, SpinnerValueFactory.LocalTimeSpinnerValueFactory
Modifier and Type | Field and Description |
---|---|
private LongProperty |
amountToStepBy |
private <any> |
max |
private <any> |
min
*
Properties *
*
|
private <any> |
temporalUnit |
Constructor and Description |
---|
LocalTimeSpinnerValueFactory()
Creates a new instance of the LocalTimepinnerValueFactory, using the
value returned by calling
LocalTime#now() as the initial value,
and using a stepping amount of one day. |
LocalTimeSpinnerValueFactory(java.time.LocalTime initialValue)
Creates a new instance of the LocalTimeSpinnerValueFactory, using the
provided initial value, and a stepping amount of one hour.
|
LocalTimeSpinnerValueFactory(java.time.LocalTime min,
java.time.LocalTime max,
java.time.LocalTime initialValue)
Creates a new instance of the LocalTimeSpinnerValueFactory, using the
provided initial value, and a stepping amount of one hour.
|
LocalTimeSpinnerValueFactory(java.time.LocalTime min,
java.time.LocalTime max,
java.time.LocalTime initialValue,
long amountToStepBy,
java.time.temporal.TemporalUnit temporalUnit)
Creates a new instance of the LocalTimeSpinnerValueFactory, using the
provided min, max, and initial values, as well as the amount to step
by and
TemporalUnit . |
Modifier and Type | Method and Description |
---|---|
LongProperty |
amountToStepByProperty()
Sets the amount to increment or decrement by, per step.
|
void |
decrement(int steps)
Attempts to decrement the
value by the given
number of steps. |
long |
getAmountToStepBy()
Gets the value of the property amountToStepBy.
|
java.time.LocalTime |
getMax()
Gets the value of the property max.
|
java.time.LocalTime |
getMin()
Gets the value of the property min.
|
java.time.temporal.TemporalUnit |
getTemporalUnit()
Gets the value of the property temporalUnit.
|
void |
increment(int steps)
Attempts to omcrement the
value by the given
number of steps. |
<any> |
maxProperty()
Sets the maximum allowable value for this value factory
|
<any> |
minProperty()
Sets the minimum allowable value for this value factory
|
void |
setAmountToStepBy(long value)
Sets the value of the property amountToStepBy.
|
void |
setMax(java.time.LocalTime value)
Sets the value of the property max.
|
void |
setMin(java.time.LocalTime value)
Sets the value of the property min.
|
void |
setTemporalUnit(java.time.temporal.TemporalUnit value)
Sets the value of the property temporalUnit.
|
<any> |
temporalUnitProperty()
The size of each step (e.g.
|
converterProperty, getConverter, getValue, isWrapAround, setConverter, setValue, setWrapAround, valueProperty, wrapAroundProperty
public final <any> minProperty
public final <any> maxProperty
getMax()
,
setMax(LocalTime)
public final <any> temporalUnitProperty
getTemporalUnit()
,
setTemporalUnit(TemporalUnit)
public final LongProperty amountToStepByProperty
getAmountToStepBy()
,
setAmountToStepBy(long)
private <any> min
private <any> max
private <any> temporalUnit
private LongProperty amountToStepBy
public LocalTimeSpinnerValueFactory()
LocalTime#now()
as the initial value,
and using a stepping amount of one day.public LocalTimeSpinnerValueFactory(java.time.LocalTime initialValue)
initialValue
- The value of the Spinner when first instantiated.public LocalTimeSpinnerValueFactory(java.time.LocalTime min, java.time.LocalTime max, java.time.LocalTime initialValue)
min
- The minimum allowed double value for the Spinner.max
- The maximum allowed double value for the Spinner.initialValue
- The value of the Spinner when first instantiated.public LocalTimeSpinnerValueFactory(java.time.LocalTime min, java.time.LocalTime max, java.time.LocalTime initialValue, long amountToStepBy, java.time.temporal.TemporalUnit temporalUnit)
TemporalUnit
.
To better understand, here are a few examples:
new LocalTimeSpinnerValueFactory(LocalTime.MIN, LocalTime.MAX, LocalTime.now(), 1, ChronoUnit.HOURS)
new LocalTimeSpinnerValueFactory(LocalTime.MIN, LocalTime.MAX, LocalTime.now(), 1, ChronoUnit.MINUTES)
min
- The minimum allowed double value for the Spinner.max
- The maximum allowed double value for the Spinner.initialValue
- The value of the Spinner when first instantiated.amountToStepBy
- The amount to increment or decrement by, per step.temporalUnit
- The size of each step (e.g. day, week, month, year, etc)public final void setMin(java.time.LocalTime value)
public final java.time.LocalTime getMin()
public final <any> minProperty()
public final void setMax(java.time.LocalTime value)
public final java.time.LocalTime getMax()
public final <any> maxProperty()
getMax()
,
setMax(LocalTime)
public final void setTemporalUnit(java.time.temporal.TemporalUnit value)
public final java.time.temporal.TemporalUnit getTemporalUnit()
public final <any> temporalUnitProperty()
getTemporalUnit()
,
setTemporalUnit(TemporalUnit)
public final void setAmountToStepBy(long value)
public final long getAmountToStepBy()
public final LongProperty amountToStepByProperty()
getAmountToStepBy()
,
setAmountToStepBy(long)
public void decrement(int steps)
value
by the given
number of steps.decrement
in class SpinnerValueFactory<java.time.LocalTime>
steps
- The number of decrements that should be performed on the value.public void increment(int steps)
value
by the given
number of steps.increment
in class SpinnerValueFactory<java.time.LocalTime>
steps
- The number of increments that should be performed on the value.