uic.model
Class UICSpinnerNumberModel

java.lang.Object
  extended by javax.swing.AbstractSpinnerModel
      extended by javax.swing.SpinnerNumberModel
          extended by uic.model.UICSpinnerNumberModel
All Implemented Interfaces:
Serializable, SpinnerModel

Deprecated. use SpinboxModel with the UICSpinbox instead

public class UICSpinnerNumberModel
extends SpinnerNumberModel

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
 

Since:
1.2
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.AbstractSpinnerModel
listenerList
 
Constructor Summary
UICSpinnerNumberModel()
          Deprecated. 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)
          Deprecated. Constructs a SpinnerNumberModel with the specified value, minimum/maximum bounds, and stepSize.
UICSpinnerNumberModel(int value, int minimum, int maximum, int stepSize)
          Deprecated. Constructs a SpinnerNumberModel with the specified value, minimum/maximum bounds, and stepSize.
UICSpinnerNumberModel(Number value, Comparable minimum, Comparable maximum, Number stepSize)
          Deprecated. Constructs a SpinnerModel that represents a closed sequence of numbers from minimum to maximum.
 
Method Summary
 void setValue(Object value)
          Deprecated. 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

UICSpinnerNumberModel

public UICSpinnerNumberModel()
Deprecated. 
Constructs a SpinnerNumberModel with no minimum or maximum value, stepSize equal to one, and an initial value of zero.


UICSpinnerNumberModel

public UICSpinnerNumberModel(double value,
                             double minimum,
                             double maximum,
                             double stepSize)
Deprecated. 
Constructs a SpinnerNumberModel with the specified value, minimum/maximum bounds, and stepSize.


UICSpinnerNumberModel

public UICSpinnerNumberModel(int value,
                             int minimum,
                             int maximum,
                             int stepSize)
Deprecated. 
Constructs a SpinnerNumberModel with the specified value, minimum/maximum bounds, and stepSize.


UICSpinnerNumberModel

public UICSpinnerNumberModel(Number value,
                             Comparable minimum,
                             Comparable maximum,
                             Number stepSize)
Deprecated. 
Constructs a SpinnerModel that represents a closed sequence of numbers from minimum to maximum.

Method Detail

setValue

public void setValue(Object value)
Deprecated. 
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

Specified by:
setValue in interface SpinnerModel
Overrides:
setValue in class SpinnerNumberModel
Parameters:
value - the value to be set to the model


Copyright © 2002-2004 Thomas Zander Available under the Free Apache licence