info.monitorenter.gui.chart.traces
Class Trace2DDebugger

java.lang.Object
  extended by info.monitorenter.gui.chart.traces.Trace2DDebugger
All Implemented Interfaces:
ITrace2D, IComparableProperty, PropertyChangeListener, Serializable, EventListener

public class Trace2DDebugger
extends Object
implements ITrace2D

A decorator for any ITrace2D implementation. Useful if your chart looks unexpected and the problem may be related to the data that is added. It prints every point added to the console.

Use it by decorating the ITrace2D you normally use:

      // Create a chart:
      Chart2D chart = new Chart2D();
      // Create an ITrace:
      <b>ITrace2D trace = new Trace2DDebugger(new Trace2DSimple());
      // add data...
      ...
      //
      chart.addTrace(trace);
 

One can use setXRange(Range),setYRange(Range) to let this instance throw an Exception if bounds for legal data are exceeded.

Version:
$Revision: 1.15 $
Author:
Achim Westermann
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface info.monitorenter.gui.chart.ITrace2D
PROPERTY_COLOR, PROPERTY_ERRORBARPOLICY, PROPERTY_ERRORBARPOLICY_CONFIGURATION, PROPERTY_MAX_X, PROPERTY_MAX_Y, PROPERTY_MIN_X, PROPERTY_MIN_Y, PROPERTY_NAME, PROPERTY_PAINTERS, PROPERTY_PHYSICALUNITS, PROPERTY_POINT_CHANGED, PROPERTY_STROKE, PROPERTY_TRACEPOINT, PROPERTY_VISIBLE, PROPERTY_ZINDEX, Z_INDEX_MIN, ZINDEX_MAX
 
Constructor Summary
Trace2DDebugger(ITrace2D debug)
          Creates an inistance to debug the given trace for valid points added.
 
Method Summary
 void addComputingTrace(ITrace2D trace)
          Adds a trace that "should" compute values from the points added via ITrace2D.addPoint(TracePoint2D).
 boolean addErrorBarPolicy(IErrorBarPolicy errorBarPolicy)
          Adds the given error bar policy to the internal set of error bar policies.
 boolean addPoint(double x, double y)
          Adds a tracepoint to the internal data.
 boolean addPoint(TracePoint2D p)
          Adds the given TracePoint2D to the internal data.
 void addPropertyChangeListener(String propertyName, PropertyChangeListener listener)
          Registers a property change listener that will be informed about changes of the property identified by the given propertyName.
 boolean addTracePainter(ITracePainter painter)
          Adds the given trace painter to the internal set of trace painters.
 boolean containsTracePainter(ITracePainter painter)
          Returns true if the given painter is contained in this compound painter.
 boolean equals(Object obj)
           
 void firePointChanged(TracePoint2D changed, int state)
          Method to trigger by TracePoint2D.setLocation(double, double), ITrace2D.addPoint(TracePoint2D) or ITrace2D.removePoint(TracePoint2D).
 Color getColor()
          Because the color is data common to a trace of a Chart2D it is stored here.
 Number getComparableProperty()
          Returns a Number this instance wants to be compared by.
 Set getErrorBarPolicies()
          Returns the Set<IErrorBarPolicy> that will be used to render error bars for this trace.
 boolean getHasErrorBars()
          Returns true if this trace has error bars configured.
 String getLabel()
          Callback method for the Chart2D that returns a String describing the label of the ITrace2D that will be displayed below the drawing area of the Chart2D.
 int getMaxSize()
           Returns the maximum amount of TracePoint2D instances that may be added.
 double getMaxX()
          Returns the maximum value to be displayed on the x- axis of the Chart2D.
 double getMaxY()
          Returns the maximum value to be displayed on the y- axis of the Chart2D.
 double getMinX()
          Returns the minimum value to be displayed on the x- axis of the Chart2D.
 double getMinY()
          Returns the minimum value to be displayed on the y- axis of the Chart2D.
 String getName()
          Returns the name of this trace.
 String getPhysicalUnits()
          Returns the concatenation [x: "ITrace2D.getPhysicalUnitsX()", y: "ITrace2D.getPhysicalUnitsY()"].
 String getPhysicalUnitsX()
          Returns the physical unit string value for the x dimension.
 String getPhysicalUnitsY()
          Returns the physical unit string value for the y dimension.
 PropertyChangeListener[] getPropertyChangeListeners(String property)
          Returns all property change listeners for the given property.
 Chart2D getRenderer()
           
 int getSize()
          Returns the amount of TracePoint2D instances currently contained.
 Stroke getStroke()
          Returns the Stroke that is used to render this instance.
 Set getTracePainters()
          Returns the Set<ITracePainter> that will be used to paint this trace.
 Range getXRange()
          Returns the range of valid points of the x axis.
 Range getYRange()
          Returns the range of valid points of the y axis.
 Integer getZIndex()
          The z-index defines the order in which this instance will be painted.
 int hashCode()
           
 boolean isEmpty()
          Returns false if internal TracePoint2D instances are contained or true if not.
 boolean isVisible()
          Returns true if this instance should be rendered.
 Iterator iterator()
          Returns an Iterator over the internal TracePoint2D instances.
 void propertyChange(PropertyChangeEvent evt)
           
 void removeAllPoints()
          Removes all internal TracePoint2D.
 boolean removeComputingTrace(ITrace2D trace)
          Remove a trace that "should" compute values from the points added via ITrace2D.addPoint(TracePoint2D).
 boolean removeErrorBarPolicy(IErrorBarPolicy errorBarPolicy)
          Removes the given error bar policy from the internal set of error bar policies.
 boolean removePoint(TracePoint2D point)
          Removes the given point from this trace.
 void removePropertyChangeListener(PropertyChangeListener listener)
          Deregisters a property change listener that has been registerd for listening on all properties.
 void removePropertyChangeListener(String property, PropertyChangeListener listener)
          Removes a property change listener for listening on the given property.
 boolean removeTracePainter(ITracePainter painter)
          Removes the given trace painter, if it's class is contained and if more painters are remaining.
 void setColor(Color color)
          Set a java.awt.Color for this trace.
 void setComparableProperty(Number n)
          Set the comparable Number.
 Set setErrorBarPolicy(IErrorBarPolicy errorBarPolicy)
          Replaces all internal error bar policies by the new one.
 void setName(String name)
          Assingns a specific name to the ITrace2D which will be displayed by the Chart2D.
 void setPhysicalUnits(String xunit, String yunit)
          Assings a specific String representing the physical unit to the ITrace2D (e.g.
 void setRenderer(Chart2D renderer)
          This is a callback from Chart2D.addTrace(ITrace2D) and must not be invoked from elswhere (needed for synchronization).
 void setStroke(Stroke stroke)
          Allows to specify the rendering of the ITrace2D.
 Set setTracePainter(ITracePainter painter)
          Replaces all internal trace painters by the new one.
 void setVisible(boolean visible)
          Set the visibility.
 void setXRange(Range range)
          Set the valid range for x values.
 void setYRange(Range range)
          Set the valid range for y values.
 void setZIndex(Integer zIndex)
          Sets the internal z-index property.
 boolean showsErrorBars()
          Tests whether error bars are painted by this trace.
 boolean showsNegativeXErrorBars()
          Tests whether error bars in negative x direction are painted by this trace.
 boolean showsNegativeYErrorBars()
          Tests whether error bars in negative y direction are painted by this trace.
 boolean showsPositiveXErrorBars()
          Tests whether error bars in positive x direction are painted by this trace.
 boolean showsPositiveYErrorBars()
          Tests whether error bars in positive y direction are painted by this trace.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Trace2DDebugger

public Trace2DDebugger(ITrace2D debug)
Creates an inistance to debug the given trace for valid points added.

Parameters:
debug - the trace to debug.
Method Detail

addComputingTrace

public void addComputingTrace(ITrace2D trace)
Description copied from interface: ITrace2D
Adds a trace that "should" compute values from the points added via ITrace2D.addPoint(TracePoint2D).

The given trace will be informed in case an add operation on this trace succeeds via ITrace2D.addPoint(TracePoint2D).

Specified by:
addComputingTrace in interface ITrace2D
Parameters:
trace - the trace that will calculate it's points from the added points of this trace.
See Also:
ITrace2D.addComputingTrace(info.monitorenter.gui.chart.ITrace2D)

addErrorBarPolicy

public boolean addErrorBarPolicy(IErrorBarPolicy errorBarPolicy)
Description copied from interface: ITrace2D
Adds the given error bar policy to the internal set of error bar policies.

It will be the last error bar policy to render (most forward on screen).

Specified by:
addErrorBarPolicy in interface ITrace2D
Parameters:
errorBarPolicy - the error bar policy to add for rendering this trace's error bars.
Returns:
true if the painter was added (same instance was not contained before).
See Also:
ITrace2D.addErrorBarPolicy(info.monitorenter.gui.chart.IErrorBarPolicy)

addPoint

public boolean addPoint(double x,
                        double y)
Description copied from interface: ITrace2D
Adds a tracepoint to the internal data.

Specified by:
addPoint in interface ITrace2D
Parameters:
x - the x-value of the point to add.
y - the y-value of the point to add.
Returns:
true if the operation was successful, false else.
See Also:
ITrace2D.addPoint(double, double)

addPoint

public boolean addPoint(TracePoint2D p)
Description copied from interface: ITrace2D
Adds the given TracePoint2D to the internal data.

Try to pass instances of TracePoint2D to this instance instead of invoking ITrace2D.addPoint(double, double) to increase performace. Else the given point has to be copied into such an instance from the other method and delegated to this method.

Implementations decide wether the point will be accepted or not. So they have to update the internal properties minX, maxX,maxY and minY and also care about firing property change events for those properties by method PropertyChangeSupport.firePropertyChange(java.beans.PropertyChangeEvent).

Specified by:
addPoint in interface ITrace2D
Parameters:
p - the point to add.
Returns:
true if the operation was successful, false else.
See Also:
ITrace2D.addPoint(TracePoint2D)

addPropertyChangeListener

public void addPropertyChangeListener(String propertyName,
                                      PropertyChangeListener listener)
Description copied from interface: ITrace2D
Registers a property change listener that will be informed about changes of the property identified by the given propertyName.

Specified by:
addPropertyChangeListener in interface ITrace2D
Parameters:
propertyName - the name of the property the listener is interested in
listener - a listener that will only be informed if the property identified by the argument propertyName changes
See Also:
ITrace2D.addPropertyChangeListener(String, PropertyChangeListener)

addTracePainter

public boolean addTracePainter(ITracePainter painter)
Description copied from interface: ITrace2D
Adds the given trace painter to the internal set of trace painters.

It will be the last painter to paint (most forward).

Specified by:
addTracePainter in interface ITrace2D
Parameters:
painter - the painter to add for rendering this trace.
Returns:
true if the painter was added (class of instance not contained before).
See Also:
ITrace2D.addTracePainter(info.monitorenter.gui.chart.ITracePainter)

containsTracePainter

public boolean containsTracePainter(ITracePainter painter)
Description copied from interface: ITrace2D
Returns true if the given painter is contained in this compound painter.

Specified by:
containsTracePainter in interface ITrace2D
Parameters:
painter - the painter to check wether it is contained.
Returns:
true if the given painter is contained in this compound painter.
See Also:
ITrace2D.containsTracePainter(info.monitorenter.gui.chart.ITracePainter)

equals

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

firePointChanged

public void firePointChanged(TracePoint2D changed,
                             int state)
Description copied from interface: ITrace2D
Method to trigger by TracePoint2D.setLocation(double, double), ITrace2D.addPoint(TracePoint2D) or ITrace2D.removePoint(TracePoint2D).

Bound checks are performed and property change events for the properties ITrace2D.PROPERTY_MAX_X, ITrace2D.PROPERTY_MIN_X, ITrace2D.PROPERTY_MAX_Y and ITrace2D.PROPERTY_MIN_Y are fired if the add bounds have changed due to the modification of the point.

Specified by:
firePointChanged in interface ITrace2D
Parameters:
changed - the point that has been changed which may be a newly added point (from ITrace2D.addPoint(TracePoint2D), a removed one or a modified one.
state - one of {TracePoint2D.STATE_ADDED, TracePoint2D.STATE_CHANGED, TracePoint2D.STATE_REMOVED} to inform about the type of change.
See Also:
ITrace2D.firePointChanged(info.monitorenter.gui.chart.TracePoint2D, int)

getColor

public Color getColor()
Description copied from interface: ITrace2D
Because the color is data common to a trace of a Chart2D it is stored here.

On the other hand only the corresponding Chart2D may detect the same color chosen for different IChart2D instances to be displayed. Therefore it is allowed to return null. This is a message to the Chart2D to leave it the choice of the color. Then the Chart2D will chose a color not owned by another ITrace2D instance managed and assign it to the null- returning instance.

The Chart2D will often call this method. So try to cache the value in implementation and only check on modifications of TracePoint instances or on add- invocations for changes.

Specified by:
getColor in interface ITrace2D
Returns:
The chosen java.awt.Color or null if the decision for the color should be made by the corresponding Chart2D.
See Also:
ITrace2D.getColor()

getComparableProperty

public Number getComparableProperty()
Description copied from interface: IComparableProperty
Returns a Number this instance wants to be compared by.

Specified by:
getComparableProperty in interface IComparableProperty
Returns:
a Number this instance wants to be compared by.
See Also:
IComparableProperty.getComparableProperty()

getErrorBarPolicies

public Set getErrorBarPolicies()
Description copied from interface: ITrace2D
Returns the Set<IErrorBarPolicy> that will be used to render error bars for this trace.

Specified by:
getErrorBarPolicies in interface ITrace2D
Returns:
the Set<IErrorBarPolicy> that will be used to render error bars for this trace.
See Also:
ITrace2D.getErrorBarPolicies()

getHasErrorBars

public boolean getHasErrorBars()
Description copied from interface: ITrace2D
Returns true if this trace has error bars configured.

If this returns false, no error bars will be painted for this trace.

Specified by:
getHasErrorBars in interface ITrace2D
Returns:
true if this trace has error bars configured.
See Also:
ITrace2D.getHasErrorBars()

getLabel

public String getLabel()
Description copied from interface: ITrace2D
Callback method for the Chart2D that returns a String describing the label of the ITrace2D that will be displayed below the drawing area of the Chart2D.

This method should be implemented and finalized ASAP in the inheritance tree and rely on the property name and physicalUnits.

Specified by:
getLabel in interface ITrace2D
Returns:
a String describing the Axis being accessed.
See Also:
ITrace2D.getLabel()

getMaxSize

public int getMaxSize()
Description copied from interface: ITrace2D

Returns the maximum amount of TracePoint2D instances that may be added. For implementations that limit the maximum amount this is a reasonable amount. Non-limiting implementations should return Integer.MAX_VALUE. This allows to detect the unlimitedness. Of course no implementation could store that amount of points.

Specified by:
getMaxSize in interface ITrace2D
Returns:
The maximum amount of TracePoint2D instances that may be added.
See Also:
ITrace2D.getMaxSize()

getMaxX

public double getMaxX()
Description copied from interface: ITrace2D
Returns the maximum value to be displayed on the x- axis of the Chart2D. Implementations should be synchronized for multithreaded use. No exception is thrown. In case of empty data (no tracepoints) 0 should be returned, to let the Chart2D know.

The Chart2D will often call this method. So try to cache the value in implementation and only check on modifications of TracePoint instances or on add- invocations for changes.

Specified by:
getMaxX in interface ITrace2D
Returns:
the maximum value of the internal data for the x- dimension.
See Also:
ITrace2D.getMaxX()

getMaxY

public double getMaxY()
Description copied from interface: ITrace2D
Returns the maximum value to be displayed on the y- axis of the Chart2D. Implementations should be synchronized for multithreaded use. No exception is thrown. In case of empty data (no tracepoints) 0 should be returned. (watch division with zero).

Specified by:
getMaxY in interface ITrace2D
Returns:
the maximum value of the internal data for the y- dimension.
See Also:
ITrace2D.getMaxY()

getMinX

public double getMinX()
Description copied from interface: ITrace2D
Returns the minimum value to be displayed on the x- axis of the Chart2D.

Implementations should be synchronized for multithreaded use. No exception is thrown. In case of empty data (no tracepoints) 0 should be returned. (watch division with zero).

The Chart2D will often call this method. So try to cache the value in implementation and only check on modifications of TracePoint instances or on add- invocations for changes.

Specified by:
getMinX in interface ITrace2D
Returns:
the minimum value of the internal data for the x- dimension.
See Also:
ITrace2D.getMinX()

getMinY

public double getMinY()
Description copied from interface: ITrace2D
Returns the minimum value to be displayed on the y- axis of the Chart2D.

Implementations should be synchronized for multithreaded use. No exception is thrown. In case of empty data (no tracepoints) 0 should be returned. (watch division with zero).

The Chart2D will often call this method. So try to cache the value in implementation and only check on modifications of TracePoint instances or on add- invocations for changes.

Specified by:
getMinY in interface ITrace2D
Returns:
the minimum value of the internal data for the y- dimension.
See Also:
ITrace2D.getMinY()

getName

public String getName()
Description copied from interface: ITrace2D
Returns the name of this trace.

Specified by:
getName in interface ITrace2D
Returns:
the name of this trace.
See Also:
ITrace2D.getName()

getPhysicalUnits

public String getPhysicalUnits()
Description copied from interface: ITrace2D
Returns the concatenation [x: "ITrace2D.getPhysicalUnitsX()", y: "ITrace2D.getPhysicalUnitsY()"].

Specified by:
getPhysicalUnits in interface ITrace2D
Returns:
the concatenation [x: "ITrace2D.getPhysicalUnitsX()", y: "ITrace2D.getPhysicalUnitsY()"].
See Also:
ITrace2D.getPhysicalUnits()

getPhysicalUnitsX

public String getPhysicalUnitsX()
Description copied from interface: ITrace2D
Returns the physical unit string value for the x dimension.

Specified by:
getPhysicalUnitsX in interface ITrace2D
Returns:
the physical unit string value for the x dimension.
See Also:
ITrace2D.getPhysicalUnitsX()

getPhysicalUnitsY

public String getPhysicalUnitsY()
Description copied from interface: ITrace2D
Returns the physical unit string value for the y dimension.

Specified by:
getPhysicalUnitsY in interface ITrace2D
Returns:
the physical unit string value for the y dimension.
See Also:
ITrace2D.getPhysicalUnitsY()

getPropertyChangeListeners

public PropertyChangeListener[] getPropertyChangeListeners(String property)
Description copied from interface: ITrace2D
Returns all property change listeners for the given property.

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

getRenderer

public Chart2D getRenderer()
Specified by:
getRenderer in interface ITrace2D
Returns:
Returns the renderer.
See Also:
ITrace2D.getRenderer()

getSize

public int getSize()
Description copied from interface: ITrace2D
Returns the amount of TracePoint2D instances currently contained.

Specified by:
getSize in interface ITrace2D
Returns:
The amount of TracePoint2D instances currently contained.
See Also:
ITrace2D.getSize()

getStroke

public Stroke getStroke()
Description copied from interface: ITrace2D
Returns the Stroke that is used to render this instance.

Specified by:
getStroke in interface ITrace2D
Returns:
the Stroke that is used to render this instance.
See Also:
ITrace2D.getStroke()

getTracePainters

public final Set getTracePainters()
Description copied from interface: ITrace2D
Returns the Set<ITracePainter> that will be used to paint this trace.

Specified by:
getTracePainters in interface ITrace2D
Returns:
the Set<ITracePainter> that will be used to paint this trace.
See Also:
ITrace2D.getTracePainters()

getXRange

public Range getXRange()
Returns the range of valid points of the x axis.

Returns:
the range of valid points of the x axis.

getYRange

public Range getYRange()
Returns the range of valid points of the y axis.

Returns:
the range of valid points of the y axis.

getZIndex

public Integer getZIndex()
Description copied from interface: ITrace2D
The z-index defines the order in which this instance will be painted.

A lower value will bring it more "to the front".

Specified by:
getZIndex in interface ITrace2D
Returns:
the z-index that will define the order in which this instance will be painted.
See Also:
ITrace2D.getZIndex()

hashCode

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

isEmpty

public boolean isEmpty()
Description copied from interface: ITrace2D
Returns false if internal TracePoint2D instances are contained or true if not.

Specified by:
isEmpty in interface ITrace2D
Returns:
false if internal TracePoint2D instances are contained or true if not.
See Also:
ITrace2D.isEmpty()

isVisible

public boolean isVisible()
Description copied from interface: ITrace2D
Returns true if this instance should be rendered.

Specified by:
isVisible in interface ITrace2D
Returns:
true if this instance should be rendered.
See Also:
ITrace2D.isVisible()

iterator

public Iterator iterator()
Description copied from interface: ITrace2D
Returns an Iterator over the internal TracePoint2D instances.

Implementations should be synchronized. This method is meant to allow modifications of the intenal TracePoint2D instances, so the original points should be returned.

There is no guarantee that changes made to the contained tracepoints will be reflected in the display immediately. The order the iterator returns the TracePoint2D instances decides how the Chart2D will paint the trace.

Specified by:
iterator in interface ITrace2D
Returns:
an Iterator over the internal TracePoint2D instances.
See Also:
ITrace2D.iterator()

propertyChange

public void propertyChange(PropertyChangeEvent evt)
Specified by:
propertyChange in interface PropertyChangeListener
See Also:
PropertyChangeListener.propertyChange(java.beans.PropertyChangeEvent)

removeAllPoints

public void removeAllPoints()
Description copied from interface: ITrace2D
Removes all internal TracePoint2D.ITrace2D.isEmpty() will return true afterwards.

Specified by:
removeAllPoints in interface ITrace2D
See Also:
ITrace2D.removeAllPoints()

removeComputingTrace

public boolean removeComputingTrace(ITrace2D trace)
Description copied from interface: ITrace2D
Remove a trace that "should" compute values from the points added via ITrace2D.addPoint(TracePoint2D).

Specified by:
removeComputingTrace in interface ITrace2D
Parameters:
trace - the trace that will calculate it's points from the added points of this trace.
Returns:
true if the given trace was removed (recognized by the means of Object.equals(Object)).
See Also:
ITrace2D.removeComputingTrace(info.monitorenter.gui.chart.ITrace2D)

removeErrorBarPolicy

public boolean removeErrorBarPolicy(IErrorBarPolicy errorBarPolicy)
Description copied from interface: ITrace2D
Removes the given error bar policy from the internal set of error bar policies.

Specified by:
removeErrorBarPolicy in interface ITrace2D
Parameters:
errorBarPolicy - the error bar policy to remove.
Returns:
true if the painter was removed (same instance contained before).
See Also:
ITrace2D.removeErrorBarPolicy(info.monitorenter.gui.chart.IErrorBarPolicy)

removePoint

public boolean removePoint(TracePoint2D point)
Description copied from interface: ITrace2D
Removes the given point from this trace.

Specified by:
removePoint in interface ITrace2D
Parameters:
point - the point to remove.
Returns:
true if the remove opertation was successful, false else.
See Also:
ITrace2D.removePoint(info.monitorenter.gui.chart.TracePoint2D)

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener listener)
Description copied from interface: ITrace2D
Deregisters a property change listener that has been registerd for listening on all properties.

Specified by:
removePropertyChangeListener in interface ITrace2D
Parameters:
listener - a listener that will only be informed if the property identified by the argument propertyName changes
See Also:
ITrace2D.removePropertyChangeListener(java.beans.PropertyChangeListener)

removePropertyChangeListener

public void removePropertyChangeListener(String property,
                                         PropertyChangeListener listener)
Description copied from interface: ITrace2D
Removes a property change listener for listening on the given property.

Specified by:
removePropertyChangeListener in interface ITrace2D
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:
ITrace2D.removePropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener)

removeTracePainter

public boolean removeTracePainter(ITracePainter painter)
Description copied from interface: ITrace2D
Removes the given trace painter, if it's class is contained and if more painters are remaining.

Specified by:
removeTracePainter in interface ITrace2D
Parameters:
painter - the trace painter to remove.
Returns:
true if a trace painter of the class of the given argument was removed.
See Also:
ITrace2D.removeTracePainter(info.monitorenter.gui.chart.ITracePainter)

setColor

public void setColor(Color color)
Description copied from interface: ITrace2D
Set a java.awt.Color for this trace.

Specified by:
setColor in interface ITrace2D
Parameters:
color - the Color to set.
See Also:
ITrace2D.setColor(java.awt.Color)

setComparableProperty

public void setComparableProperty(Number n)
Description copied from interface: IComparableProperty
Set the comparable Number.

Note that a ComparableProperty has to allow by contract that it's Number property it lays open to be compared by has to be modifiable from outside!

Specified by:
setComparableProperty in interface IComparableProperty
Parameters:
n - the comparable number.
See Also:
IComparableProperty.setComparableProperty(java.lang.Number)

setErrorBarPolicy

public Set setErrorBarPolicy(IErrorBarPolicy errorBarPolicy)
Description copied from interface: ITrace2D
Replaces all internal error bar policies by the new one.

Specified by:
setErrorBarPolicy in interface ITrace2D
Parameters:
errorBarPolicy - the new sole painter to use.
Returns:
the Set<IErrorBarPolicy> that was used before.
See Also:
ITrace2D.setErrorBarPolicy(info.monitorenter.gui.chart.IErrorBarPolicy)

setName

public void setName(String name)
Description copied from interface: ITrace2D
Assingns a specific name to the ITrace2D which will be displayed by the Chart2D.

Specified by:
setName in interface ITrace2D
Parameters:
name - the name for this trace.
See Also:
ITrace2D.setName(java.lang.String)

setPhysicalUnits

public void setPhysicalUnits(String xunit,
                             String yunit)
Description copied from interface: ITrace2D
Assings a specific String representing the physical unit to the ITrace2D (e.g. Volt, Ohm, lux, ...) which will be displayed by the Chart2D

Specified by:
setPhysicalUnits in interface ITrace2D
Parameters:
xunit - the physical unit for the x axis.
yunit - the physical unit for the y axis.
See Also:
ITrace2D.setPhysicalUnits(java.lang.String, java.lang.String)

setRenderer

public void setRenderer(Chart2D renderer)
Description copied from interface: ITrace2D
This is a callback from Chart2D.addTrace(ITrace2D) and must not be invoked from elswhere (needed for synchronization).

Not the best design to put this to an interface, but Char2D should handle this interface only.

Specified by:
setRenderer in interface ITrace2D
Parameters:
renderer - The renderer to set.
See Also:
ITrace2D.setRenderer(info.monitorenter.gui.chart.Chart2D)

setStroke

public void setStroke(Stroke stroke)
Description copied from interface: ITrace2D
Allows to specify the rendering of the ITrace2D. This Stroke will be assigned to the Graphics2D by the rendering Chart2D when painting this instance.

Specified by:
setStroke in interface ITrace2D
Parameters:
stroke - the stroke to use for painting this trace.
See Also:
ITrace2D.setStroke(java.awt.Stroke)

setTracePainter

public final Set setTracePainter(ITracePainter painter)
Description copied from interface: ITrace2D
Replaces all internal trace painters by the new one.

Specified by:
setTracePainter in interface ITrace2D
Parameters:
painter - the new sole painter to use.
Returns:
the Set<ITracePainter> that was used before.
See Also:
ITrace2D.setTracePainter(info.monitorenter.gui.chart.ITracePainter)

setVisible

public void setVisible(boolean visible)
Description copied from interface: ITrace2D
Set the visibility. If argument is false, this instance will not be rendered by a Chart2D.

Specified by:
setVisible in interface ITrace2D
Parameters:
visible - true if this trace should be painted, false else.
See Also:
ITrace2D.setVisible(boolean)

setXRange

public void setXRange(Range range)
Set the valid range for x values. If a point breaks these bounds an IllegalArgumentException will be thrown.

Parameters:
range - The xRange to set.

setYRange

public void setYRange(Range range)
Set the valid range for y values. If a point breaks these bounds an IllegalArgumentException will be thrown.

Parameters:
range - The yRange to set.

setZIndex

public void setZIndex(Integer zIndex)
Description copied from interface: ITrace2D
Sets the internal z-index property. This decides the order in which different traces within the same Chart2D are painted.

The lower the given value is the more this trace will be brought to front.

The value must not be lower than ITrace2D.Z_INDEX_MIN(0) and higher than ITrace2D.ZINDEX_MAX(100).

This might not be tested for increased performance but ignoring these bounds may result in wrong ordering of display.

Specified by:
setZIndex in interface ITrace2D
Parameters:
zIndex - the z index of this trace - the lower the value the more in front the trace will appear amongst other traces in the same chart.
See Also:
ITrace2D.setZIndex(java.lang.Integer)

showsErrorBars

public boolean showsErrorBars()
Description copied from interface: ITrace2D
Tests whether error bars are painted by this trace.

Returns true if

Specified by:
showsErrorBars in interface ITrace2D
Returns:
true if this trace renders error bars.
See Also:
ITrace2D.showsErrorBars()

showsNegativeXErrorBars

public boolean showsNegativeXErrorBars()
Description copied from interface: ITrace2D
Tests whether error bars in negative x direction are painted by this trace.

Returns true if

Specified by:
showsNegativeXErrorBars in interface ITrace2D
Returns:
true if this trace renders error bars in negative x direction.
See Also:
ITrace2D.showsNegativeXErrorBars()

showsNegativeYErrorBars

public boolean showsNegativeYErrorBars()
Description copied from interface: ITrace2D
Tests whether error bars in negative y direction are painted by this trace.

Returns true if

Specified by:
showsNegativeYErrorBars in interface ITrace2D
Returns:
true if this trace renders error bars in negative y direction.
See Also:
ITrace2D.showsNegativeYErrorBars()

showsPositiveXErrorBars

public boolean showsPositiveXErrorBars()
Description copied from interface: ITrace2D
Tests whether error bars in positive x direction are painted by this trace.

Returns true if

Specified by:
showsPositiveXErrorBars in interface ITrace2D
Returns:
true if this trace renders error bars in positive x direction.
See Also:
ITrace2D.showsPositiveXErrorBars()

showsPositiveYErrorBars

public boolean showsPositiveYErrorBars()
Description copied from interface: ITrace2D
Tests whether error bars in positive y direction are painted by this trace.

Returns true if

Specified by:
showsPositiveYErrorBars in interface ITrace2D
Returns:
true if this trace renders error bars in positive y direction.
See Also:
ITrace2D.showsPositiveYErrorBars()

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()


Copyright © 2001 - 2007 LGPL, All Rights Footloose.