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. As of 1.4, support for long term storage
of all JavaBeans
has been added to the java.beans package.
Please see java..
BoundedRangeModel
| Modifier and Type | Field and Description |
|---|---|
| protected transient ChangeEvent | changeEvent
Only one |
| private int | |
| private boolean | |
| protected EventListenerList | listenerList
The listeners waiting for model changes. |
| private int | |
| private int | |
| private int |
| Access | Constructor and Description |
|---|---|
| public | |
| public | DefaultBoundedRangeModel(int
an int giving the current value value, int the length of the inner range that begins at the model's value extent, int an int giving the minimum value min, int an int giving the maximum value max)Initializes value, extent, minimum and maximum. |
| Modifier and Type | Method and Description |
|---|---|
| public void | addChangeListener(ChangeListener
the ChangeListener to add l)Implements javax. Adds a |
| protected void | |
| public ChangeListener[] | Returns: all of this model'sChangeListeners
or an empty
array if no change listeners are currently registeredReturns an array of all the change listeners
registered on this |
| public int | Returns: the model's extentImplements javax. Returns the model's extent. |
| public < the type of T extends EventListener> T[]EventListener class being requested | Returns: an array of all objects registered asFooListeners
on this model,
or an empty array if no such
listeners have been addedthe type of listeners requested;
this parameter should specify an interface
that descends from listenerType)java.util.EventListenerReturns an array of all the objects currently registered as
|
| public int | Returns: the model's maximumImplements javax. Returns the model's maximum. |
| public int | Returns: the model's minimumImplements javax. Returns the model's minimum. |
| public int | Returns: the model's current valueImplements javax. Returns the model's current value. |
| public boolean | Returns: the value of thevalueIsAdjusting propertyImplements javax. Returns true if the value is in the process of changing as a result of actions being taken by the user. |
| public void | removeChangeListener(ChangeListener
the l)ChangeListener to removeImplements javax. Removes a |
| public void | setExtent(int n)
Implements javax. 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
|
| public void | setMaximum(int n)
Implements javax. Sets the maximum to n after ensuring that n that the other three properties obey the model's constraints:
minimum <= value <= value+extent <= maximum
|
| public void | setMinimum(int n)
Implements javax. Sets the minimum to n after ensuring that n that the other three properties obey the model's constraints:
minimum <= value <= value+extent <= maximum
|
| public void | setRangeProperties(int newValue, int newExtent, int newMin, int newMax, boolean adjusting)
Implements javax. Sets all of the
minimum <= value <= value+extent <= maximum
|
| public void | setValue(int n)
Implements javax. Sets the current value of the model. |
| public void | setValueIsAdjusting(boolean b)
Implements javax. Sets the |
| public String | toString()
Overrides java. Returns a string that displays all of the
|
| changeEvent | back to summary |
|---|---|
| protected transient ChangeEvent changeEvent Only one | |
| extent | back to summary |
|---|---|
| private int extent | |
| isAdjusting | back to summary |
|---|---|
| private boolean isAdjusting | |
| listenerList | back to summary |
|---|---|
| protected EventListenerList listenerList The listeners waiting for model changes. | |
| max | back to summary |
|---|---|
| private int max | |
| min | back to summary |
|---|---|
| private int min | |
| value | back to summary |
|---|---|
| private int value | |
| DefaultBoundedRangeModel | back to summary |
|---|---|
| public DefaultBoundedRangeModel() Initializes all of the properties with default values. Those values are:
| |
| DefaultBoundedRangeModel | back to summary |
|---|---|
| public DefaultBoundedRangeModel(int value, int extent, int min, int max) Initializes value, extent, minimum and maximum. Adjusting is false.
Throws an min <= value <= value+extent <= max
| |
| addChangeListener | back to summary |
|---|---|
| public void addChangeListener(ChangeListener l) Implements javax. Adds a
| |
| fireStateChanged | back to summary |
|---|---|
| protected void fireStateChanged() Runs each
| |
| getChangeListeners | back to summary |
|---|---|
| public ChangeListener[] getChangeListeners() Returns an array of all the change listeners
registered on this
| |
| getExtent | back to summary |
|---|---|
| public int getExtent() Implements javax. Returns the model's extent.
| |
| getListeners | back to summary |
|---|---|
| public <T extends EventListener> T[] getListeners(Class<T> listenerType) Returns an array of all the objects currently registered as
You can specify the ChangeListener[] cls = (ChangeListener[])(m.getListeners(ChangeListener.class));If no such listeners exist, this method returns an empty array.
| |
| getMaximum | back to summary |
|---|---|
| public int getMaximum() Implements javax. Returns the model's maximum.
| |
| getMinimum | back to summary |
|---|---|
| public int getMinimum() Implements javax. Returns the model's minimum.
| |
| getValue | back to summary |
|---|---|
| public int getValue() Implements javax. Returns the model's current value.
| |
| getValueIsAdjusting | back to summary |
|---|---|
| public boolean getValueIsAdjusting() Implements javax. Returns true if the value is in the process of changing as a result of actions being taken by the user.
| |
| removeChangeListener | back to summary |
|---|---|
| public void removeChangeListener(ChangeListener l) Implements javax. Removes a
| |
| setExtent | back to summary |
|---|---|
| public void setExtent(int n) Implements javax. 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
| |
| setMaximum | back to summary |
|---|---|
| public void setMaximum(int n) Implements javax. Sets the maximum to n after ensuring that n that the other three properties obey the model's constraints:
minimum <= value <= value+extent <= maximum
| |
| setMinimum | back to summary |
|---|---|
| public void setMinimum(int n) Implements javax. Sets the minimum to n after ensuring that n that the other three properties obey the model's constraints:
minimum <= value <= value+extent <= maximum
| |
| setRangeProperties | back to summary |
|---|---|
| public void setRangeProperties(int newValue, int newExtent, int newMin, int newMax, boolean adjusting) Implements javax. Sets all of the
minimum <= value <= value+extent <= maximum
At most, one | |
| setValue | back to summary |
|---|---|
| public void setValue(int n) Implements javax. Sets the current value of the model. For a slider, that determines where the knob appears. Ensures that the new value, n falls within the model's constraints:
minimum <= value <= value+extent <= maximum
| |
| setValueIsAdjusting | back to summary |
|---|---|
| public void setValueIsAdjusting(boolean b) Implements javax. Sets the | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Returns a string that displays all of the
| |