com.jrefinery.chart
Class AbstractXYItemRenderer

java.lang.Object
  extended by com.jrefinery.chart.AbstractXYItemRenderer
All Implemented Interfaces:
XYItemRenderer
Direct Known Subclasses:
AreaXYItemRenderer, CandlestickRenderer, HighLowRenderer, SignalRenderer, StandardXYItemRenderer, VerticalXYBarRenderer, WindItemRenderer, XYStepRenderer

public abstract class AbstractXYItemRenderer
extends java.lang.Object
implements XYItemRenderer

A base class that can be used to create new XYItemRenderer implementations.


Field Summary
protected  ChartRenderingInfo info
          An object (optional) that collects information about the chart structure.
protected  java.beans.PropertyChangeSupport listeners
          Support class for the property change listener mechanism.
protected  com.jrefinery.chart.tooltips.XYToolTipGenerator toolTipGenerator
          The tool tip generator.
 
Constructor Summary
protected AbstractXYItemRenderer()
          Default constructor.
protected AbstractXYItemRenderer(com.jrefinery.chart.tooltips.XYToolTipGenerator toolTipGenerator)
          Creates a renderer with the specified tooltip generator.
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
          Adds a property change listener to the renderer.
protected  void firePropertyChanged(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)
          Notifies registered listeners that a property of the renderer has changed.
 com.jrefinery.chart.tooltips.XYToolTipGenerator getToolTipGenerator()
          Returns the tool tip generator.
 void initialise(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D dataArea, XYPlot plot, XYDataset data, ChartRenderingInfo info)
          Initialises the renderer.
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
          Removes a property change listener from the renderer.
 void setToolTipGenerator(com.jrefinery.chart.tooltips.XYToolTipGenerator toolTipGenerator)
          Sets the tool tip generator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.jrefinery.chart.XYItemRenderer
drawItem
 

Field Detail

info

protected ChartRenderingInfo info
An object (optional) that collects information about the chart structure.


toolTipGenerator

protected com.jrefinery.chart.tooltips.XYToolTipGenerator toolTipGenerator
The tool tip generator.


listeners

protected java.beans.PropertyChangeSupport listeners
Support class for the property change listener mechanism.

Constructor Detail

AbstractXYItemRenderer

protected AbstractXYItemRenderer()
Default constructor.


AbstractXYItemRenderer

protected AbstractXYItemRenderer(com.jrefinery.chart.tooltips.XYToolTipGenerator toolTipGenerator)
Creates a renderer with the specified tooltip generator. Storage is allocation for property change listeners.

Parameters:
tooltipGenerator - The tooltip generator (null permitted).
Method Detail

initialise

public void initialise(java.awt.Graphics2D g2,
                       java.awt.geom.Rectangle2D dataArea,
                       XYPlot plot,
                       XYDataset data,
                       ChartRenderingInfo info)
Initialises the renderer. This method will be called before the first item is rendered, giving the renderer an opportunity to initialise any state information it wants to maintain. The renderer can do nothing if it chooses.

Specified by:
initialise in interface XYItemRenderer
Parameters:
g2 - The graphics device.
dataArea - The area inside the axes.
plot - The plot.
data - The data.
info - An optional info collection object to return data back to the caller.

getToolTipGenerator

public com.jrefinery.chart.tooltips.XYToolTipGenerator getToolTipGenerator()
Returns the tool tip generator.

Specified by:
getToolTipGenerator in interface XYItemRenderer
Returns:
The tool tip generator.

setToolTipGenerator

public void setToolTipGenerator(com.jrefinery.chart.tooltips.XYToolTipGenerator toolTipGenerator)
Sets the tool tip generator.

Specified by:
setToolTipGenerator in interface XYItemRenderer
Parameters:
toolTipGenerator - The tool tip generator.

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds a property change listener to the renderer.

Specified by:
addPropertyChangeListener in interface XYItemRenderer
Parameters:
listener - The listener.

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes a property change listener from the renderer.

Specified by:
removePropertyChangeListener in interface XYItemRenderer
Parameters:
listener - The listener.

firePropertyChanged

protected void firePropertyChanged(java.lang.String propertyName,
                                   java.lang.Object oldValue,
                                   java.lang.Object newValue)
Notifies registered listeners that a property of the renderer has changed.

Parameters:
propertyName - The name of the property.
oldValue - The old value.
newValue - The new value.


Copyright © 2003 MBARI.

The Monterey Bay Aquarium Research Institute (MBARI) provides this documentation and code "as is", with no warranty, express or implied, of its quality or consistency. It is provided without support and without obligation on the part of MBARI to assist in its use, correction, modification, or enhancement.