Class ARangePolicy
java.lang.Object
info.monitorenter.gui.chart.rangepolicies.ARangePolicy
- All Implemented Interfaces:
IRangePolicy
,Serializable
- Direct Known Subclasses:
RangePolicyFixedViewport
,RangePolicyHighestValues
,RangePolicyHighestValuesForcedMin
,RangePolicyMinimumViewport
,RangePolicyUnbounded
A default superclass for IRangePolicy implementations that adds support for
setting and getting ranges.
Should be used by any implementation that really works on the data of ranges
(not unbounded ranges). Subclasses should access the internal member range or
use getRange()
.
- Version:
- $Revision: 1.8 $
- Author:
- Achim Westermann
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected PropertyChangeSupport
The instance that add support for firingPropertyChangeEvents
and maintainingPropertyChangeListeners
.Fields inherited from interface info.monitorenter.gui.chart.IRangePolicy
PROPERTY_RANGE, PROPERTY_RANGE_MAX, PROPERTY_RANGE_MIN
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a range policy with an unconfigured range (Range.RANGE_UNBOUNDED
).ARangePolicy
(Range range) Creates a range policy backed by the given range. -
Method Summary
Modifier and TypeMethodDescriptionfinal void
addPropertyChangeListener
(String propertyName, PropertyChangeListener listener) Adds a property change listener.boolean
protected final void
firePropertyChange
(String property, Object oldvalue, Object newvalue) Fires a property change event to the registered listeners.getPropertyChangeListeners
(String property) Returns all property change listeners for the given property.final Range
getRange()
Returns the internal range that is used to decide about the policy of displaying the chart.int
hashCode()
void
removePropertyChangeListener
(PropertyChangeListener listener, String property) Deregisters a property change listener that has been registerd for listening on the given property.void
removePropertyChangeListener
(String property, PropertyChangeListener listener) Removes a property change listener for listening on the given property.void
Sets the internal range that is used to decide about the policy of displaying the chart.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface info.monitorenter.gui.chart.IRangePolicy
getMax, getMin
-
Field Details
-
m_propertyChangeSupport
The instance that add support for firingPropertyChangeEvents
and maintainingPropertyChangeListeners
.PropertyChangeListener
instances.
-
-
Constructor Details
-
ARangePolicy
public ARangePolicy()Creates a range policy with an unconfigured range (Range.RANGE_UNBOUNDED
). -
ARangePolicy
Creates a range policy backed by the given range.- Parameters:
range
- the range that may be used to decide about the policy of displaying the range.
-
-
Method Details
-
addPropertyChangeListener
Adds a property change listener.- Specified by:
addPropertyChangeListener
in interfaceIRangePolicy
- Parameters:
propertyName
- The name of the property to listen on.listener
- The PropertyChangeListener to be added.- See Also:
-
equals
-
firePropertyChange
Fires a property change event to the registered listeners.- Parameters:
property
- one of thePROPERTY_XXX
constants defined inITrace2D
oldvalue
- the old value of the property.newvalue
- the new value of the property.
-
getPropertyChangeListeners
Description copied from interface:IRangePolicy
Returns all property change listeners for the given property.
- Specified by:
getPropertyChangeListeners
in interfaceIRangePolicy
- Parameters:
property
- one of the constants with tehPROPERTY_
prefix defined in this class or subclasses.- Returns:
- the property change listeners for the given property.
- See Also:
-
getRange
Returns the internal range that is used to decide about the policy of displaying the chart.- Specified by:
getRange
in interfaceIRangePolicy
- Returns:
- the internal range that may be taken into account for returning
bounds from
IRangePolicy.getMax(double, double)
andIRangePolicy.getMax(double, double)
.
-
hashCode
public int hashCode() -
removePropertyChangeListener
Description copied from interface:IRangePolicy
Deregisters a property change listener that has been registerd for listening on the given property.- Specified by:
removePropertyChangeListener
in interfaceIRangePolicy
- Parameters:
listener
- a listener that will only be informed if the property identified by the argumentpropertyName
changesproperty
- the property the listener was registered to.- See Also:
-
removePropertyChangeListener
Description copied from interface:IRangePolicy
Removes a property change listener for listening on the given property.
- Specified by:
removePropertyChangeListener
in interfaceIRangePolicy
- Parameters:
property
- one of the constants with tehPROPERTY_
prefix defined in this class or subclasses.listener
- the listener for this property change.- See Also:
-
setRange
Sets the internal range that is used to decide about the policy of displaying the chart.- Specified by:
setRange
in interfaceIRangePolicy
- Parameters:
range
- the internal range that may be taken into account for returning bounds fromIRangePolicy.getMax(double, double)
andIRangePolicy.getMax(double, double)
.
-