Package com.jidesoft.spinner
Class SpinnerPointModel
- java.lang.Object
-
- javax.swing.AbstractSpinnerModel
-
- com.jidesoft.spinner.SpinnerPointModel
-
- All Implemented Interfaces:
java.io.Serializable,javax.swing.SpinnerModel
public class SpinnerPointModel extends javax.swing.AbstractSpinnerModel- Author:
- Nako Ruru
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SpinnerPointModel()Create a defaultSpinnerPointModelSpinnerPointModel(java.awt.Point point)Create aSpinnerPointModelwith a specifiedPoint
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetField()java.lang.ObjectgetNextValue()Return the object in the sequence that comes after the object returned bygetValue().java.awt.PointgetPoint()The current element of the sequence.java.lang.ObjectgetPreviousValue()Return the object in the sequence that comes before the object returned bygetValue().java.lang.ObjectgetValue()The current element of the sequence.voidsetField(int field)voidsetPoint(java.awt.Point point)voidsetValue(java.lang.Object value)Changes current value of the model, typically this value is displayed by theeditorpart of aJSpinner.
-
-
-
Field Detail
-
FIELD_X
public static final int FIELD_X
- See Also:
- Constant Field Values
-
FIELD_Y
public static final int FIELD_Y
- See Also:
- Constant Field Values
-
-
Method Detail
-
getValue
public java.lang.Object getValue()
The current element of the sequence. This element is usually displayed by theeditorpart of aJSpinner.- Returns:
- the current spinner value.
- See Also:
setValue(java.lang.Object)
-
setValue
public void setValue(java.lang.Object value)
Changes current value of the model, typically this value is displayed by theeditorpart of aJSpinner. If theSpinnerModelimplementation doesn't support the specified value then anIllegalArgumentExceptionis thrown. For example aSpinnerModelfor 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:
java.lang.IllegalArgumentException- ifvalueisn't allowed- See Also:
getValue()
-
getPoint
public java.awt.Point getPoint()
The current element of the sequence. This element is usually displayed by theeditorpart of aJSpinner.- Returns:
- the current spinner value.
- See Also:
setPoint(Point),getValue()
-
setPoint
public void setPoint(java.awt.Point point)
- Parameters:
point- the new point
-
getField
public int getField()
- Returns:
- the field.
-
setField
public void setField(int field)
- Parameters:
field- the new field.
-
getNextValue
public java.lang.Object 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:
getValue(),getPreviousValue()
-
getPreviousValue
public java.lang.Object 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:
getValue(),getNextValue()
-
-