|
||||||||||
| 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.JaxoSpinnerRotationModel
public class JaxoSpinnerRotationModel
Specialization of SpinnerNumberModel that only allows integers to avoid rounding issues. Treats them as rotation angles, normalizing to the interval ]-180, 180]. getPrevious/NextValue also act circularly. The minimum and maximum are always set to [-179, 180] and should not be changed.
| Field Summary |
|---|
| Fields inherited from class javax.swing.AbstractSpinnerModel |
|---|
listenerList |
| Constructor Summary | |
|---|---|
JaxoSpinnerRotationModel()
With initial value 0 and step size 1. |
|
JaxoSpinnerRotationModel(int value)
With given initial value and step size 1. |
|
| Method Summary | |
|---|---|
Object |
getNextValue()
|
Object |
getPreviousValue()
|
int |
getRotationValue()
SpinnerNumberModel.getValue() as an int. |
JSpinner |
newSpinner()
A new JSpinner with an editor better fit to edit angles than the default number editor. |
void |
setRotationValue(int newValue)
setValue(java.lang.Object) with int argument. |
void |
setValue(Object value)
|
| Methods inherited from class javax.swing.SpinnerNumberModel |
|---|
getMaximum, getMinimum, getNumber, 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 JaxoSpinnerRotationModel()
public JaxoSpinnerRotationModel(int value)
value - initial value.| Method Detail |
|---|
public final int getRotationValue()
SpinnerNumberModel.getValue() as an int.
public void setValue(Object value)
setValue in interface SpinnerModelsetValue in class SpinnerNumberModelpublic final void setRotationValue(int newValue)
setValue(java.lang.Object) with int argument.
newValue - new rotation value.public Object getPreviousValue()
getPreviousValue in interface SpinnerModelgetPreviousValue in class SpinnerNumberModelpublic Object getNextValue()
getNextValue in interface SpinnerModelgetNextValue in class SpinnerNumberModelpublic JSpinner newSpinner()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||