|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.swing.AbstractSpinnerModel javax.swing.SpinnerNumberModel uic.model.UICSpinnerNumberModel
Extends SpinnerNumberModel to make sure stepsize is used to check if the value that is set is allowed
SpinnerNumberModel model = new SpinnerNumberModel(0, 0, 10, 2);
model.setValue(0); // will result in 0 in the ui
model.setValue(2); // will result in 2 in the ui
model.setValue(1); // will result in 2 in the ui
SpinnerNumberModel model = new SpinnerNumberModel(1, 1, 10, 2);
model.setValue(1); // will result in 1 in the ui
model.setValue(3); // will result in 3 in the ui
model.setValue(2); // will result in 3 in the ui
Field Summary |
Fields inherited from class javax.swing.AbstractSpinnerModel |
listenerList |
Constructor Summary | |
UICSpinnerNumberModel()
Constructs a SpinnerNumberModel with no minimum or maximum value, stepSize equal to one, and an initial value of zero. |
|
UICSpinnerNumberModel(double value,
double minimum,
double maximum,
double stepSize)
Constructs a SpinnerNumberModel with the specified value, minimum/maximum bounds, and stepSize. |
|
UICSpinnerNumberModel(int value,
int minimum,
int maximum,
int stepSize)
Constructs a SpinnerNumberModel with the specified value, minimum/maximum bounds, and stepSize. |
|
UICSpinnerNumberModel(Number value,
Comparable minimum,
Comparable maximum,
Number stepSize)
Constructs a SpinnerModel that represents a closed sequence of numbers from minimum to maximum. |
Method Summary | |
void |
setValue(Object value)
Override setValue to obey getStepSize
SpinnerNumberModel model = new SpinnerNumberModel(0, 0, 10, 2);
model.setValue(0); // will result in 0 in the ui
model.setValue(2); // will result in 2 in the ui
model.setValue(1); // will result in 2 in the ui
SpinnerNumberModel model = new SpinnerNumberModel(1, 1, 10, 2);
model.setValue(1); // will result in 1 in the ui
model.setValue(3); // will result in 3 in the ui
model.setValue(2); // will result in 3 in the ui
|
Methods inherited from class javax.swing.SpinnerNumberModel |
getMaximum, getMinimum, getNextValue, getNumber, getPreviousValue, getStepSize, getValue, setMaximum, setMinimum, setStepSize |
Methods inherited from class javax.swing.AbstractSpinnerModel |
addChangeListener, fireStateChanged, getChangeListeners, getListeners, removeChangeListener |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public UICSpinnerNumberModel()
public UICSpinnerNumberModel(double value, double minimum, double maximum, double stepSize)
public UICSpinnerNumberModel(int value, int minimum, int maximum, int stepSize)
public UICSpinnerNumberModel(Number value, Comparable minimum, Comparable maximum, Number stepSize)
Method Detail |
public void setValue(Object value)
getStepSize
SpinnerNumberModel model = new SpinnerNumberModel(0, 0, 10, 2);
model.setValue(0); // will result in 0 in the ui
model.setValue(2); // will result in 2 in the ui
model.setValue(1); // will result in 2 in the ui
SpinnerNumberModel model = new SpinnerNumberModel(1, 1, 10, 2);
model.setValue(1); // will result in 1 in the ui
model.setValue(3); // will result in 3 in the ui
model.setValue(2); // will result in 3 in the ui
value
- the value to be set to the model
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |