|
Java Platform 1.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.swing.DefaultBoundedRangeModel
A generic implementation of BoundedRangeModel.
Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. A future release of Swing will provide support for long term persistence.
BoundedRangeModel
, Serialized FormField Summary | |
protected ChangeEvent |
changeEvent
Only one ChangeEvent is needed per model instance since the event's only (read-only) state is the source property. |
protected EventListenerList |
listenerList
The listeners waiting for model changes. |
Constructor Summary | |
DefaultBoundedRangeModel()
Initializes all of the properties with default values. |
|
DefaultBoundedRangeModel(int value,
int extent,
int min,
int max)
Initializes value, extent, minimum and maximum. |
Method Summary | |
void |
addChangeListener(ChangeListener l)
Adds a ChangeListener. |
protected void |
fireStateChanged()
Run each ChangeListeners stateChanged() method. |
int |
getExtent()
Return the model's extent. |
int |
getMaximum()
Return the model's maximum. |
int |
getMinimum()
Return the model's minimum. |
int |
getValue()
Return the model's current value. |
boolean |
getValueIsAdjusting()
Returns true if the value is in the process of changing as a result of actions being taken by the user. |
void |
removeChangeListener(ChangeListener l)
Removes a ChangeListener. |
void |
setExtent(int n)
Sets the extent to n after ensuring that n is greater than or equal to zero and falls within the model's constraints: minimum <= value <= value+extent <= maximum |
void |
setMaximum(int n)
Sets the maximum to n after ensuring that n that the other three properties obey the model's constraints: minimum <= value <= value+extent <= maximum |
void |
setMinimum(int n)
Sets the minimum to n after ensuring that n that the other three properties obey the model's constraints: minimum <= value <= value+extent <= maximum |
void |
setRangeProperties(int newValue,
int newExtent,
int newMin,
int newMax,
boolean adjusting)
Sets all of the BoundedRangeModel properties after forcing the arguments to obey the usual constraints: minimum <= value <= value+extent <= maximum At most, one ChangeEvent is generated. |
void |
setValue(int n)
Sets the current value of the model. |
void |
setValueIsAdjusting(boolean b)
Sets the valueIsAdjusting property. |
String |
toString()
Returns a string that displays all of the BoundedRangeModel properties. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
protected transient ChangeEvent changeEvent
protected EventListenerList listenerList
Constructor Detail |
public DefaultBoundedRangeModel()
value
= 0
extent
= 0
minimum
= 0
maximum
= 100
adjusting
= false
public DefaultBoundedRangeModel(int value, int extent, int min, int max)
min <= value <= value+extent <= max
Method Detail |
public int getValue()
setValue(int)
,
BoundedRangeModel.getValue()
public int getExtent()
setExtent(int)
,
BoundedRangeModel.getExtent()
public int getMinimum()
setMinimum(int)
,
BoundedRangeModel.getMinimum()
public int getMaximum()
setMaximum(int)
,
BoundedRangeModel.getMaximum()
public void setValue(int n)
minimum <= value <= value+extent <= maximum
BoundedRangeModel.setValue(int)
public void setExtent(int n)
minimum <= value <= value+extent <= maximum
BoundedRangeModel.setExtent(int)
public void setMinimum(int n)
minimum <= value <= value+extent <= maximum
getMinimum()
,
BoundedRangeModel.setMinimum(int)
public void setMaximum(int n)
minimum <= value <= value+extent <= maximum
BoundedRangeModel.setMaximum(int)
public void setValueIsAdjusting(boolean b)
getValueIsAdjusting()
,
setValue(int)
,
BoundedRangeModel.setValueIsAdjusting(boolean)
public boolean getValueIsAdjusting()
setValue(int)
,
BoundedRangeModel.getValueIsAdjusting()
public void setRangeProperties(int newValue, int newExtent, int newMin, int newMax, boolean adjusting)
minimum <= value <= value+extent <= maximum
At most, one ChangeEvent is generated.
BoundedRangeModel.setRangeProperties(int, int, int, int, boolean)
,
setValue(int)
,
setExtent(int)
,
setMinimum(int)
,
setMaximum(int)
,
setValueIsAdjusting(boolean)
public void addChangeListener(ChangeListener l)
l
- the ChangeListener to addremoveChangeListener(javax.swing.event.ChangeListener)
,
BoundedRangeModel.addChangeListener(javax.swing.event.ChangeListener)
public void removeChangeListener(ChangeListener l)
l
- the ChangeListener to removeaddChangeListener(javax.swing.event.ChangeListener)
,
BoundedRangeModel.removeChangeListener(javax.swing.event.ChangeListener)
protected void fireStateChanged()
setRangeProperties(int, int, int, int, boolean)
,
EventListenerList
public String toString()
|
Java Platform 1.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |