|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jfree.chart.renderer.AbstractRenderer
org.jfree.chart.renderer.xy.AbstractXYItemRenderer
A base class that can be used to create new XYItemRenderer
implementations.
Field Summary |
Fields inherited from class org.jfree.chart.renderer.AbstractRenderer |
DEFAULT_OUTLINE_PAINT, DEFAULT_OUTLINE_STROKE, DEFAULT_PAINT, DEFAULT_SHAPE, DEFAULT_STROKE, DEFAULT_VALUE_LABEL_FONT, DEFAULT_VALUE_LABEL_PAINT, ZERO |
Constructor Summary | |
protected |
AbstractXYItemRenderer()
Creates a renderer where the tooltip generator and the URL generator are both null . |
Method Summary | |
protected void |
addEntity(EntityCollection entities,
java.awt.Shape area,
XYDataset dataset,
int series,
int item,
double entityX,
double entityY)
Adds an entity to the collection. |
protected java.lang.Object |
clone()
Returns a clone of 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 range axis. |
void |
drawDomainMarker(java.awt.Graphics2D g2,
XYPlot plot,
ValueAxis domainAxis,
Marker marker,
java.awt.geom.Rectangle2D dataArea)
Draws a vertical line on the chart to represent a 'range marker'. |
protected void |
drawItemLabel(java.awt.Graphics2D g2,
PlotOrientation orientation,
XYDataset dataset,
int series,
int item,
double x,
double y,
boolean negative)
Draws an item label. |
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 rangeAxis,
Marker marker,
java.awt.geom.Rectangle2D dataArea)
Draws a horizontal line across the chart to represent a 'range marker'. |
boolean |
equals(java.lang.Object obj)
Tests this renderer for equality with another object. |
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. |
XYLabelGenerator |
getBaseLabelGenerator()
Returns the base item label generator. |
XYToolTipGenerator |
getBaseToolTipGenerator()
Returns the base tool tip generator. |
int |
getDefaultEntityRadius()
Returns the radius of the circle used for the default entity area when no area is specified. |
DrawingSupplier |
getDrawingSupplier()
Returns the drawing supplier from the plot. |
XYLabelGenerator |
getLabelGenerator(int row,
int column)
Returns the label generator for a data item. |
LegendItem |
getLegendItem(int datasetIndex,
int series)
Returns a legend item for a series. |
int |
getPassCount()
Returns the number of passes through the data that the renderer requires in order to draw the chart. |
XYPlot |
getPlot()
Returns the plot that the renderer is assigned to. |
Range |
getRangeExtent(XYDataset dataset)
Returns the range of values the renderer requires to display all the items from the specified dataset. |
XYLabelGenerator |
getSeriesLabelGenerator(int series)
Returns the label generator for a series. |
XYToolTipGenerator |
getSeriesToolTipGenerator(int series)
Returns the tool tip generator for a series. |
XYToolTipGenerator |
getToolTipGenerator(int row,
int column)
Returns the tool tip generator for a data item. |
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 and returns a state object that should be passed to all subsequent calls to the drawItem() method. |
void |
setBaseLabelGenerator(XYLabelGenerator generator)
Sets the base item label generator and sends a RendererChangeEvent
to all registered listeners. |
void |
setBaseToolTipGenerator(XYToolTipGenerator generator)
Sets the base tool tip generator and sends a RendererChangeEvent
to all registered listeners. |
void |
setDefaultEntityRadius(int radius)
Sets the radius of the circle used for the default entity area when no area is specified. |
void |
setLabelGenerator(XYLabelGenerator generator)
Sets the item label generator for ALL series and sends a RendererChangeEvent
to all registered listeners. |
void |
setPlot(XYPlot plot)
Sets the plot that the renderer is assigned to. |
void |
setSeriesLabelGenerator(int series,
XYLabelGenerator generator)
Sets the label generator for a series and sends a RendererChangeEvent
to all registered listeners. |
void |
setSeriesToolTipGenerator(int series,
XYToolTipGenerator generator)
Sets the tool tip generator for a series and sends a RendererChangeEvent
to all registered listeners. |
void |
setToolTipGenerator(XYToolTipGenerator generator)
Sets the tool tip generator for ALL series and sends a RendererChangeEvent
to all registered listeners. |
void |
setURLGenerator(XYURLGenerator urlGenerator)
Sets the URL generator for HTML image maps. |
protected void |
updateCrosshairValues(CrosshairState crosshairState,
double x,
double y,
double transX,
double transY,
PlotOrientation orientation)
Considers the current (x, y) coordinate and updates the crosshair point if it meets the criteria (usually means the (x, y) coordinate is the closest to the anchor point so far). |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected AbstractXYItemRenderer()
null
.
Method Detail |
public int getPassCount()
getPassCount
in interface XYItemRenderer
public XYPlot getPlot()
getPlot
in interface XYItemRenderer
public void setPlot(XYPlot plot)
setPlot
in interface XYItemRenderer
plot
- the plot.public XYItemRendererState initialise(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D dataArea, XYPlot plot, XYDataset data, PlotRenderingInfo info)
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.
initialise
in interface XYItemRenderer
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.
null
).public XYLabelGenerator getLabelGenerator(int row, int column)
getSeriesLabelGenerator(int)
method. If, for some reason, you want a different
generator for individual items, you can override this method.
getLabelGenerator
in interface XYItemRenderer
row
- the row index (zero based).column
- the column index (zero based).
null
).public XYLabelGenerator getSeriesLabelGenerator(int series)
getSeriesLabelGenerator
in interface XYItemRenderer
series
- the series index (zero based).
null
).public void setLabelGenerator(XYLabelGenerator generator)
RendererChangeEvent
to all registered listeners.
setLabelGenerator
in interface XYItemRenderer
generator
- the generator (null
permitted).public void setSeriesLabelGenerator(int series, XYLabelGenerator generator)
RendererChangeEvent
to all registered listeners.
setSeriesLabelGenerator
in interface XYItemRenderer
series
- the series index (zero based).generator
- the generator (null
permitted).public XYLabelGenerator getBaseLabelGenerator()
getBaseLabelGenerator
in interface XYItemRenderer
null
).public void setBaseLabelGenerator(XYLabelGenerator generator)
RendererChangeEvent
to all registered listeners.
setBaseLabelGenerator
in interface XYItemRenderer
generator
- the generator (null
permitted).public XYToolTipGenerator getToolTipGenerator(int row, int column)
getToolTipGenerator
in interface XYItemRenderer
row
- the row index (zero based).column
- the column index (zero based).
null
).public XYToolTipGenerator getSeriesToolTipGenerator(int series)
getSeriesToolTipGenerator
in interface XYItemRenderer
series
- the series index (zero based).
null
).public void setToolTipGenerator(XYToolTipGenerator generator)
RendererChangeEvent
to all registered listeners.
setToolTipGenerator
in interface XYItemRenderer
generator
- the generator (null
permitted).public void setSeriesToolTipGenerator(int series, XYToolTipGenerator generator)
RendererChangeEvent
to all registered listeners.
setSeriesToolTipGenerator
in interface XYItemRenderer
series
- the series index (zero based).generator
- the generator (null
permitted).public XYToolTipGenerator getBaseToolTipGenerator()
getBaseToolTipGenerator
in interface XYItemRenderer
null
).public void setBaseToolTipGenerator(XYToolTipGenerator generator)
RendererChangeEvent
to all registered listeners.
setBaseToolTipGenerator
in interface XYItemRenderer
generator
- the generator (null
permitted).public XYURLGenerator getURLGenerator()
getURLGenerator
in interface XYItemRenderer
null
).public void setURLGenerator(XYURLGenerator urlGenerator)
setURLGenerator
in interface XYItemRenderer
urlGenerator
- the URL generator (null
permitted).public int getDefaultEntityRadius()
public void setDefaultEntityRadius(int radius)
radius
- the radius.public Range getRangeExtent(XYDataset dataset)
getRangeExtent
in interface XYItemRenderer
dataset
- the dataset (null
permitted).
null
if the dataset is null
or empty).public LegendItem getLegendItem(int datasetIndex, int series)
getLegendItem
in interface XYItemRenderer
datasetIndex
- the dataset index (zero-based).series
- the series index (zero-based).
public void fillDomainGridBand(java.awt.Graphics2D g2, XYPlot plot, ValueAxis axis, java.awt.geom.Rectangle2D dataArea, double start, double end)
fillDomainGridBand
in interface XYItemRenderer
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)
fillRangeGridBand
in interface XYItemRenderer
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)
drawDomainGridLine
in interface XYItemRenderer
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 at which the grid line should be drawn.public void drawRangeGridLine(java.awt.Graphics2D g2, XYPlot plot, ValueAxis axis, java.awt.geom.Rectangle2D dataArea, double value)
drawRangeGridLine
in interface XYItemRenderer
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 at which the grid line should be drawn.public void drawDomainMarker(java.awt.Graphics2D g2, XYPlot plot, ValueAxis domainAxis, Marker marker, java.awt.geom.Rectangle2D dataArea)
drawDomainMarker
in interface XYItemRenderer
g2
- the graphics device.plot
- the plot.domainAxis
- the domain axis.marker
- the marker line.dataArea
- the axis data area.public void drawRangeMarker(java.awt.Graphics2D g2, XYPlot plot, ValueAxis rangeAxis, Marker marker, java.awt.geom.Rectangle2D dataArea)
drawRangeMarker
in interface XYItemRenderer
g2
- the graphics device.plot
- the plot.rangeAxis
- the range axis.marker
- the marker line.dataArea
- the axis data area.protected java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class AbstractRenderer
java.lang.CloneNotSupportedException
- if the renderer does not support cloning.public boolean equals(java.lang.Object obj)
equals
in class AbstractRenderer
obj
- the object.
true
or false
.public DrawingSupplier getDrawingSupplier()
getDrawingSupplier
in class AbstractRenderer
null
).protected void updateCrosshairValues(CrosshairState crosshairState, double x, double y, double transX, double transY, PlotOrientation orientation)
crosshairState
- the crosshair state (null
permitted, but the method does
nothing in that case).x
- the x-value (in data space).y
- the y-value (in data space).transX
- the x-value translated to Java2D space.transY
- the y-value translated to Java2D space.orientation
- the plot orientation (null
not permitted).protected void drawItemLabel(java.awt.Graphics2D g2, PlotOrientation orientation, XYDataset dataset, int series, int item, double x, double y, boolean negative)
g2
- the graphics device.orientation
- the orientation.dataset
- the dataset.series
- the series index (zero-based).item
- the item index (zero-based).x
- the x coordinate (in Java2D space).y
- the y coordinate (in Java2D space).negative
- indicates a negative value (which affects the item label position).protected void addEntity(EntityCollection entities, java.awt.Shape area, XYDataset dataset, int series, int item, double entityX, double entityY)
entities
- the entity collection being populated.area
- the entity area (if null
a default will be used).entityX
- the entity's center x-coordinate in user space.entityY
- the entity's center y-coordinate in user space.dataset
- the dataset.series
- the series.item
- the item.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |