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 RangeModellistener - 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()
RangeModelgetExtent in interface RangeModelpublic int getMaximum()
RangeModelgetMaximum in interface RangeModelpublic int getMinimum()
RangeModelgetMinimum in interface RangeModelpublic int getValue()
RangeModelgetValue in interface RangeModelpublic boolean isEnabled()
RangeModeltrue if this RangeModel is enabled.isEnabled in interface RangeModelpublic void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
removePropertyChangeListener in interface RangeModellistener - the listener to be removedpublic void setAll(int min,
int ext,
int max)
RangeModelsetAll in interface RangeModelmin - the new mininumext - the new extentmax - the new maximumRangeModel.setAll(int, int, int)public void setExtent(int extent)
setExtent in interface RangeModelextent - the new extent valuepublic void setMaximum(int maximum)
setMaximum in interface RangeModelmaximum - the new maximum valuepublic void setMinimum(int minimum)
setMinimum in interface RangeModelminimum - the new minumum valuepublic void setValue(int value)
setValue in interface RangeModelvalue - the new valuepublic java.lang.String toString()
toString in class java.lang.ObjectObject.toString()Copyright (c) IBM Corp. and others 2000, 2011. All Rights Reserved.