Package org.eclipse.draw2d
Class DefaultRangeModel
java.lang.Object
org.eclipse.draw2d.DefaultRangeModel
- All Implemented Interfaces:
- RangeModel
Generic implementation for a RangeModel.
 
                    |<----extent--->|
    ----|-----------|---------------|---------------|----
       min          |                              max
                  value
 - 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected PropertyChangeSupportListeners interested in the range model's property changes.Fields inherited from interface org.eclipse.draw2d.RangeModelPROPERTY_EXTENT, PROPERTY_MAXIMUM, PROPERTY_MINIMUM, PROPERTY_VALUE
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidRegisters the given listener as a PropertyChangeListener.protected voidfirePropertyChange(String string, int oldValue, int newValue) Notifies any listening PropertyChangeListeners that the property with the given id has changed.intReturns the extent.intReturns the maximum value in the range.intReturns the minimum value in the range.intgetValue()Returns the current value.booleanReturnstrueif this RangeModel is enabled.voidRemoves the given PropertyChangeListener from the list of listeners.voidsetAll(int min, int ext, int max) Sets min, extent, and max all at once.voidsetExtent(int extent) Sets this RangeModel's extent and fires a property change if the given value is different from the current extent.voidsetMaximum(int maximum) Sets this RangeModel's maximum value and fires a property change if the given value is different from the current maximum value.voidsetMinimum(int minimum) Sets this RangeModel's minimum value and fires a property change if the given value is different from the current minimum value.voidsetValue(int value) Sets this RangeModel's current value.toString()
- 
Field Details- 
propertyListenersListeners interested in the range model's property changes.
 
- 
- 
Constructor Details- 
DefaultRangeModelpublic DefaultRangeModel()
 
- 
- 
Method Details- 
addPropertyChangeListenerRegisters the given listener as a PropertyChangeListener.- Specified by:
- addPropertyChangeListenerin interface- RangeModel
- Parameters:
- listener- the listener to be added
- Since:
- 2.0
 
- 
firePropertyChangeNotifies any listening PropertyChangeListeners that the property with the given id has changed.- Parameters:
- string- the property name
- oldValue- the old value
- newValue- the new value
- Since:
- 2.0
 
- 
getExtentpublic int getExtent()Description copied from interface:RangeModelReturns the extent.- Specified by:
- getExtentin interface- RangeModel
- Returns:
- the extent
 
- 
getMaximumpublic int getMaximum()Description copied from interface:RangeModelReturns the maximum value in the range.- Specified by:
- getMaximumin interface- RangeModel
- Returns:
- the maximum value
 
- 
getMinimumpublic int getMinimum()Description copied from interface:RangeModelReturns the minimum value in the range.- Specified by:
- getMinimumin interface- RangeModel
- Returns:
- the minimum value
 
- 
getValuepublic int getValue()Description copied from interface:RangeModelReturns the current value.- Specified by:
- getValuein interface- RangeModel
- Returns:
- the current value
 
- 
isEnabledpublic boolean isEnabled()Description copied from interface:RangeModelReturnstrueif this RangeModel is enabled.- Specified by:
- isEnabledin interface- RangeModel
- Returns:
- whether the extent is between the minimum and maximum values
 
- 
removePropertyChangeListenerRemoves the given PropertyChangeListener from the list of listeners.- Specified by:
- removePropertyChangeListenerin interface- RangeModel
- Parameters:
- listener- the listener to be removed
 
- 
setAllpublic void setAll(int min, int ext, int max) Description copied from interface:RangeModelSets min, extent, and max all at once.- Specified by:
- setAllin interface- RangeModel
- Parameters:
- min- the new mininum
- ext- the new extent
- max- the new maximum
- See Also:
 
- 
setExtentpublic void setExtent(int extent) Sets this RangeModel's extent and fires a property change if the given value is different from the current extent.- Specified by:
- setExtentin interface- RangeModel
- Parameters:
- extent- the new extent value
 
- 
setMaximumpublic 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.- Specified by:
- setMaximumin interface- RangeModel
- Parameters:
- maximum- the new maximum value
 
- 
setMinimumpublic 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.- Specified by:
- setMinimumin interface- RangeModel
- Parameters:
- minimum- the new minumum value
 
- 
setValuepublic void setValue(int value) Sets this RangeModel's current value. If the given value is greater than the maximum, the maximum value is used. If the given value is less than the minimum, the minimum value is used. If the adjusted value is different from the current value, a property change is fired.- Specified by:
- setValuein interface- RangeModel
- Parameters:
- value- the new value
 
- 
toString
 
-