Package org.eclipse.draw2d
Interface RangeModel
- All Known Implementing Classes:
DefaultRangeModel
public interface RangeModel
This interface represents a range of possible values as well as the current
values. There is a minumum and maximum value, a current value, and the
extent. One use for a RangeModel is a scrollbar. There is a minimum value
(the top of the scrollbar), a maximum value (the bottom of the scrollbar), a
current value (the top of the thumb), and an extent (the length of the
thumb).
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoid
Registers listener as a PropertyChangeListener of this RangeModel.int
Returns the extent.int
Returns the maximum value in the range.int
Returns the minimum value in the range.int
getValue()
Returns the current value.boolean
Returnstrue
if this RangeModel is enabled.void
Removes the given listener from this RangeModel's list of PropertyChangeListeners.void
setAll
(int min, int extent, int max) Sets min, extent, and max all at once.void
setExtent
(int extent) Sets the extent.void
setMaximum
(int max) Sets the maximum value of the range.void
setMinimum
(int min) Sets the minimum value of the range.void
setValue
(int value) Sets the current value.
-
Field Details
-
PROPERTY_VALUE
Value property name- See Also:
-
PROPERTY_EXTENT
Extent property name- See Also:
-
PROPERTY_MINIMUM
Minimum property name- See Also:
-
PROPERTY_MAXIMUM
Maximum property name- See Also:
-
-
Method Details
-
addPropertyChangeListener
Registers listener as a PropertyChangeListener of this RangeModel. Listeners will be notified of changes tovalue
,extent
,minimum
andmaximum
properties.- Parameters:
listener
- The listener to add
-
getExtent
int getExtent()Returns the extent.- Returns:
- The extent
-
getMaximum
int getMaximum()Returns the maximum value in the range.- Returns:
- The maximum value
-
getMinimum
int getMinimum()Returns the minimum value in the range.- Returns:
- The minimum value
-
getValue
int getValue()Returns the current value.- Returns:
- The current value
-
isEnabled
boolean isEnabled()Returnstrue
if this RangeModel is enabled.- Returns:
true
if this Rangel Model is enabled
-
removePropertyChangeListener
Removes the given listener from this RangeModel's list of PropertyChangeListeners.- Parameters:
listener
- The listener to remove
-
setAll
void setAll(int min, int extent, int max) Sets min, extent, and max all at once.- Parameters:
min
- the new mininumextent
- the new extentmax
- the new maximum
-
setExtent
void setExtent(int extent) Sets the extent.- Parameters:
extent
- The extent
-
setMaximum
void setMaximum(int max) Sets the maximum value of the range.- Parameters:
max
- The maximum value
-
setMinimum
void setMinimum(int min) Sets the minimum value of the range.- Parameters:
min
- The minimum value
-
setValue
void setValue(int value) Sets the current value.- Parameters:
value
- The current value
-