|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavax.swing.DefaultBoundedRangeModel
public class DefaultBoundedRangeModel
The default implementation of BoundedRangeModel.
| Field Summary | |
|---|---|
protected ChangeEvent |
changeEvent
An event that is sent to all registered ChangeListeners
when the state of this range model has changed. |
protected EventListenerList |
listenerList
The list of the currently registered EventListeners. |
| Constructor Summary | |
|---|---|
DefaultBoundedRangeModel()
Constructs a DefaultBoundedRangeModel with default
values for the properties. |
|
DefaultBoundedRangeModel(int value,
int extent,
int minimum,
int maximum)
Constructs a DefaultBoundedRangeModel with the
specified values for some properties. |
|
| Method Summary | ||
|---|---|---|
void |
addChangeListener(ChangeListener listener)
Subscribes a ChangeListener to state changes. |
|
protected void |
fireStateChanged()
Sends a ChangeEvent to any registered ChangeListeners. |
|
ChangeListener[] |
getChangeListeners()
Returns all ChangeListeners that are currently
subscribed for changes to this
DefaultBoundedRangeModel. |
|
int |
getExtent()
Returns the current extent of this bounded range model, which is a number greater than or equal to zero. |
|
|
getListeners(Class<T> listenerType)
Retrieves the current listeners of the specified class. |
|
int |
getMaximum()
Returns the current maximal value of this bounded range model. |
|
int |
getMinimum()
Returns the current minimal value of this bounded range model. |
|
int |
getValue()
Returns the current value of this bounded range model. |
|
boolean |
getValueIsAdjusting()
Returns whether or not the value of this bounded range model is going to change in the immediate future. |
|
void |
removeChangeListener(ChangeListener listener)
Cancels the subscription of a ChangeListener. |
|
void |
setExtent(int extent)
Changes the current extent of this bounded range model. |
|
void |
setMaximum(int maximum)
Changes the current maximal value of this bounded range model. |
|
void |
setMinimum(int minimum)
Changes the current minimal value of this bounded range model. |
|
void |
setRangeProperties(int value,
int extent,
int minimum,
int maximum,
boolean isAdjusting)
Sets all properties. |
|
void |
setValue(int value)
Changes the current value of this bounded range model. |
|
void |
setValueIsAdjusting(boolean isAdjusting)
Specifies whether or not the value of this bounded range model is going to change in the immediate future. |
|
String |
toString()
Returns a string with all relevant properties of this range model. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected transient ChangeEvent changeEvent
ChangeListeners
when the state of this range model has changed.
The event object is created on demand, the first time it is actually needed.
fireStateChanged()protected EventListenerList listenerList
| Constructor Detail |
|---|
public DefaultBoundedRangeModel()
DefaultBoundedRangeModel with default
values for the properties. The properties value,
extent and minimum will be initialized
to zero; maximum will be set to 100; the property
valueIsAdjusting will be false.
public DefaultBoundedRangeModel(int value,
int extent,
int minimum,
int maximum)
DefaultBoundedRangeModel with the
specified values for some properties.
value - the initial value of the range model, which must be
a number between minimum and (maximum -
extent). In a scroll bar visualization of a BoundedRangeModel, the value is displayed as the
position of the thumb.extent - the initial extent of the range model, which is a
number greater than or equal to zero. In a scroll bar
visualization of a BoundedRangeModel, the
extent is displayed as the size of the thumb.minimum - the initial minimal value of the range model.maximum - the initial maximal value of the range model.
IllegalArgumentException - if the following condition is
not satisfied: minimum <= value <= value + extent <=
maximum.| Method Detail |
|---|
public String toString()
toString in class ObjectObject.getClass(),
Object.hashCode(),
Class.getName(),
Integer.toHexString(int)public int getValue()
BoundedRangeModel, the
value is displayed as the position of the thumb.
getValue in interface BoundedRangeModelBoundedRangeModel.setValue(int)public void setValue(int value)
BoundedRangeModel, the
value is displayed as the position of the thumb;
changing the value of a scroll bar's model
thus moves the thumb to a different position.
setValue in interface BoundedRangeModelvalue - the valueBoundedRangeModel.getValue()public int getExtent()
BoundedRangeModel, the
extent is displayed as the size of the thumb.
getExtent in interface BoundedRangeModelBoundedRangeModel.setExtent(int)public void setExtent(int extent)
BoundedRangeModel, the
extent is displayed as the size of the thumb.
setExtent in interface BoundedRangeModelextent - the new extent of the range model, which is a
number greater than or equal to zero.BoundedRangeModel.getExtent()public int getMinimum()
getMinimum in interface BoundedRangeModelBoundedRangeModel.setMinimum(int),
BoundedRangeModel.getMaximum()public void setMinimum(int minimum)
setMinimum in interface BoundedRangeModelminimum - the new minimal value.BoundedRangeModel.getMinimum()public int getMaximum()
getMaximum in interface BoundedRangeModelBoundedRangeModel.setMaximum(int),
BoundedRangeModel.getMinimum()public void setMaximum(int maximum)
setMaximum in interface BoundedRangeModelmaximum - the new maximal value.BoundedRangeModel.getMaximum()public boolean getValueIsAdjusting()
true while the thumb is being dragged
around; when the mouse is relased, they set the property to
false and post a final ChangeEvent.
getValueIsAdjusting in interface BoundedRangeModeltrue if the value will change soon again;
false if the value will probably not change soon.BoundedRangeModel.setValueIsAdjusting(boolean)public void setValueIsAdjusting(boolean isAdjusting)
true while the thumb is being dragged
around; when the mouse is relased, they set the property to
false.
setValueIsAdjusting in interface BoundedRangeModelisAdjusting - true if the value will change
soon again; false if the value will probably not
change soon.BoundedRangeModel.getValueIsAdjusting()
public void setRangeProperties(int value,
int extent,
int minimum,
int maximum,
boolean isAdjusting)
setRangeProperties in interface BoundedRangeModelvalue - the new value of the range model. In a scroll bar
visualization of a BoundedRangeModel, the
value is displayed as the position of the thumb.extent - the new extent of the range model, which is a
number greater than or equal to zero. In a scroll bar
visualization of a BoundedRangeModel, the
extent is displayed as the size of the thumb.minimum - the new minimal value of the range model.maximum - the new maximal value of the range model.isAdjusting - whether or not the value of this bounded range
model is going to change in the immediate future. Scroll bars set
this property to true while the thumb is being
dragged around; when the mouse is relased, they set the property
to false.public void addChangeListener(ChangeListener listener)
addChangeListener in interface BoundedRangeModellistener - the listener to be subscribed.BoundedRangeModel.removeChangeListener(ChangeListener)public void removeChangeListener(ChangeListener listener)
removeChangeListener in interface BoundedRangeModellistener - the listener to be unsubscribed.BoundedRangeModel.addChangeListener(ChangeListener)protected void fireStateChanged()
ChangeEvent to any registered ChangeListeners.
addChangeListener(ChangeListener),
removeChangeListener(ChangeListener)public <T extends EventListener> T[] getListeners(Class<T> listenerType)
listenerType - the class of listeners; usually ChangeListener.class.
public ChangeListener[] getChangeListeners()
ChangeListeners that are currently
subscribed for changes to this
DefaultBoundedRangeModel.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||