info.monitorenter.gui.chart.rangepolicies
Class ARangePolicy

java.lang.Object
  extended by info.monitorenter.gui.chart.rangepolicies.ARangePolicy
All Implemented Interfaces:
IRangePolicy, java.io.Serializable
Direct Known Subclasses:
RangePolicyFixedViewport, RangePolicyHighestValues, RangePolicyHighestValuesForcedMin, RangePolicyMinimumViewport, RangePolicyUnbounded

public abstract class ARangePolicy
extends java.lang.Object
implements IRangePolicy

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:
Serialized Form

Field Summary
protected  java.beans.PropertyChangeSupport m_propertyChangeSupport
          The instance that add support for firing PropertyChangeEvents and maintaining PropertyChangeListeners.
 
Fields inherited from interface info.monitorenter.gui.chart.IRangePolicy
PROPERTY_RANGE, PROPERTY_RANGE_MAX, PROPERTY_RANGE_MIN
 
Constructor Summary
ARangePolicy()
          Creates a range policy with an unconfigured range ( Range.RANGE_UNBOUNDED).
ARangePolicy(Range range)
          Creates a range policy backed by the given range.
 
Method Summary
 void addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
          Adds a property change listener.
 boolean equals(java.lang.Object obj)
           
protected  void firePropertyChange(java.lang.String property, java.lang.Object oldvalue, java.lang.Object newvalue)
          Fires a property change event to the registered listeners.
 java.beans.PropertyChangeListener[] getPropertyChangeListeners(java.lang.String property)
           Returns all property change listeners for the given property.
 Range getRange()
          Returns the internal range that is used to decide about the policy of displaying the chart.
 int hashCode()
           
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener, java.lang.String property)
          Deregisters a property change listener that has been registerd for listening on the given property.
 void removePropertyChangeListener(java.lang.String property, java.beans.PropertyChangeListener listener)
           Removes a property change listener for listening on the given property.
 void setRange(Range range)
          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 Detail

m_propertyChangeSupport

protected java.beans.PropertyChangeSupport m_propertyChangeSupport
The instance that add support for firing PropertyChangeEvents and maintaining PropertyChangeListeners. PropertyChangeListener instances.

Constructor Detail

ARangePolicy

public ARangePolicy()
Creates a range policy with an unconfigured range ( Range.RANGE_UNBOUNDED).


ARangePolicy

public ARangePolicy(Range range)
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 Detail

addPropertyChangeListener

public final void addPropertyChangeListener(java.lang.String propertyName,
                                            java.beans.PropertyChangeListener listener)
Adds a property change listener.

Specified by:
addPropertyChangeListener in interface IRangePolicy
Parameters:
propertyName - The name of the property to listen on.
listener - The PropertyChangeListener to be added.
See Also:
ITrace2D.addPropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener)

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object
See Also:
Object.equals(java.lang.Object)

firePropertyChange

protected final void firePropertyChange(java.lang.String property,
                                        java.lang.Object oldvalue,
                                        java.lang.Object newvalue)
Fires a property change event to the registered listeners.

Parameters:
property - one of the PROPERTY_XXX constants defined in ITrace2D.
oldvalue - the old value of the property.
newvalue - the new value of the property.

getPropertyChangeListeners

public java.beans.PropertyChangeListener[] getPropertyChangeListeners(java.lang.String property)
Description copied from interface: IRangePolicy

Returns all property change listeners for the given property.

Specified by:
getPropertyChangeListeners in interface IRangePolicy
Parameters:
property - one of the constants with teh PROPERTY_ prefix defined in this class or subclasses.
Returns:
the property change listeners for the given property.
See Also:
IRangePolicy.getPropertyChangeListeners(java.lang.String)

getRange

public final Range getRange()
Returns the internal range that is used to decide about the policy of displaying the chart.

Specified by:
getRange in interface IRangePolicy
Returns:
the internal range that may be taken into account for returning bounds from IRangePolicy.getMax(double, double) and IRangePolicy.getMax(double, double).

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object
See Also:
Object.hashCode()

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener listener,
                                         java.lang.String property)
Description copied from interface: IRangePolicy
Deregisters a property change listener that has been registerd for listening on the given property.

Specified by:
removePropertyChangeListener in interface IRangePolicy
Parameters:
listener - a listener that will only be informed if the property identified by the argument propertyName changes
property - the property the listener was registered to.
See Also:
IRangePolicy.removePropertyChangeListener(java.beans.PropertyChangeListener, java.lang.String)

removePropertyChangeListener

public void removePropertyChangeListener(java.lang.String property,
                                         java.beans.PropertyChangeListener listener)
Description copied from interface: IRangePolicy

Removes a property change listener for listening on the given property.

Specified by:
removePropertyChangeListener in interface IRangePolicy
Parameters:
property - one of the constants with teh PROPERTY_ prefix defined in this class or subclasses.
listener - the listener for this property change.
See Also:
IRangePolicy.removePropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener)

setRange

public void setRange(Range range)
Sets the internal range that is used to decide about the policy of displaying the chart.

Specified by:
setRange in interface IRangePolicy
Parameters:
range - the internal range that may be taken into account for returning bounds from IRangePolicy.getMax(double, double) and IRangePolicy.getMax(double, double).


Copyright © 2001 - 2010 LGPL, All Rights Footloose.