public abstract class AbstractCategoryItemRenderer extends AbstractRenderer implements CategoryItemRenderer, Cloneable, PublicCloneable, Serializable
CategoryItemRenderer
. When you create a new
CategoryItemRenderer
you are not required to extend this class,
but it makes the job easier.DEFAULT_OUTLINE_PAINT, DEFAULT_OUTLINE_STROKE, DEFAULT_PAINT, DEFAULT_SHAPE, DEFAULT_STROKE, DEFAULT_VALUE_LABEL_FONT, DEFAULT_VALUE_LABEL_PAINT, ZERO
Modifier | Constructor and Description |
---|---|
protected |
AbstractCategoryItemRenderer()
Creates a new renderer with no tool tip generator and no URL generator.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addEntity(EntityCollection entities,
Shape hotspot,
CategoryDataset dataset,
int row,
int column,
double entityX,
double entityY)
Adds an entity to the collection.
|
protected void |
addItemEntity(EntityCollection entities,
CategoryDataset dataset,
int row,
int column,
Shape hotspot)
Adds an entity with the specified hotspot.
|
protected void |
beginElementGroup(Graphics2D g2,
Comparable rowKey,
Comparable columnKey)
Adds a
KEY_BEGIN_ELEMENT hint to the graphics target. |
protected Point2D |
calculateDomainMarkerTextAnchorPoint(Graphics2D g2,
PlotOrientation orientation,
Rectangle2D dataArea,
Rectangle2D markerArea,
RectangleInsets markerOffset,
LengthAdjustmentType labelOffsetType,
RectangleAnchor anchor)
Calculates the
(x, y) coordinates for drawing the label for a
marker on the range axis. |
protected Point2D |
calculateRangeMarkerTextAnchorPoint(Graphics2D g2,
PlotOrientation orientation,
Rectangle2D dataArea,
Rectangle2D markerArea,
RectangleInsets markerOffset,
LengthAdjustmentType labelOffsetType,
RectangleAnchor anchor)
Calculates the (x, y) coordinates for drawing a marker label.
|
Object |
clone()
Returns an independent copy of the renderer.
|
protected CategoryItemRendererState |
createState(PlotRenderingInfo info)
Creates a new state instance---this method is called from the
initialise(Graphics2D, Rectangle2D, CategoryPlot, int,
PlotRenderingInfo) method. |
void |
drawBackground(Graphics2D g2,
CategoryPlot plot,
Rectangle2D dataArea)
Draws a background for the data area.
|
void |
drawDomainGridline(Graphics2D g2,
CategoryPlot plot,
Rectangle2D dataArea,
double value)
Draws a grid line against the domain axis.
|
void |
drawDomainMarker(Graphics2D g2,
CategoryPlot plot,
CategoryAxis axis,
CategoryMarker marker,
Rectangle2D dataArea)
Draws a marker for the domain axis.
|
protected void |
drawItemLabel(Graphics2D g2,
PlotOrientation orientation,
CategoryDataset dataset,
int row,
int column,
double x,
double y,
boolean negative)
Draws an item label.
|
void |
drawOutline(Graphics2D g2,
CategoryPlot plot,
Rectangle2D dataArea)
Draws an outline for the data area.
|
void |
drawRangeLine(Graphics2D g2,
CategoryPlot plot,
ValueAxis axis,
Rectangle2D dataArea,
double value,
Paint paint,
Stroke stroke)
Draws a line perpendicular to the range axis.
|
void |
drawRangeMarker(Graphics2D g2,
CategoryPlot plot,
ValueAxis axis,
Marker marker,
Rectangle2D dataArea)
Draws a marker for the range axis.
|
boolean |
equals(Object obj)
Tests this renderer for equality with another object.
|
Range |
findRangeBounds(CategoryDataset dataset)
Returns the range of values the renderer requires to display all the
items from the specified dataset.
|
protected Range |
findRangeBounds(CategoryDataset dataset,
boolean includeInterval)
Returns the range of values the renderer requires to display all the
items from the specified dataset.
|
int |
getColumnCount()
Returns the number of columns in the dataset.
|
CategoryItemLabelGenerator |
getDefaultItemLabelGenerator()
Returns the default item label generator.
|
CategoryURLGenerator |
getDefaultItemURLGenerator()
Returns the default item URL generator.
|
CategoryToolTipGenerator |
getDefaultToolTipGenerator()
Returns the default tool tip generator (the "layer 2" generator).
|
protected CategoryAxis |
getDomainAxis(CategoryPlot plot,
int index)
Returns a domain axis for a plot.
|
DrawingSupplier |
getDrawingSupplier()
Returns the drawing supplier from the plot.
|
CategoryItemLabelGenerator |
getItemLabelGenerator(int row,
int column)
Returns the item label generator for a data item.
|
double |
getItemMiddle(Comparable rowKey,
Comparable columnKey,
CategoryDataset dataset,
CategoryAxis axis,
Rectangle2D area,
RectangleEdge edge)
Returns the Java2D coordinate for the middle of the specified data item.
|
CategoryURLGenerator |
getItemURLGenerator(int row,
int column)
Returns the URL generator for a data item.
|
LegendItem |
getLegendItem(int datasetIndex,
int series)
Returns a legend item for a series.
|
CategorySeriesLabelGenerator |
getLegendItemLabelGenerator()
Returns the legend item label generator.
|
LegendItemCollection |
getLegendItems()
Returns a (possibly empty) collection of legend items for the series
that this renderer is responsible for drawing.
|
CategorySeriesLabelGenerator |
getLegendItemToolTipGenerator()
Returns the legend item tool tip generator.
|
CategorySeriesLabelGenerator |
getLegendItemURLGenerator()
Returns the legend item URL generator.
|
int |
getPassCount()
Returns the number of passes through the dataset required by the
renderer.
|
CategoryPlot |
getPlot()
Returns the plot that the renderer has been assigned to (where
null indicates that the renderer is not currently assigned
to a plot). |
protected ValueAxis |
getRangeAxis(CategoryPlot plot,
int index)
Returns a range axis for a plot.
|
int |
getRowCount()
Returns the number of rows in the dataset.
|
CategoryItemLabelGenerator |
getSeriesItemLabelGenerator(int series)
Returns the item label generator for a series.
|
CategoryURLGenerator |
getSeriesItemURLGenerator(int series)
Returns the URL generator for a series.
|
CategoryToolTipGenerator |
getSeriesToolTipGenerator(int series)
Returns the tool tip generator for the specified series (a "layer 1"
generator).
|
CategoryToolTipGenerator |
getToolTipGenerator(int row,
int column)
Returns the tool tip generator that should be used for the specified
item.
|
int |
hashCode()
Returns a hash code for the renderer.
|
CategoryItemRendererState |
initialise(Graphics2D g2,
Rectangle2D dataArea,
CategoryPlot plot,
int rendererIndex,
PlotRenderingInfo info)
Initialises the renderer and returns a state object that will be used
for the remainder of the drawing process for a single chart.
|
void |
setDefaultItemLabelGenerator(CategoryItemLabelGenerator generator)
Sets the default item label generator and sends a
RendererChangeEvent to all registered listeners. |
void |
setDefaultItemLabelGenerator(CategoryItemLabelGenerator generator,
boolean notify)
Sets the default item label generator and sends a
RendererChangeEvent to all registered listeners. |
void |
setDefaultItemURLGenerator(CategoryURLGenerator generator)
Sets the default item URL generator and sends a
RendererChangeEvent to all registered listeners. |
void |
setDefaultItemURLGenerator(CategoryURLGenerator generator,
boolean notify)
Sets the default item URL generator and sends a
RendererChangeEvent to all registered listeners. |
void |
setDefaultToolTipGenerator(CategoryToolTipGenerator generator)
Sets the default tool tip generator and sends a
RendererChangeEvent
to all registered listeners. |
void |
setDefaultToolTipGenerator(CategoryToolTipGenerator generator,
boolean notify)
Sets the default tool tip generator and sends a
RendererChangeEvent
to all registered listeners. |
void |
setLegendItemLabelGenerator(CategorySeriesLabelGenerator generator)
Sets the legend item label generator and sends a
RendererChangeEvent to all registered listeners. |
void |
setLegendItemToolTipGenerator(CategorySeriesLabelGenerator generator)
Sets the legend item tool tip generator and sends a
RendererChangeEvent to all registered listeners. |
void |
setLegendItemURLGenerator(CategorySeriesLabelGenerator generator)
Sets the legend item URL generator and sends a
RendererChangeEvent to all registered listeners. |
void |
setPlot(CategoryPlot plot)
Sets the plot that the renderer has been assigned to.
|
void |
setSeriesItemLabelGenerator(int series,
CategoryItemLabelGenerator generator)
Sets the item label generator for a series and sends a
RendererChangeEvent to all registered listeners. |
void |
setSeriesItemLabelGenerator(int series,
CategoryItemLabelGenerator generator,
boolean notify)
Sets the item label generator for a series and sends a
RendererChangeEvent to all registered listeners. |
void |
setSeriesItemURLGenerator(int series,
CategoryURLGenerator generator)
Sets the URL generator for a series and sends a
RendererChangeEvent to all registered listeners. |
void |
setSeriesItemURLGenerator(int series,
CategoryURLGenerator generator,
boolean notify)
Sets the URL generator for a series and sends a
RendererChangeEvent to all registered listeners. |
void |
setSeriesToolTipGenerator(int series,
CategoryToolTipGenerator generator)
Sets the tool tip generator for a series and sends a
RendererChangeEvent to all registered listeners. |
void |
setSeriesToolTipGenerator(int series,
CategoryToolTipGenerator generator,
boolean notify)
Sets the tool tip generator for a series and sends a
RendererChangeEvent to all registered listeners. |
protected void |
updateCrosshairValues(CategoryCrosshairState crosshairState,
Comparable rowKey,
Comparable columnKey,
double value,
int datasetIndex,
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).
|
addChangeListener, beginElementGroup, calculateLabelAnchorPoint, clearSeriesPaints, clearSeriesStrokes, endElementGroup, fireChangeEvent, getAutoPopulateSeriesFillPaint, getAutoPopulateSeriesOutlinePaint, getAutoPopulateSeriesOutlineStroke, getAutoPopulateSeriesPaint, getAutoPopulateSeriesShape, getAutoPopulateSeriesStroke, getDataBoundsIncludesVisibleSeriesOnly, getDefaultCreateEntities, getDefaultEntityRadius, getDefaultFillPaint, getDefaultItemLabelFont, getDefaultItemLabelPaint, getDefaultItemLabelsVisible, getDefaultLegendShape, getDefaultLegendTextFont, getDefaultLegendTextPaint, getDefaultNegativeItemLabelPosition, getDefaultOutlinePaint, getDefaultOutlineStroke, getDefaultPaint, getDefaultPositiveItemLabelPosition, getDefaultSeriesVisible, getDefaultSeriesVisibleInLegend, getDefaultShape, getDefaultStroke, getItemCreateEntity, getItemFillPaint, getItemLabelAnchorOffset, getItemLabelFont, getItemLabelPaint, getItemOutlinePaint, getItemOutlineStroke, getItemPaint, getItemShape, getItemStroke, getItemVisible, getLegendShape, getLegendTextFont, getLegendTextPaint, getNegativeItemLabelPosition, getPositiveItemLabelPosition, getSeriesCreateEntities, getSeriesFillPaint, getSeriesItemLabelFont, getSeriesItemLabelPaint, getSeriesNegativeItemLabelPosition, getSeriesOutlinePaint, getSeriesOutlineStroke, getSeriesPaint, getSeriesPositiveItemLabelPosition, getSeriesShape, getSeriesStroke, getSeriesVisible, getSeriesVisibleInLegend, getTreatLegendShapeAsLine, hasListener, isItemLabelVisible, isSeriesItemLabelsVisible, isSeriesVisible, isSeriesVisibleInLegend, lookupLegendShape, lookupLegendTextFont, lookupLegendTextPaint, lookupSeriesFillPaint, lookupSeriesOutlinePaint, lookupSeriesOutlineStroke, lookupSeriesPaint, lookupSeriesShape, lookupSeriesStroke, notifyListeners, removeChangeListener, setAutoPopulateSeriesFillPaint, setAutoPopulateSeriesOutlinePaint, setAutoPopulateSeriesOutlineStroke, setAutoPopulateSeriesPaint, setAutoPopulateSeriesShape, setAutoPopulateSeriesStroke, setDataBoundsIncludesVisibleSeriesOnly, setDefaultCreateEntities, setDefaultCreateEntities, setDefaultEntityRadius, setDefaultFillPaint, setDefaultFillPaint, setDefaultItemLabelFont, setDefaultItemLabelFont, setDefaultItemLabelPaint, setDefaultItemLabelPaint, setDefaultItemLabelsVisible, setDefaultItemLabelsVisible, setDefaultLegendShape, setDefaultLegendTextFont, setDefaultLegendTextPaint, setDefaultNegativeItemLabelPosition, setDefaultNegativeItemLabelPosition, setDefaultOutlinePaint, setDefaultOutlinePaint, setDefaultOutlineStroke, setDefaultOutlineStroke, setDefaultPaint, setDefaultPaint, setDefaultPositiveItemLabelPosition, setDefaultPositiveItemLabelPosition, setDefaultSeriesVisible, setDefaultSeriesVisible, setDefaultSeriesVisibleInLegend, setDefaultSeriesVisibleInLegend, setDefaultShape, setDefaultShape, setDefaultStroke, setDefaultStroke, setItemLabelAnchorOffset, setLegendShape, setLegendTextFont, setLegendTextPaint, setSeriesCreateEntities, setSeriesCreateEntities, setSeriesFillPaint, setSeriesFillPaint, setSeriesItemLabelFont, setSeriesItemLabelFont, setSeriesItemLabelPaint, setSeriesItemLabelPaint, setSeriesItemLabelsVisible, setSeriesItemLabelsVisible, setSeriesItemLabelsVisible, setSeriesNegativeItemLabelPosition, setSeriesNegativeItemLabelPosition, setSeriesOutlinePaint, setSeriesOutlinePaint, setSeriesOutlineStroke, setSeriesOutlineStroke, setSeriesPaint, setSeriesPaint, setSeriesPositiveItemLabelPosition, setSeriesPositiveItemLabelPosition, setSeriesShape, setSeriesShape, setSeriesStroke, setSeriesStroke, setSeriesVisible, setSeriesVisible, setSeriesVisibleInLegend, setSeriesVisibleInLegend, setTreatLegendShapeAsLine
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
addChangeListener, drawItem, getDefaultCreateEntities, getDefaultFillPaint, getDefaultItemLabelFont, getDefaultItemLabelPaint, getDefaultItemLabelsVisible, getDefaultNegativeItemLabelPosition, getDefaultOutlinePaint, getDefaultOutlineStroke, getDefaultPaint, getDefaultPositiveItemLabelPosition, getDefaultSeriesVisible, getDefaultSeriesVisibleInLegend, getDefaultShape, getDefaultStroke, getItemCreateEntity, getItemFillPaint, getItemLabelFont, getItemLabelPaint, getItemOutlinePaint, getItemOutlineStroke, getItemPaint, getItemShape, getItemStroke, getItemVisible, getNegativeItemLabelPosition, getPositiveItemLabelPosition, getSeriesCreateEntities, getSeriesFillPaint, getSeriesItemLabelFont, getSeriesItemLabelPaint, getSeriesNegativeItemLabelPosition, getSeriesOutlinePaint, getSeriesOutlineStroke, getSeriesPaint, getSeriesPositiveItemLabelPosition, getSeriesShape, getSeriesStroke, getSeriesVisible, getSeriesVisibleInLegend, isItemLabelVisible, isSeriesItemLabelsVisible, isSeriesVisible, isSeriesVisibleInLegend, removeChangeListener, setDefaultCreateEntities, setDefaultCreateEntities, setDefaultFillPaint, setDefaultItemLabelFont, setDefaultItemLabelFont, setDefaultItemLabelPaint, setDefaultItemLabelPaint, setDefaultItemLabelsVisible, setDefaultItemLabelsVisible, setDefaultNegativeItemLabelPosition, setDefaultNegativeItemLabelPosition, setDefaultOutlinePaint, setDefaultOutlinePaint, setDefaultOutlineStroke, setDefaultOutlineStroke, setDefaultPaint, setDefaultPaint, setDefaultPositiveItemLabelPosition, setDefaultPositiveItemLabelPosition, setDefaultSeriesVisible, setDefaultSeriesVisible, setDefaultSeriesVisibleInLegend, setDefaultSeriesVisibleInLegend, setDefaultShape, setDefaultShape, setDefaultStroke, setDefaultStroke, setSeriesCreateEntities, setSeriesCreateEntities, setSeriesFillPaint, setSeriesItemLabelFont, setSeriesItemLabelFont, setSeriesItemLabelPaint, setSeriesItemLabelPaint, setSeriesItemLabelsVisible, setSeriesItemLabelsVisible, setSeriesItemLabelsVisible, setSeriesNegativeItemLabelPosition, setSeriesNegativeItemLabelPosition, setSeriesOutlinePaint, setSeriesOutlinePaint, setSeriesOutlineStroke, setSeriesOutlineStroke, setSeriesPaint, setSeriesPaint, setSeriesPositiveItemLabelPosition, setSeriesPositiveItemLabelPosition, setSeriesShape, setSeriesShape, setSeriesStroke, setSeriesStroke, setSeriesVisible, setSeriesVisible, setSeriesVisibleInLegend, setSeriesVisibleInLegend
protected AbstractCategoryItemRenderer()
public int getPassCount()
1
, subclasses should
override if they need more passes.getPassCount
in interface CategoryItemRenderer
public CategoryPlot getPlot()
null
indicates that the renderer is not currently assigned
to a plot).getPlot
in interface CategoryItemRenderer
null
).setPlot(CategoryPlot)
public void setPlot(CategoryPlot plot)
CategoryPlot
, in normal usage you
shouldn't need to call this method directly.setPlot
in interface CategoryItemRenderer
plot
- the plot (null
not permitted).getPlot()
public CategoryItemLabelGenerator getItemLabelGenerator(int row, int column)
getSeriesItemLabelGenerator(int)
method. If, for some reason, you want a different generator for
individual items, you can override this method.getItemLabelGenerator
in interface CategoryItemRenderer
row
- the row index (zero based).column
- the column index (zero based).null
).public CategoryItemLabelGenerator getSeriesItemLabelGenerator(int series)
getSeriesItemLabelGenerator
in interface CategoryItemRenderer
series
- the series index (zero based).null
).setSeriesItemLabelGenerator(int, CategoryItemLabelGenerator)
public void setSeriesItemLabelGenerator(int series, CategoryItemLabelGenerator generator)
RendererChangeEvent
to all registered listeners.setSeriesItemLabelGenerator
in interface CategoryItemRenderer
series
- the series index (zero based).generator
- the generator (null
permitted).getSeriesItemLabelGenerator(int)
public void setSeriesItemLabelGenerator(int series, CategoryItemLabelGenerator generator, boolean notify)
RendererChangeEvent
to all registered listeners.setSeriesItemLabelGenerator
in interface CategoryItemRenderer
series
- the series index (zero based).generator
- the generator (null
permitted).notify
- notify listeners?getSeriesItemLabelGenerator(int)
public CategoryItemLabelGenerator getDefaultItemLabelGenerator()
getDefaultItemLabelGenerator
in interface CategoryItemRenderer
null
).setDefaultItemLabelGenerator(CategoryItemLabelGenerator)
public void setDefaultItemLabelGenerator(CategoryItemLabelGenerator generator)
RendererChangeEvent
to all registered listeners.setDefaultItemLabelGenerator
in interface CategoryItemRenderer
generator
- the generator (null
permitted).getDefaultItemLabelGenerator()
public void setDefaultItemLabelGenerator(CategoryItemLabelGenerator generator, boolean notify)
RendererChangeEvent
to all registered listeners.setDefaultItemLabelGenerator
in interface CategoryItemRenderer
generator
- the generator (null
permitted).notify
- notify listeners?getDefaultItemLabelGenerator()
public CategoryToolTipGenerator getToolTipGenerator(int row, int column)
getToolTipGenerator
in interface CategoryItemRenderer
row
- the row index (zero-based).column
- the column index (zero-based).null
).public CategoryToolTipGenerator getSeriesToolTipGenerator(int series)
getSeriesToolTipGenerator
in interface CategoryItemRenderer
series
- the series index (zero-based).null
).setSeriesToolTipGenerator(int, CategoryToolTipGenerator)
public void setSeriesToolTipGenerator(int series, CategoryToolTipGenerator generator)
RendererChangeEvent
to all registered listeners.setSeriesToolTipGenerator
in interface CategoryItemRenderer
series
- the series index (zero-based).generator
- the generator (null
permitted).getSeriesToolTipGenerator(int)
public void setSeriesToolTipGenerator(int series, CategoryToolTipGenerator generator, boolean notify)
RendererChangeEvent
to all registered listeners.setSeriesToolTipGenerator
in interface CategoryItemRenderer
series
- the series index (zero-based).generator
- the generator (null
permitted).notify
- notify listeners?getSeriesToolTipGenerator(int)
public CategoryToolTipGenerator getDefaultToolTipGenerator()
getDefaultToolTipGenerator
in interface CategoryItemRenderer
null
).setDefaultToolTipGenerator(CategoryToolTipGenerator)
public void setDefaultToolTipGenerator(CategoryToolTipGenerator generator)
RendererChangeEvent
to all registered listeners.setDefaultToolTipGenerator
in interface CategoryItemRenderer
generator
- the generator (null
permitted).getDefaultToolTipGenerator()
public void setDefaultToolTipGenerator(CategoryToolTipGenerator generator, boolean notify)
RendererChangeEvent
to all registered listeners.setDefaultToolTipGenerator
in interface CategoryItemRenderer
generator
- the generator (null
permitted).notify
- notify listeners?getDefaultToolTipGenerator()
public CategoryURLGenerator getItemURLGenerator(int row, int column)
getItemURLGenerator
in interface CategoryItemRenderer
row
- the row index (zero based).column
- the column index (zero based).public CategoryURLGenerator getSeriesItemURLGenerator(int series)
getSeriesItemURLGenerator
in interface CategoryItemRenderer
series
- the series index (zero based).setSeriesItemURLGenerator(int, CategoryURLGenerator)
public void setSeriesItemURLGenerator(int series, CategoryURLGenerator generator)
RendererChangeEvent
to all registered listeners.setSeriesItemURLGenerator
in interface CategoryItemRenderer
series
- the series index (zero based).generator
- the generator.getSeriesItemURLGenerator(int)
public void setSeriesItemURLGenerator(int series, CategoryURLGenerator generator, boolean notify)
RendererChangeEvent
to all registered listeners.setSeriesItemURLGenerator
in interface CategoryItemRenderer
series
- the series index (zero based).generator
- the generator.notify
- notify listeners?getSeriesItemURLGenerator(int)
public CategoryURLGenerator getDefaultItemURLGenerator()
getDefaultItemURLGenerator
in interface CategoryItemRenderer
setDefaultItemURLGenerator(CategoryURLGenerator)
public void setDefaultItemURLGenerator(CategoryURLGenerator generator)
RendererChangeEvent
to all registered listeners.setDefaultItemURLGenerator
in interface CategoryItemRenderer
generator
- the item URL generator (null
permitted).getDefaultItemURLGenerator()
public void setDefaultItemURLGenerator(CategoryURLGenerator generator, boolean notify)
RendererChangeEvent
to all registered listeners.setDefaultItemURLGenerator
in interface CategoryItemRenderer
generator
- the item URL generator (null
permitted).notify
- notify listeners?getDefaultItemURLGenerator()
public int getRowCount()
initialise(java.awt.Graphics2D, java.awt.geom.Rectangle2D, org.jfree.chart.plot.CategoryPlot, int, org.jfree.chart.plot.PlotRenderingInfo)
method.public int getColumnCount()
initialise(java.awt.Graphics2D, java.awt.geom.Rectangle2D, org.jfree.chart.plot.CategoryPlot, int, org.jfree.chart.plot.PlotRenderingInfo)
method.protected CategoryItemRendererState createState(PlotRenderingInfo info)
initialise(Graphics2D, Rectangle2D, CategoryPlot, int,
PlotRenderingInfo)
method. Subclasses can override this method if
they need to use a subclass of CategoryItemRendererState
.info
- collects plot rendering info (null
permitted).null
).public CategoryItemRendererState initialise(Graphics2D g2, Rectangle2D dataArea, CategoryPlot plot, int rendererIndex, PlotRenderingInfo info)
initialise
in interface CategoryItemRenderer
g2
- the graphics device.dataArea
- the data area.plot
- the plot.rendererIndex
- the renderer index.info
- an object for returning information about the structure of
the plot (null
permitted).protected void beginElementGroup(Graphics2D g2, Comparable rowKey, Comparable columnKey)
KEY_BEGIN_ELEMENT
hint to the graphics target. This
hint is recognised by JFreeSVG (in theory it could be used by
other Graphics2D
implementations also).g2
- the graphics target (null
not permitted).rowKey
- the row key that identifies the element (null
not
permitted).columnKey
- the column key that identifies the element
(null
not permitted).public Range findRangeBounds(CategoryDataset dataset)
findRangeBounds
in interface CategoryItemRenderer
dataset
- the dataset (null
permitted).null
if the dataset is
null
or empty).protected Range findRangeBounds(CategoryDataset dataset, boolean includeInterval)
dataset
- the dataset (null
permitted).includeInterval
- include the y-interval if the dataset has one.null
if the dataset is null
or empty).public double getItemMiddle(Comparable rowKey, Comparable columnKey, CategoryDataset dataset, CategoryAxis axis, Rectangle2D area, RectangleEdge edge)
getItemMiddle
in interface CategoryItemRenderer
rowKey
- the row key.columnKey
- the column key.dataset
- the dataset.axis
- the axis.area
- the data area.edge
- the edge along which the axis lies.public void drawBackground(Graphics2D g2, CategoryPlot plot, Rectangle2D dataArea)
drawBackground
in interface CategoryItemRenderer
g2
- the graphics device.plot
- the plot.dataArea
- the data area.public void drawOutline(Graphics2D g2, CategoryPlot plot, Rectangle2D dataArea)
drawOutline
in interface CategoryItemRenderer
g2
- the graphics device.plot
- the plot.dataArea
- the data area.public void drawDomainGridline(Graphics2D g2, CategoryPlot plot, Rectangle2D dataArea, double value)
Note that this default implementation assumes that the horizontal axis is the domain axis. If this is not the case, you will need to override this method.
drawDomainGridline
in interface CategoryItemRenderer
g2
- the graphics device.plot
- the plot.dataArea
- the area for plotting data.value
- the Java2D value at which the grid line should be drawn.public void drawRangeLine(Graphics2D g2, CategoryPlot plot, ValueAxis axis, Rectangle2D dataArea, double value, Paint paint, Stroke stroke)
drawRangeLine
in interface CategoryItemRenderer
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.paint
- the paint (null
not permitted).stroke
- the stroke (null
not permitted).public void drawDomainMarker(Graphics2D g2, CategoryPlot plot, CategoryAxis axis, CategoryMarker marker, Rectangle2D dataArea)
drawDomainMarker
in interface CategoryItemRenderer
g2
- the graphics device (not null
).plot
- the plot (not null
).axis
- the range axis (not null
).marker
- the marker to be drawn (not null
).dataArea
- the area inside the axes (not null
).drawRangeMarker(Graphics2D, CategoryPlot, ValueAxis, Marker,
Rectangle2D)
public void drawRangeMarker(Graphics2D g2, CategoryPlot plot, ValueAxis axis, Marker marker, Rectangle2D dataArea)
drawRangeMarker
in interface CategoryItemRenderer
g2
- the graphics device (not null
).plot
- the plot (not null
).axis
- the range axis (not null
).marker
- the marker to be drawn (not null
).dataArea
- the area inside the axes (not null
).drawDomainMarker(Graphics2D, CategoryPlot, CategoryAxis,
CategoryMarker, Rectangle2D)
protected Point2D calculateDomainMarkerTextAnchorPoint(Graphics2D g2, PlotOrientation orientation, Rectangle2D dataArea, Rectangle2D markerArea, RectangleInsets markerOffset, LengthAdjustmentType labelOffsetType, RectangleAnchor anchor)
(x, y)
coordinates for drawing the label for a
marker on the range axis.g2
- the graphics device.orientation
- the plot orientation.dataArea
- the data area.markerArea
- the rectangle surrounding the marker.markerOffset
- the marker offset.labelOffsetType
- the label offset type.anchor
- the label anchor.protected Point2D calculateRangeMarkerTextAnchorPoint(Graphics2D g2, PlotOrientation orientation, Rectangle2D dataArea, Rectangle2D markerArea, RectangleInsets markerOffset, LengthAdjustmentType labelOffsetType, RectangleAnchor anchor)
g2
- the graphics device.orientation
- the plot orientation.dataArea
- the data area.markerArea
- the rectangle surrounding the marker.markerOffset
- the marker offset.labelOffsetType
- the label offset type.anchor
- the label anchor.public LegendItem getLegendItem(int datasetIndex, int series)
null
if AbstractRenderer.isSeriesVisible(int)
or
AbstractRenderer.isSeriesVisibleInLegend(int)
returns false
.getLegendItem
in interface CategoryItemRenderer
datasetIndex
- the dataset index (zero-based).series
- the series index (zero-based).null
).getLegendItems()
public boolean equals(Object obj)
equals
in class AbstractRenderer
obj
- the object.true
or false
.public int hashCode()
hashCode
in class AbstractRenderer
public DrawingSupplier getDrawingSupplier()
getDrawingSupplier
in class AbstractRenderer
null
).protected void updateCrosshairValues(CategoryCrosshairState crosshairState, Comparable rowKey, Comparable columnKey, double value, int datasetIndex, double transX, double transY, PlotOrientation orientation)
crosshairState
- the crosshair state (null
permitted,
but the method does nothing in that case).rowKey
- the row key.columnKey
- the column key.value
- the data value.datasetIndex
- the dataset index.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(Graphics2D g2, PlotOrientation orientation, CategoryDataset dataset, int row, int column, double x, double y, boolean negative)
g2
- the graphics device.orientation
- the orientation.dataset
- the dataset.row
- the row.column
- the column.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).public Object clone() throws CloneNotSupportedException
plot
reference is shallow copied.clone
in interface PublicCloneable
clone
in class AbstractRenderer
CloneNotSupportedException
- can be thrown if one of the objects
belonging to the renderer does not support cloning (for example,
an item label generator).protected CategoryAxis getDomainAxis(CategoryPlot plot, int index)
plot
- the plot.index
- the axis index.protected ValueAxis getRangeAxis(CategoryPlot plot, int index)
plot
- the plot.index
- the axis index.public LegendItemCollection getLegendItems()
getLegendItems
in interface LegendItemSource
null
).getLegendItem(int, int)
public CategorySeriesLabelGenerator getLegendItemLabelGenerator()
null
).setLegendItemLabelGenerator(CategorySeriesLabelGenerator)
public void setLegendItemLabelGenerator(CategorySeriesLabelGenerator generator)
RendererChangeEvent
to all registered listeners.generator
- the generator (null
not permitted).getLegendItemLabelGenerator()
public CategorySeriesLabelGenerator getLegendItemToolTipGenerator()
null
).setLegendItemToolTipGenerator(CategorySeriesLabelGenerator)
public void setLegendItemToolTipGenerator(CategorySeriesLabelGenerator generator)
RendererChangeEvent
to all registered listeners.generator
- the generator (null
permitted).setLegendItemToolTipGenerator(CategorySeriesLabelGenerator)
public CategorySeriesLabelGenerator getLegendItemURLGenerator()
null
).setLegendItemURLGenerator(CategorySeriesLabelGenerator)
public void setLegendItemURLGenerator(CategorySeriesLabelGenerator generator)
RendererChangeEvent
to all registered listeners.generator
- the generator (null
permitted).getLegendItemURLGenerator()
protected void addItemEntity(EntityCollection entities, CategoryDataset dataset, int row, int column, Shape hotspot)
entities
- the entity collection.dataset
- the dataset.row
- the row index.column
- the column index.hotspot
- the hotspot (null
not permitted).protected void addEntity(EntityCollection entities, Shape hotspot, CategoryDataset dataset, int row, int column, double entityX, double entityY)
entities
- the entity collection being populated.hotspot
- the entity area (if null
a default will be
used).dataset
- the dataset.row
- the series.column
- the item.entityX
- the entity's center x-coordinate in user space (only
used if area
is null
).entityY
- the entity's center y-coordinate in user space (only
used if area
is null
).Copyright © 2001–2017 JFree.org. All rights reserved.