gui.buttons
public class MinMaxSpinnerModel extends javax.swing.SpinnerNumberModel
Axis
}.
This spinnermodel is designed to be used with a pair of spinners.
One spinner lets the user specify the maximum value of a range and the other spinner lets him specify the minimum value. Both spinners are limited within the range provided in the constructor arguments min and max.
However, in order to function correctly, each spinner also needs a reference to its counterpart in order to make sure that the min value spinner does not allow the user to choose a value that is larger than the one set in the max value spinner and vice versa. Through this setting, the spinner also understands whether it is a lower bound or an upper bound spinner, because it is only provided with a reference to the opposite spinner.
Constructor and Description |
---|
MinMaxSpinnerModel(int min,
int max)
Instantiates a new min max spinner model.
|
Modifier and Type | Method and Description |
---|---|
void |
setLowerBoundSpinner(javax.swing.JSpinner lowerBoundSpinner)
Sets the lower bound spinner.
|
void |
setUpperBoundSpinner(javax.swing.JSpinner upperBoundSpinner)
Sets the upper bound spinner.
|
void |
setValue(java.lang.Object value) |
getMaximum, getMinimum, getNextValue, getNumber, getPreviousValue, getStepSize, getValue, setMaximum, setMinimum, setStepSize
public MinMaxSpinnerModel(int min, int max)
min
- the minmax
- the maxpublic void setValue(java.lang.Object value)
setValue
in interface javax.swing.SpinnerModel
setValue
in class javax.swing.SpinnerNumberModel
public void setLowerBoundSpinner(javax.swing.JSpinner lowerBoundSpinner)
lowerBoundSpinner
- the new lower bound spinnerpublic void setUpperBoundSpinner(javax.swing.JSpinner upperBoundSpinner)
upperBoundSpinner
- the new upper bound spinner