com.jrefinery.chart
Interface XYItemRenderer

All Known Implementing Classes:
AbstractXYItemRenderer, XYStepRenderer, StandardXYItemRenderer, SignalRenderer, HighLowRenderer, AreaXYItemRenderer, WindItemRenderer, VerticalXYBarRenderer, XYDotRenderer, CandlestickRenderer

public interface XYItemRenderer

Interface for rendering the visual representation of a single (x, y) item on an XYPlot.

Author:
DG

Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
          Adds a property change listener to the renderer.
 void drawDomainMarker(java.awt.Graphics2D g2, XYPlot plot, ValueAxis axis, Marker marker, java.awt.geom.Rectangle2D dataArea)
          Draws a vertical line on the chart to represent a 'range marker'.
 void drawItem(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D dataArea, ChartRenderingInfo info, XYPlot plot, ValueAxis domainAxis, ValueAxis rangeAxis, XYDataset data, int series, int item, CrosshairInfo crosshairInfo)
          Called for each item to be plotted.
 void drawRangeMarker(java.awt.Graphics2D g2, XYPlot plot, ValueAxis axis, Marker marker, java.awt.geom.Rectangle2D dataArea)
          Draws a horizontal line across the chart to represent a 'range marker'.
 LegendItem getLegendItem(int series)
          Returns a legend item for a series.
 XYPlot getPlot()
          Returns the plot that this renderer has been assigned to.
 XYToolTipGenerator getToolTipGenerator()
          Returns the tool tip generator for the renderer (possibly null).
 XYURLGenerator getURLGenerator()
          Returns the URL generator for HTML image maps.
 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 setPlot(XYPlot plot)
          Sets the plot that this renderer is assigned to.
 void setToolTipGenerator(XYToolTipGenerator toolTipGenerator)
          Sets the tool tip generator for the renderer.
 void setURLGenerator(XYURLGenerator urlGenerator)
          Sets the URL generator for HTML image maps.
 

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.
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 XYToolTipGenerator getToolTipGenerator()
Returns the tool tip generator for the renderer (possibly null).
Returns:
the tool tip generator.

setToolTipGenerator

public void setToolTipGenerator(XYToolTipGenerator toolTipGenerator)
Sets the tool tip generator for the renderer.
Parameters:
toolTipGenerator - the tool tip generator (null permitted).

getURLGenerator

public XYURLGenerator getURLGenerator()
Returns the URL generator for HTML image maps.
Returns:
the URL generator (possibly null).

setURLGenerator

public void setURLGenerator(XYURLGenerator urlGenerator)
Sets the URL generator for HTML image maps.
Parameters:
urlGenerator - the URL generator (null permitted).

addPropertyChangeListener

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

removePropertyChangeListener

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

drawItem

public void drawItem(java.awt.Graphics2D g2,
                     java.awt.geom.Rectangle2D dataArea,
                     ChartRenderingInfo info,
                     XYPlot plot,
                     ValueAxis domainAxis,
                     ValueAxis rangeAxis,
                     XYDataset data,
                     int series,
                     int item,
                     CrosshairInfo crosshairInfo)
Called for each item to be plotted.
Parameters:
g2 - the graphics device.
dataArea - the area within which the data is being rendered.
info - collects drawing info.
plot - the plot (can be used to obtain standard color information etc).
domainAxis - the domain axis.
rangeAxis - the range axis.
data - the dataset.
series - the series index.
item - the item index.
crosshairInfo - collects information about crosshairs.

getLegendItem

public LegendItem getLegendItem(int series)
Returns a legend item for a series.
Parameters:
series - the series (zero-based index).
Returns:
the legend item.

drawDomainMarker

public void drawDomainMarker(java.awt.Graphics2D g2,
                             XYPlot plot,
                             ValueAxis axis,
                             Marker marker,
                             java.awt.geom.Rectangle2D dataArea)
Draws a vertical line on the chart to represent a 'range marker'.
Parameters:
g2 - the graphics device.
plot - the plot.
axis - the value axis.
marker - the marker line.
dataArea - the axis data area.

drawRangeMarker

public void drawRangeMarker(java.awt.Graphics2D g2,
                            XYPlot plot,
                            ValueAxis axis,
                            Marker marker,
                            java.awt.geom.Rectangle2D dataArea)
Draws a horizontal line across the chart to represent a 'range marker'.
Parameters:
g2 - the graphics device.
plot - the plot.
axis - the value axis.
marker - the marker line.
dataArea - the axis data area.

getPlot

public XYPlot getPlot()
Returns the plot that this renderer has been assigned to.
Returns:
the plot.

setPlot

public void setPlot(XYPlot plot)
Sets the plot that this renderer is assigned to.

This method will be called by the plot class...you do not need to call it yourself.

Parameters:
plot - the plot.