|
JavaTM 2 Platform Std. Ed. v1.3 |
|||||||||
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. |
EventListener[] |
getListeners(Class listenerType)
Return an array of all the listeners of the given type that were added to this model. |
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: |
void |
setMaximum(int n)
Sets the maximum to n after ensuring that n that the other three properties obey the model's constraints: |
void |
setMinimum(int n)
Sets the minimum to n after ensuring that n that the other three properties obey the model's constraints: |
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: |
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()
getValue
in interface BoundedRangeModel
setValue(int)
,
BoundedRangeModel.getValue()
public int getExtent()
getExtent
in interface BoundedRangeModel
setExtent(int)
,
BoundedRangeModel.getExtent()
public int getMinimum()
getMinimum
in interface BoundedRangeModel
setMinimum(int)
,
BoundedRangeModel.getMinimum()
public int getMaximum()
getMaximum
in interface BoundedRangeModel
setMaximum(int)
,
BoundedRangeModel.getMaximum()
public void setValue(int n)
minimum <= value <= value+extent <= maximum
setValue
in interface BoundedRangeModel
BoundedRangeModel.setValue(int)
public void setExtent(int n)
minimum <= value <= value+extent <= maximum
setExtent
in interface BoundedRangeModel
BoundedRangeModel.setExtent(int)
public void setMinimum(int n)
minimum <= value <= value+extent <= maximum
setMinimum
in interface BoundedRangeModel
getMinimum()
,
BoundedRangeModel.setMinimum(int)
public void setMaximum(int n)
minimum <= value <= value+extent <= maximum
setMaximum
in interface BoundedRangeModel
BoundedRangeModel.setMaximum(int)
public void setValueIsAdjusting(boolean b)
setValueIsAdjusting
in interface BoundedRangeModel
getValueIsAdjusting()
,
setValue(int)
,
BoundedRangeModel.setValueIsAdjusting(boolean)
public boolean getValueIsAdjusting()
getValueIsAdjusting
in interface BoundedRangeModel
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.
setRangeProperties
in interface BoundedRangeModel
BoundedRangeModel.setRangeProperties(int, int, int, int, boolean)
,
setValue(int)
,
setExtent(int)
,
setMinimum(int)
,
setMaximum(int)
,
setValueIsAdjusting(boolean)
public void addChangeListener(ChangeListener l)
addChangeListener
in interface BoundedRangeModel
l
- the ChangeListener to addremoveChangeListener(javax.swing.event.ChangeListener)
,
BoundedRangeModel.addChangeListener(javax.swing.event.ChangeListener)
public void removeChangeListener(ChangeListener l)
removeChangeListener
in interface BoundedRangeModel
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()
toString
in class Object
java.lang.Object
public EventListener[] getListeners(Class listenerType)
|
JavaTM 2 Platform Std. Ed. v1.3 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Java, Java 2D, and JDBC are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-2000 Sun Microsystems, Inc. 901 San Antonio Road
Palo Alto, California, 94303, U.S.A. All Rights Reserved.