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. As of 1.4, support for long term storage
of all JavaBeansTM
has been added to the java.beans
package.
Please see XMLEncoder
.
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
changeEvent | Only one ChangeEvent is needed per model instance since the
event's only (read-only) state is the source property. |
||||||||||
listenerList | The listeners waiting for model changes. |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Initializes all of the properties with default values.
| |||||||||||
Initializes value, extent, minimum and maximum.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Adds a
ChangeListener . | |||||||||||
Returns an array of all the change listeners
registered on this
DefaultBoundedRangeModel . | |||||||||||
Returns the model's extent.
| |||||||||||
Returns an array of all the objects currently registered as
FooListener s
upon this model. | |||||||||||
Returns the model's maximum.
| |||||||||||
Returns the model's minimum.
| |||||||||||
Returns the model's current value.
| |||||||||||
Returns true if the value is in the process of changing
as a result of actions being taken by the user.
| |||||||||||
Removes a
ChangeListener . | |||||||||||
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 | |||||||||||
Sets the maximum to n after ensuring that n
that the other three properties obey the model's constraints:
minimum <= value <= value+extent <= maximum | |||||||||||
Sets the minimum to n after ensuring that n
that the other three properties obey the model's constraints:
minimum <= value <= value+extent <= maximum | |||||||||||
Sets all of the
BoundedRangeModel properties after forcing
the arguments to obey the usual constraints:
minimum <= value <= value+extent <= maximum
At most, one | |||||||||||
Sets the current value of the model.
| |||||||||||
Sets the
valueIsAdjusting property. | |||||||||||
Returns a string that displays all of the
BoundedRangeModel properties. |
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Runs each
ChangeListener 's stateChanged method. |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
Only one ChangeEvent
is needed per model instance since the
event's only (read-only) state is the source property. The source
of events generated here is always "this".
Initializes all of the properties with default values. Those values are:
value
= 0
extent
= 0
minimum
= 0
maximum
= 100
adjusting
= false
Initializes value, extent, minimum and maximum. Adjusting is false.
Throws an IllegalArgumentException
if the following
constraints aren't satisfied:
min <= value <= value+extent <= max
Adds a ChangeListener
. The change listeners are run each
time any one of the Bounded Range model properties changes.
l | the ChangeListener to add |
---|
Returns an array of all the change listeners
registered on this DefaultBoundedRangeModel
.
ChangeListener
s
or an empty
array if no change listeners are currently registeredReturns an array of all the objects currently registered as
FooListener
s
upon this model.
FooListener
s
are registered using the addFooListener
method.
You can specify the listenerType
argument
with a class literal, such as FooListener.class
.
For example, you can query a DefaultBoundedRangeModel
instance m
for its change listeners
with the following code:
ChangeListener[] cls = (ChangeListener[])(m.getListeners(ChangeListener.class));If no such listeners exist, this method returns an empty array.
listenerType | the type of listeners requested;
this parameter should specify an interface
that descends from java.util.EventListener |
---|
FooListener
s
on this model,
or an empty array if no such
listeners have been addedClassCastException | if listenerType doesn't
specify a class or interface that implements
java.util.EventListener |
---|
Returns the model's current value.
Returns true if the value is in the process of changing as a result of actions being taken by the user.
valueIsAdjusting
propertyRemoves a ChangeListener
.
l | the ChangeListener to remove |
---|
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
n | the model's new extent |
---|
Sets the maximum to n after ensuring that n that the other three properties obey the model's constraints:
minimum <= value <= value+extent <= maximum
n | the model's new maximum |
---|
Sets the minimum to n after ensuring that n that the other three properties obey the model's constraints:
minimum <= value <= value+extent <= maximum
n | the model's new minimum |
---|
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.
newValue | an int giving the current value |
---|---|
newExtent | an int giving the amount by which the value can "jump" |
newMin | an int giving the minimum value |
newMax | an int giving the maximum value |
adjusting | a boolean, true if a series of changes are in progress |
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
n | the model's new value |
---|
Sets the valueIsAdjusting
property.
b | true if the upcoming changes to the value property are part of a series |
---|
Returns a string that displays all of the
BoundedRangeModel
properties.
Runs each ChangeListener
's stateChanged
method.