|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.swing.AbstractSpinnerModel
javax.swing.SpinnerNumberModel
net.sf.jaxodraw.gui.swing.spinner.JaxoSpinnerIntModel
public class JaxoSpinnerIntModel
Specialization of SpinnerNumberModel that a) only allows integers (to avoid rounding issues) and has some convenience methods for them; b) optionally allows snapping the 'value' to only a subset of the integers.
| Field Summary |
|---|
| Fields inherited from class javax.swing.AbstractSpinnerModel |
|---|
listenerList |
| Constructor Summary | |
|---|---|
JaxoSpinnerIntModel(int minimum,
int maximum,
int stepSize)
With the given properties. |
|
JaxoSpinnerIntModel(int minimum,
int maximum,
int stepSize,
int orig)
With the given properties. |
|
| Method Summary | |
|---|---|
int |
getIntValue()
SpinnerNumberModel.getValue() as an int. |
int |
getOrigin()
Origin to be used for snapping. |
boolean |
isSnap()
Is 'value' always snapped to 'origin' + multiples of stepSize? |
void |
setIntStepSize(int newValue)
setStepSize(java.lang.Number) with int argument. |
void |
setIntValue(int newValue)
setValue(java.lang.Object) with int argument. |
void |
setOrigin(int newValue)
Set origin property (potentially changing also 'value'). |
void |
setSnap(boolean newValue)
Set snap property (potentially changing also 'value'). |
void |
setStepSize(Number stepSize)
|
void |
setValue(Object value)
|
| Methods inherited from class javax.swing.SpinnerNumberModel |
|---|
getMaximum, getMinimum, getNextValue, getNumber, getPreviousValue, getStepSize, getValue, setMaximum, setMinimum |
| 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 JaxoSpinnerIntModel(int minimum,
int maximum,
int stepSize)
minimum - minimummaximum - maximumstepSize - stepSize
public JaxoSpinnerIntModel(int minimum,
int maximum,
int stepSize,
int orig)
minimum - minimummaximum - maximumstepSize - stepSizeorig - origin| Method Detail |
|---|
public final int getIntValue()
SpinnerNumberModel.getValue() as an int.
public void setValue(Object value)
setValue in interface SpinnerModelsetValue in class SpinnerNumberModelpublic final void setIntValue(int newValue)
setValue(java.lang.Object) with int argument.
newValue - the new int value.public void setIntStepSize(int newValue)
setStepSize(java.lang.Number) with int argument.
newValue - the new step size.public void setStepSize(Number stepSize)
setStepSize in class SpinnerNumberModelpublic final int getOrigin()
origin + n * stepSize, with
'n' an integer.
public void setOrigin(int newValue)
newValue - the new origin.public final boolean isSnap()
public void setSnap(boolean newValue)
newValue - the new snap.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||