Eclipse Draw2d
2.1

org.eclipse.draw2d
Class DefaultRangeModel

java.lang.Object
  |
  +--org.eclipse.draw2d.DefaultRangeModel
All Implemented Interfaces:
RangeModel

public class DefaultRangeModel
extends Object
implements RangeModel

Generic implementation for a RangeModel.

                    |<----extent--->|                     
    ----|-----------|---------------|---------------|----
       min          |                              max
                  value
 


Field Summary
protected  PropertyChangeSupport propertyListeners
           
 
Fields inherited from interface org.eclipse.draw2d.RangeModel
PROPERTY_EXTENT, PROPERTY_MAXIMUM, PROPERTY_MINIMUM, PROPERTY_VALUE
 
Constructor Summary
DefaultRangeModel()
           
 
Method Summary
 void addPropertyChangeListener(PropertyChangeListener listener)
          Registers the given listener as a PropertyChangeListener.
protected  void firePropertyChange(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(PropertyChangeListener listener)
          Removes the given listener from this RangeModel's list of PropertyChangeListeners.
 void setAll(int min, int ext, int max)
          Sets min, extent, and max all at once.
 void setExtent(int extent)
          Sets the extent.
 void setMaximum(int maximum)
          Sets the maximum value of the range.
 void setMinimum(int minimum)
          Sets the minimum value of the range.
 void setValue(int value)
          Sets the current value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

propertyListeners

protected PropertyChangeSupport propertyListeners
Constructor Detail

DefaultRangeModel

public DefaultRangeModel()
Method Detail

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener listener)
Registers the given listener as a PropertyChangeListener.

Specified by:
addPropertyChangeListener in interface RangeModel
Parameters:
listener - The listener to add
Since:
2.0

firePropertyChange

protected void firePropertyChange(String string,
                                  int oldValue,
                                  int newValue)
Notifies any listening PropertyChangeListeners that the property with the given id has changed.

Since:
2.0

getExtent

public int getExtent()
Description copied from interface: RangeModel
Returns the extent.

Specified by:
getExtent in interface RangeModel
Returns:
The extent

getMaximum

public int getMaximum()
Description copied from interface: RangeModel
Returns the maximum value in the range.

Specified by:
getMaximum in interface RangeModel
Returns:
The maximum value

getMinimum

public int getMinimum()
Description copied from interface: RangeModel
Returns the minimum value in the range.

Specified by:
getMinimum in interface RangeModel
Returns:
The minimum value

getValue

public int getValue()
Description copied from interface: RangeModel
Returns the current value.

Specified by:
getValue in interface RangeModel
Returns:
The current value

isEnabled

public boolean isEnabled()
Description copied from interface: RangeModel
Returns true if this RangeModel is enabled.

Specified by:
isEnabled in interface RangeModel
Returns:
true if this Rangel Model is enabled

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener listener)
Description copied from interface: RangeModel
Removes the given listener from this RangeModel's list of PropertyChangeListeners.

Specified by:
removePropertyChangeListener in interface RangeModel
Parameters:
listener - The listener to remove

setAll

public void setAll(int min,
                   int ext,
                   int max)
Description copied from interface: RangeModel
Sets min, extent, and max all at once.

Specified by:
setAll in interface RangeModel
Parameters:
min - the new mininum
ext - the new extent
max - the new maximum
See Also:
RangeModel.setAll(int, int, int)

setExtent

public void setExtent(int extent)
Description copied from interface: RangeModel
Sets the extent.

Specified by:
setExtent in interface RangeModel
Parameters:
extent - The extent

setMaximum

public void setMaximum(int maximum)
Description copied from interface: RangeModel
Sets the maximum value of the range.

Specified by:
setMaximum in interface RangeModel
Parameters:
maximum - The maximum value

setMinimum

public void setMinimum(int minimum)
Description copied from interface: RangeModel
Sets the minimum value of the range.

Specified by:
setMinimum in interface RangeModel
Parameters:
minimum - The minimum value

setValue

public void setValue(int value)
Description copied from interface: RangeModel
Sets the current value.

Specified by:
setValue in interface RangeModel
Parameters:
value - The current value

Eclipse Draw2d
2.1

Copyright (c) IBM Corp. and others 2000, 2003. All Rights Reserved.