Package com.jidesoft.spinner
Class SpinnerPointModel
java.lang.Object
javax.swing.AbstractSpinnerModel
com.jidesoft.spinner.SpinnerPointModel
- All Implemented Interfaces:
Serializable
,SpinnerModel
- Author:
- Nako Ruru
- See Also:
-
Field Summary
FieldsFields inherited from class javax.swing.AbstractSpinnerModel
listenerList
-
Constructor Summary
ConstructorsConstructorDescriptionCreate a defaultSpinnerPointModel
SpinnerPointModel
(Point point) Create aSpinnerPointModel
with a specifiedPoint
-
Method Summary
Modifier and TypeMethodDescriptionint
getField()
Return the object in the sequence that comes after the object returned bygetValue()
.getPoint()
The current element of the sequence.Return the object in the sequence that comes before the object returned bygetValue()
.getValue()
The current element of the sequence.void
setField
(int field) void
void
Changes current value of the model, typically this value is displayed by theeditor
part of aJSpinner
.Methods inherited from class javax.swing.AbstractSpinnerModel
addChangeListener, fireStateChanged, getChangeListeners, getListeners, removeChangeListener
-
Field Details
-
FIELD_X
public static final int FIELD_X- See Also:
-
FIELD_Y
public static final int FIELD_Y- See Also:
-
-
Constructor Details
-
SpinnerPointModel
public SpinnerPointModel()Create a defaultSpinnerPointModel
-
SpinnerPointModel
Create aSpinnerPointModel
with a specifiedPoint
- Parameters:
point
- this specifiedPoint
-
-
Method Details
-
getValue
The current element of the sequence. This element is usually displayed by theeditor
part of aJSpinner
.- Returns:
- the current spinner value.
- See Also:
-
setValue
Changes current value of the model, typically this value is displayed by theeditor
part of aJSpinner
. If theSpinnerModel
implementation doesn't support the specified value then anIllegalArgumentException
is thrown. For example aSpinnerModel
for numbers might only support values that are integer multiples of ten. In that case,model.setValue(new Number(11))
would throw an exception.- Parameters:
value
- new value- Throws:
IllegalArgumentException
- ifvalue
isn't allowed- See Also:
-
getPoint
The current element of the sequence. This element is usually displayed by theeditor
part of aJSpinner
.- Returns:
- the current spinner value.
- See Also:
-
setPoint
- Parameters:
point
- the new point
-
getField
public int getField()- Returns:
- the field.
-
setField
public void setField(int field) - Parameters:
field
- the new field.
-
getNextValue
Return the object in the sequence that comes after the object returned bygetValue()
. If the end of the sequence has been reached then return null. Calling this method does not effectvalue
.- Returns:
- the next legal value or null if one doesn't exist
- See Also:
-
getPreviousValue
Return the object in the sequence that comes before the object returned bygetValue()
. If the end of the sequence has been reached then return null. Calling this method does not effectvalue
.- Returns:
- the previous legal value or null if one doesn't exist
- See Also:
-