Class SpinnerValueFactory.IntegerSpinnerValueFactory
java.lang.Object
javafx.scene.control.SpinnerValueFactory<Integer>
javafx.scene.control.SpinnerValueFactory.IntegerSpinnerValueFactory
- Enclosing class:
- SpinnerValueFactory<T>
public static class SpinnerValueFactory.IntegerSpinnerValueFactory
extends SpinnerValueFactory<Integer>
A 
SpinnerValueFactory implementation designed to iterate through
 integer values.
 
 If wrapAround is true, the
 IntegerSpinnerValueFactory will step from the minimum value to the maximum value (and vice versa).
 As a consequence of that, the number of steps required to wrap around to the same value is N+1, where
 N is the number of steps between min (inclusive) and max
 (inclusive). The new value after a step is val = (val + amountToStepBy) % (max - min + 1).
 
 Note that the default converter is implemented
 as an IntegerStringConverter instance.
- Since:
- JavaFX 8u40
- 
Nested Class SummaryNested classes/interfaces declared in class javafx.scene.control.SpinnerValueFactorySpinnerValueFactory.DoubleSpinnerValueFactory, SpinnerValueFactory.IntegerSpinnerValueFactory, SpinnerValueFactory.ListSpinnerValueFactory<T>
- 
Property SummaryPropertiesTypePropertyDescriptionfinal IntegerPropertySets the amount to increment or decrement by, per step.final IntegerPropertySets the maximum allowable value for this value factoryfinal IntegerPropertySets the minimum allowable value for this value factoryProperties declared in class javafx.scene.control.SpinnerValueFactoryconverter, value, wrapAround
- 
Constructor SummaryConstructorsConstructorDescriptionIntegerSpinnerValueFactory(int min, int max) Constructs a new IntegerSpinnerValueFactory that sets the initial value to be equal to the min value, and a defaultamountToStepByof one.IntegerSpinnerValueFactory(int min, int max, int initialValue) Constructs a new IntegerSpinnerValueFactory with a defaultamountToStepByof one.IntegerSpinnerValueFactory(int min, int max, int initialValue, int amountToStepBy) Constructs a new IntegerSpinnerValueFactory.
- 
Method SummaryModifier and TypeMethodDescriptionfinal IntegerPropertySets the amount to increment or decrement by, per step.voiddecrement(int steps) Attempts to decrement thevalueby the given number of steps.final intGets the value of theamountToStepByproperty.final intgetMax()Gets the value of themaxproperty.final intgetMin()Gets the value of theminproperty.voidincrement(int steps) Attempts to increment thevalueby the given number of steps.final IntegerPropertySets the maximum allowable value for this value factoryfinal IntegerPropertySets the minimum allowable value for this value factoryfinal voidsetAmountToStepBy(int value) Sets the value of theamountToStepByproperty.final voidsetMax(int value) Sets the value of themaxproperty.final voidsetMin(int value) Sets the value of theminproperty.Methods declared in class javafx.scene.control.SpinnerValueFactoryconverterProperty, getConverter, getValue, isWrapAround, setConverter, setValue, setWrapAround, valueProperty, wrapAroundProperty
- 
Property Details- 
minSets the minimum allowable value for this value factory- See Also:
 
- 
maxSets the maximum allowable value for this value factory- See Also:
 
- 
amountToStepBySets the amount to increment or decrement by, per step.- See Also:
 
 
- 
- 
Constructor Details- 
IntegerSpinnerValueFactorypublic IntegerSpinnerValueFactory(int min, int max) Constructs a new IntegerSpinnerValueFactory that sets the initial value to be equal to the min value, and a defaultamountToStepByof one.- Parameters:
- min- The minimum allowed integer value for the Spinner.
- max- The maximum allowed integer value for the Spinner.
 
- 
IntegerSpinnerValueFactorypublic IntegerSpinnerValueFactory(int min, int max, int initialValue) Constructs a new IntegerSpinnerValueFactory with a defaultamountToStepByof one.- Parameters:
- min- The minimum allowed integer value for the Spinner.
- max- The maximum allowed integer value for the Spinner.
- initialValue- The value of the Spinner when first instantiated, must be within the bounds of the min and max arguments, or else the min value will be used.
 
- 
IntegerSpinnerValueFactorypublic IntegerSpinnerValueFactory(int min, int max, int initialValue, int amountToStepBy) Constructs a new IntegerSpinnerValueFactory.- Parameters:
- min- The minimum allowed integer value for the Spinner.
- max- The maximum allowed integer value for the Spinner.
- initialValue- The value of the Spinner when first instantiated, must be within the bounds of the min and max arguments, or else the min value will be used.
- amountToStepBy- The amount to increment or decrement by, per step.
 
 
- 
- 
Method Details- 
setMinpublic final void setMin(int value) Sets the value of theminproperty.- Property description:
- Sets the minimum allowable value for this value factory
- Parameters:
- value- the value for the- minproperty
- See Also:
 
- 
getMinpublic final int getMin()Gets the value of theminproperty.- Property description:
- Sets the minimum allowable value for this value factory
- Returns:
- the value of the minproperty
- See Also:
 
- 
minPropertySets the minimum allowable value for this value factory- Returns:
- the minimum allowable value for this value factory
- See Also:
 
- 
setMaxpublic final void setMax(int value) Sets the value of themaxproperty.- Property description:
- Sets the maximum allowable value for this value factory
- Parameters:
- value- the value for the- maxproperty
- See Also:
 
- 
getMaxpublic final int getMax()Gets the value of themaxproperty.- Property description:
- Sets the maximum allowable value for this value factory
- Returns:
- the value of the maxproperty
- See Also:
 
- 
maxPropertySets the maximum allowable value for this value factory- Returns:
- the maximum allowable value for this value factory
- See Also:
 
- 
setAmountToStepBypublic final void setAmountToStepBy(int value) Sets the value of theamountToStepByproperty.- Property description:
- Sets the amount to increment or decrement by, per step.
- Parameters:
- value- the value for the- amountToStepByproperty
- See Also:
 
- 
getAmountToStepBypublic final int getAmountToStepBy()Gets the value of theamountToStepByproperty.- Property description:
- Sets the amount to increment or decrement by, per step.
- Returns:
- the value of the amountToStepByproperty
- See Also:
 
- 
amountToStepByPropertySets the amount to increment or decrement by, per step.- Returns:
- the amount to increment or decrement by, per step
- See Also:
 
- 
decrementpublic void decrement(int steps) Attempts to decrement thevalueby the given number of steps.- Specified by:
- decrementin class- SpinnerValueFactory<Integer>
- Parameters:
- steps- The number of decrements that should be performed on the value. If the number is negative, the call is equivalent to calling- SpinnerValueFactory.increment(int)with the absolute value of- steps.
 
- 
incrementpublic void increment(int steps) Attempts to increment thevalueby the given number of steps.- Specified by:
- incrementin class- SpinnerValueFactory<Integer>
- Parameters:
- steps- The number of increments that should be performed on the value. If the number is negative, the call is equivalent to calling- SpinnerValueFactory.decrement(int)with the absolute number of- steps.
 
 
-