public class DefaultRangeModel extends java.lang.Object implements RangeModel
|<----extent--->| ----|-----------|---------------|---------------|---- min | max value
Modifier and Type | Field and Description |
---|---|
protected java.beans.PropertyChangeSupport |
propertyListeners
Listeners interested in the range model's property changes.
|
PROPERTY_EXTENT, PROPERTY_MAXIMUM, PROPERTY_MINIMUM, PROPERTY_VALUE
Constructor and Description |
---|
DefaultRangeModel() |
Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Registers the given listener as a PropertyChangeListener.
|
protected void |
firePropertyChange(java.lang.String string,
int oldValue,
int newValue)
Notifies any listening PropertyChangeListeners that the property with the
given id has changed.
|
int |
getExtent()
Returns the extent.
|
int |
getMaximum()
Returns the maximum value in the range.
|
int |
getMinimum()
Returns the minimum value in the range.
|
int |
getValue()
Returns the current value.
|
boolean |
isEnabled()
Returns
true if this RangeModel is enabled. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes the given PropertyChangeListener from the list of listeners.
|
void |
setAll(int min,
int ext,
int max)
Sets min, extent, and max all at once.
|
void |
setExtent(int extent)
Sets this RangeModel's extent and fires a property change if the given
value is different from the current extent.
|
void |
setMaximum(int maximum)
Sets this RangeModel's maximum value and fires a property change if the
given value is different from the current maximum value.
|
void |
setMinimum(int minimum)
Sets this RangeModel's minimum value and fires a property change if the
given value is different from the current minimum value.
|
void |
setValue(int value)
Sets this RangeModel's current value.
|
java.lang.String |
toString() |
protected java.beans.PropertyChangeSupport propertyListeners
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
addPropertyChangeListener
in interface RangeModel
listener
- the listener to be addedprotected void firePropertyChange(java.lang.String string, int oldValue, int newValue)
string
- the property nameoldValue
- the old valuenewValue
- the new valuepublic int getExtent()
RangeModel
getExtent
in interface RangeModel
public int getMaximum()
RangeModel
getMaximum
in interface RangeModel
public int getMinimum()
RangeModel
getMinimum
in interface RangeModel
public int getValue()
RangeModel
getValue
in interface RangeModel
public boolean isEnabled()
RangeModel
true
if this RangeModel is enabled.isEnabled
in interface RangeModel
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
removePropertyChangeListener
in interface RangeModel
listener
- the listener to be removedpublic void setAll(int min, int ext, int max)
RangeModel
setAll
in interface RangeModel
min
- the new mininumext
- the new extentmax
- the new maximumRangeModel.setAll(int, int, int)
public void setExtent(int extent)
setExtent
in interface RangeModel
extent
- the new extent valuepublic void setMaximum(int maximum)
setMaximum
in interface RangeModel
maximum
- the new maximum valuepublic void setMinimum(int minimum)
setMinimum
in interface RangeModel
minimum
- the new minumum valuepublic void setValue(int value)
setValue
in interface RangeModel
value
- the new valuepublic java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
Copyright (c) IBM Corp. and others 2000, 2011. All Rights Reserved.