|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Interface for rendering the visual representation of a single (x, y) item on an
XYPlot
.
To support cloning charts, it is recommended that renderers implement both the Cloneable
and PublicCloneable
interfaces.
Method Summary | |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds a property change listener to the renderer. |
void |
drawDomainGridLine(java.awt.Graphics2D g2,
XYPlot plot,
ValueAxis axis,
java.awt.geom.Rectangle2D dataArea,
double value)
Draws a grid line against the domain axis. |
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,
XYItemRendererState state,
java.awt.geom.Rectangle2D dataArea,
PlotRenderingInfo info,
XYPlot plot,
ValueAxis domainAxis,
ValueAxis rangeAxis,
XYDataset dataset,
int series,
int item,
CrosshairInfo crosshairInfo,
int pass)
Called for each item to be plotted. |
void |
drawRangeGridLine(java.awt.Graphics2D g2,
XYPlot plot,
ValueAxis axis,
java.awt.geom.Rectangle2D dataArea,
double value)
Draws a grid line against the range axis. |
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'. |
void |
fillDomainGridBand(java.awt.Graphics2D g2,
XYPlot plot,
ValueAxis axis,
java.awt.geom.Rectangle2D dataArea,
double start,
double end)
Fills a band between two values on the axis. |
void |
fillRangeGridBand(java.awt.Graphics2D g2,
XYPlot plot,
ValueAxis axis,
java.awt.geom.Rectangle2D dataArea,
double start,
double end)
Fills a band between two values on the range axis. |
java.awt.Stroke |
getBaseStroke()
Returns the base stroke. |
java.awt.Paint |
getItemOutlinePaint(int series,
int item)
Returns the paint used to outline an item. |
java.awt.Paint |
getItemPaint(int series,
int item)
Returns the paint used to fill an item. |
java.awt.Shape |
getItemShape(int series,
int item)
Returns the shape for an item. |
java.awt.Stroke |
getItemStroke(int series,
int item)
Returns the stroke for an item. |
LegendItem |
getLegendItem(int datasetIndex,
int series)
Returns a legend item for a series from a dataset. |
int |
getPassCount()
Returns the number of passes through the data required by the renderer. |
XYPlot |
getPlot()
Returns the plot that this renderer has been assigned to. |
RangeType |
getRangeType()
Returns the range type for the renderer. |
java.awt.Paint |
getSeriesOutlinePaint(int series)
Returns the paint used to outline items in a series. |
java.awt.Paint |
getSeriesPaint(int series)
Returns the paint used to fill items in a series. |
java.awt.Shape |
getSeriesShape(int series)
Returns the shape for a series. |
java.awt.Stroke |
getSeriesStroke(int series)
Returns the stroke for a series. |
XYToolTipGenerator |
getToolTipGenerator()
Returns the tool tip generator for the renderer (possibly null). |
XYURLGenerator |
getURLGenerator()
Returns the URL generator for HTML image maps. |
XYItemRendererState |
initialise(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D dataArea,
XYPlot plot,
XYDataset data,
PlotRenderingInfo info)
Initialises the renderer then returns the number of 'passes' through the data that the renderer will require (usually just one). |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes a property change listener from the renderer. |
void |
setBaseStroke(java.awt.Stroke stroke)
Sets the base stroke. |
void |
setPlot(XYPlot plot)
Sets the plot that this renderer is assigned to. |
void |
setSeriesPaint(int series,
java.awt.Paint paint)
Sets the paint for a series in the primary dataset. |
void |
setSeriesStroke(int series,
java.awt.Stroke stroke)
Sets the stroke for a series in the primary dataset. |
void |
setStroke(java.awt.Stroke stroke)
Sets the stroke for ALL series (optional). |
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 |
public XYItemRendererState initialise(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D dataArea, XYPlot plot, XYDataset data, PlotRenderingInfo info)
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.
public int getPassCount()
public XYToolTipGenerator getToolTipGenerator()
public void setToolTipGenerator(XYToolTipGenerator toolTipGenerator)
toolTipGenerator
- the tool tip generator (null permitted).public XYURLGenerator getURLGenerator()
public void setURLGenerator(XYURLGenerator urlGenerator)
urlGenerator
- the URL generator (null permitted).public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- the listener.public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- the listener.public java.awt.Paint getItemPaint(int series, int item)
series
- the series index (zero-based).item
- the item index (zero-based).
public java.awt.Paint getSeriesPaint(int series)
series
- the series index (zero-based).
public void setSeriesPaint(int series, java.awt.Paint paint)
series
- the series index (zero-based).paint
- the paint.public java.awt.Paint getItemOutlinePaint(int series, int item)
series
- the series index (zero-based).item
- the item index (zero-based).
public java.awt.Paint getSeriesOutlinePaint(int series)
series
- the series index (zero-based).
public java.awt.Stroke getItemStroke(int series, int item)
series
- the series index (zero-based).item
- the item index (zero-based).
public java.awt.Stroke getSeriesStroke(int series)
series
- the series index (zero-based).
public void setStroke(java.awt.Stroke stroke)
stroke
- the stroke.public void setSeriesStroke(int series, java.awt.Stroke stroke)
series
- the series index (zero-based).stroke
- the stroke.public java.awt.Stroke getBaseStroke()
public void setBaseStroke(java.awt.Stroke stroke)
stroke
- the stroke.public java.awt.Shape getItemShape(int series, int item)
series
- the series index (zero-based).item
- the item index (zero-based).
public java.awt.Shape getSeriesShape(int series)
series
- the series index (zero-based).
public void drawItem(java.awt.Graphics2D g2, XYItemRendererState state, java.awt.geom.Rectangle2D dataArea, PlotRenderingInfo info, XYPlot plot, ValueAxis domainAxis, ValueAxis rangeAxis, XYDataset dataset, int series, int item, CrosshairInfo crosshairInfo, int pass)
The XYPlot
can make multiple passes through the dataset, depending on the value
returned by the renderer's initialise(java.awt.Graphics2D, java.awt.geom.Rectangle2D, org.jfree.chart.plot.XYPlot, org.jfree.data.XYDataset, org.jfree.chart.plot.PlotRenderingInfo)
method.
g2
- the graphics device.state
- the renderer state.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.dataset
- the dataset.series
- the series index (zero-based).item
- the item index (zero-based).crosshairInfo
- collects information about crosshairs.pass
- the pass index.public LegendItem getLegendItem(int datasetIndex, int series)
datasetIndex
- the dataset index.series
- the series (zero-based index).
public void fillDomainGridBand(java.awt.Graphics2D g2, XYPlot plot, ValueAxis axis, java.awt.geom.Rectangle2D dataArea, double start, double end)
g2
- the graphics device.plot
- the plot.axis
- the domain axis.dataArea
- the data area.start
- the start value.end
- the end value.public void fillRangeGridBand(java.awt.Graphics2D g2, XYPlot plot, ValueAxis axis, java.awt.geom.Rectangle2D dataArea, double start, double end)
g2
- the graphics device.plot
- the plot.axis
- the range axis.dataArea
- the data area.start
- the start value.end
- the end value.public void drawDomainGridLine(java.awt.Graphics2D g2, XYPlot plot, ValueAxis axis, java.awt.geom.Rectangle2D dataArea, double value)
g2
- the graphics device.plot
- the plot.axis
- the value axis.dataArea
- the area for plotting data (not yet adjusted for any 3D effect).value
- the value.public void drawRangeGridLine(java.awt.Graphics2D g2, XYPlot plot, ValueAxis axis, java.awt.geom.Rectangle2D dataArea, double value)
g2
- the graphics device.plot
- the plot.axis
- the value axis.dataArea
- the area for plotting data (not yet adjusted for any 3D effect).value
- the value.public void drawDomainMarker(java.awt.Graphics2D g2, XYPlot plot, ValueAxis axis, Marker marker, java.awt.geom.Rectangle2D dataArea)
g2
- the graphics device.plot
- the plot.axis
- the value axis.marker
- the marker line.dataArea
- the axis data area.public void drawRangeMarker(java.awt.Graphics2D g2, XYPlot plot, ValueAxis axis, Marker marker, java.awt.geom.Rectangle2D dataArea)
g2
- the graphics device.plot
- the plot.axis
- the value axis.marker
- the marker line.dataArea
- the axis data area.public XYPlot getPlot()
public void setPlot(XYPlot plot)
This method will be called by the plot class...you do not need to call it yourself.
plot
- the plot.public RangeType getRangeType()
Two types are recognised:
STANDARD
- data items are plotted individually, so the axis range should
extend from the smallest value to the largest value;STACKED
- data items are stacked on top of one another, so to determine
the axis range, all the items in a series need to be summed together.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |