An abstract base class that you can use to implement a new
. When you create a new
you are not required to extend this class,
but it makes the job easier.
| Method from org.jfree.chart.renderer.category.AbstractCategoryItemRenderer Detail: |
protected void addItemEntity(EntityCollection entities,
CategoryDataset dataset,
int row,
int column,
Shape hotspot) {
String tip = null;
CategoryToolTipGenerator tipster = getToolTipGenerator(row, column);
if (tipster != null) {
tip = tipster.generateToolTip(dataset, row, column);
}
String url = null;
CategoryURLGenerator urlster = getItemURLGenerator(row, column);
if (urlster != null) {
url = urlster.generateURL(dataset, row, column);
}
CategoryItemEntity entity = new CategoryItemEntity(hotspot, tip, url,
dataset, dataset.getRowKey(row), dataset.getColumnKey(column));
entities.add(entity);
}
Adds an entity with the specified hotspot. |
protected Point2D calculateDomainMarkerTextAnchorPoint(Graphics2D g2,
PlotOrientation orientation,
Rectangle2D dataArea,
Rectangle2D markerArea,
RectangleInsets markerOffset,
LengthAdjustmentType labelOffsetType,
RectangleAnchor anchor) {
Rectangle2D anchorRect = null;
if (orientation == PlotOrientation.HORIZONTAL) {
anchorRect = markerOffset.createAdjustedRectangle(markerArea,
LengthAdjustmentType.CONTRACT, labelOffsetType);
}
else if (orientation == PlotOrientation.VERTICAL) {
anchorRect = markerOffset.createAdjustedRectangle(markerArea,
labelOffsetType, LengthAdjustmentType.CONTRACT);
}
return RectangleAnchor.coordinates(anchorRect, 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) {
Rectangle2D anchorRect = null;
if (orientation == PlotOrientation.HORIZONTAL) {
anchorRect = markerOffset.createAdjustedRectangle(markerArea,
labelOffsetType, LengthAdjustmentType.CONTRACT);
}
else if (orientation == PlotOrientation.VERTICAL) {
anchorRect = markerOffset.createAdjustedRectangle(markerArea,
LengthAdjustmentType.CONTRACT, labelOffsetType);
}
return RectangleAnchor.coordinates(anchorRect, anchor);
}
Calculates the (x, y) coordinates for drawing a marker label. |
public Object clone() throws CloneNotSupportedException {
AbstractCategoryItemRenderer clone
= (AbstractCategoryItemRenderer) super.clone();
if (this.itemLabelGenerator != null) {
if (this.itemLabelGenerator instanceof PublicCloneable) {
PublicCloneable pc = (PublicCloneable) this.itemLabelGenerator;
clone.itemLabelGenerator
= (CategoryItemLabelGenerator) pc.clone();
}
else {
throw new CloneNotSupportedException(
"ItemLabelGenerator not cloneable.");
}
}
if (this.itemLabelGeneratorList != null) {
clone.itemLabelGeneratorList
= (ObjectList) this.itemLabelGeneratorList.clone();
}
if (this.baseItemLabelGenerator != null) {
if (this.baseItemLabelGenerator instanceof PublicCloneable) {
PublicCloneable pc
= (PublicCloneable) this.baseItemLabelGenerator;
clone.baseItemLabelGenerator
= (CategoryItemLabelGenerator) pc.clone();
}
else {
throw new CloneNotSupportedException(
"ItemLabelGenerator not cloneable.");
}
}
if (this.toolTipGenerator != null) {
if (this.toolTipGenerator instanceof PublicCloneable) {
PublicCloneable pc = (PublicCloneable) this.toolTipGenerator;
clone.toolTipGenerator = (CategoryToolTipGenerator) pc.clone();
}
else {
throw new CloneNotSupportedException(
"Tool tip generator not cloneable.");
}
}
if (this.toolTipGeneratorList != null) {
clone.toolTipGeneratorList
= (ObjectList) this.toolTipGeneratorList.clone();
}
if (this.baseToolTipGenerator != null) {
if (this.baseToolTipGenerator instanceof PublicCloneable) {
PublicCloneable pc
= (PublicCloneable) this.baseToolTipGenerator;
clone.baseToolTipGenerator
= (CategoryToolTipGenerator) pc.clone();
}
else {
throw new CloneNotSupportedException(
"Base tool tip generator not cloneable.");
}
}
if (this.itemURLGenerator != null) {
if (this.itemURLGenerator instanceof PublicCloneable) {
PublicCloneable pc = (PublicCloneable) this.itemURLGenerator;
clone.itemURLGenerator = (CategoryURLGenerator) pc.clone();
}
else {
throw new CloneNotSupportedException(
"Item URL generator not cloneable.");
}
}
if (this.itemURLGeneratorList != null) {
clone.itemURLGeneratorList
= (ObjectList) this.itemURLGeneratorList.clone();
}
if (this.baseItemURLGenerator != null) {
if (this.baseItemURLGenerator instanceof PublicCloneable) {
PublicCloneable pc
= (PublicCloneable) this.baseItemURLGenerator;
clone.baseItemURLGenerator = (CategoryURLGenerator) pc.clone();
}
else {
throw new CloneNotSupportedException(
"Base item URL generator not cloneable.");
}
}
if (this.legendItemLabelGenerator instanceof PublicCloneable) {
clone.legendItemLabelGenerator = (CategorySeriesLabelGenerator)
ObjectUtilities.clone(this.legendItemLabelGenerator);
}
if (this.legendItemToolTipGenerator instanceof PublicCloneable) {
clone.legendItemToolTipGenerator = (CategorySeriesLabelGenerator)
ObjectUtilities.clone(this.legendItemToolTipGenerator);
}
if (this.legendItemURLGenerator instanceof PublicCloneable) {
clone.legendItemURLGenerator = (CategorySeriesLabelGenerator)
ObjectUtilities.clone(this.legendItemURLGenerator);
}
return clone;
}
Returns an independent copy of the renderer. The plot
reference is shallow copied. |
protected CategoryItemRendererState createState(PlotRenderingInfo info) {
return new CategoryItemRendererState(info);
}
|
public void drawBackground(Graphics2D g2,
CategoryPlot plot,
Rectangle2D dataArea) {
plot.drawBackground(g2, dataArea);
}
Draws a background for the data area. The default implementation just
gets the plot to draw the background, but some renderers will override
this behaviour. |
public void drawDomainGridline(Graphics2D g2,
CategoryPlot plot,
Rectangle2D dataArea,
double value) {
Line2D line = null;
PlotOrientation orientation = plot.getOrientation();
if (orientation == PlotOrientation.HORIZONTAL) {
line = new Line2D.Double(dataArea.getMinX(), value,
dataArea.getMaxX(), value);
}
else if (orientation == PlotOrientation.VERTICAL) {
line = new Line2D.Double(value, dataArea.getMinY(), value,
dataArea.getMaxY());
}
Paint paint = plot.getDomainGridlinePaint();
if (paint == null) {
paint = CategoryPlot.DEFAULT_GRIDLINE_PAINT;
}
g2.setPaint(paint);
Stroke stroke = plot.getDomainGridlineStroke();
if (stroke == null) {
stroke = CategoryPlot.DEFAULT_GRIDLINE_STROKE;
}
g2.setStroke(stroke);
g2.draw(line);
}
Draws a grid line against the domain axis.
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. |
public void drawDomainMarker(Graphics2D g2,
CategoryPlot plot,
CategoryAxis axis,
CategoryMarker marker,
Rectangle2D dataArea) {
Comparable category = marker.getKey();
CategoryDataset dataset = plot.getDataset(plot.getIndexOf(this));
int columnIndex = dataset.getColumnIndex(category);
if (columnIndex < 0) {
return;
}
final Composite savedComposite = g2.getComposite();
g2.setComposite(AlphaComposite.getInstance(
AlphaComposite.SRC_OVER, marker.getAlpha()));
PlotOrientation orientation = plot.getOrientation();
Rectangle2D bounds = null;
if (marker.getDrawAsLine()) {
double v = axis.getCategoryMiddle(columnIndex,
dataset.getColumnCount(), dataArea,
plot.getDomainAxisEdge());
Line2D line = null;
if (orientation == PlotOrientation.HORIZONTAL) {
line = new Line2D.Double(dataArea.getMinX(), v,
dataArea.getMaxX(), v);
}
else if (orientation == PlotOrientation.VERTICAL) {
line = new Line2D.Double(v, dataArea.getMinY(), v,
dataArea.getMaxY());
}
g2.setPaint(marker.getPaint());
g2.setStroke(marker.getStroke());
g2.draw(line);
bounds = line.getBounds2D();
}
else {
double v0 = axis.getCategoryStart(columnIndex,
dataset.getColumnCount(), dataArea,
plot.getDomainAxisEdge());
double v1 = axis.getCategoryEnd(columnIndex,
dataset.getColumnCount(), dataArea,
plot.getDomainAxisEdge());
Rectangle2D area = null;
if (orientation == PlotOrientation.HORIZONTAL) {
area = new Rectangle2D.Double(dataArea.getMinX(), v0,
dataArea.getWidth(), (v1 - v0));
}
else if (orientation == PlotOrientation.VERTICAL) {
area = new Rectangle2D.Double(v0, dataArea.getMinY(),
(v1 - v0), dataArea.getHeight());
}
g2.setPaint(marker.getPaint());
g2.fill(area);
bounds = area;
}
String label = marker.getLabel();
RectangleAnchor anchor = marker.getLabelAnchor();
if (label != null) {
Font labelFont = marker.getLabelFont();
g2.setFont(labelFont);
g2.setPaint(marker.getLabelPaint());
Point2D coordinates = calculateDomainMarkerTextAnchorPoint(
g2, orientation, dataArea, bounds, marker.getLabelOffset(),
marker.getLabelOffsetType(), anchor);
TextUtilities.drawAlignedString(label, g2,
(float) coordinates.getX(), (float) coordinates.getY(),
marker.getLabelTextAnchor());
}
g2.setComposite(savedComposite);
}
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) {
CategoryItemLabelGenerator generator
= getItemLabelGenerator(row, column);
if (generator != null) {
Font labelFont = getItemLabelFont(row, column);
Paint paint = getItemLabelPaint(row, column);
g2.setFont(labelFont);
g2.setPaint(paint);
String label = generator.generateLabel(dataset, row, column);
ItemLabelPosition position = null;
if (!negative) {
position = getPositiveItemLabelPosition(row, column);
}
else {
position = getNegativeItemLabelPosition(row, column);
}
Point2D anchorPoint = calculateLabelAnchorPoint(
position.getItemLabelAnchor(), x, y, orientation);
TextUtilities.drawRotatedString(label, g2,
(float) anchorPoint.getX(), (float) anchorPoint.getY(),
position.getTextAnchor(),
position.getAngle(), position.getRotationAnchor());
}
}
|
public void drawOutline(Graphics2D g2,
CategoryPlot plot,
Rectangle2D dataArea) {
plot.drawOutline(g2, dataArea);
}
Draws an outline for the data area. The default implementation just
gets the plot to draw the outline, but some renderers will override this
behaviour. |
public void drawRangeGridline(Graphics2D g2,
CategoryPlot plot,
ValueAxis axis,
Rectangle2D dataArea,
double value) {
Range range = axis.getRange();
if (!range.contains(value)) {
return;
}
PlotOrientation orientation = plot.getOrientation();
double v = axis.valueToJava2D(value, dataArea, plot.getRangeAxisEdge());
Line2D line = null;
if (orientation == PlotOrientation.HORIZONTAL) {
line = new Line2D.Double(v, dataArea.getMinY(), v,
dataArea.getMaxY());
}
else if (orientation == PlotOrientation.VERTICAL) {
line = new Line2D.Double(dataArea.getMinX(), v,
dataArea.getMaxX(), v);
}
Paint paint = plot.getRangeGridlinePaint();
if (paint == null) {
paint = CategoryPlot.DEFAULT_GRIDLINE_PAINT;
}
g2.setPaint(paint);
Stroke stroke = plot.getRangeGridlineStroke();
if (stroke == null) {
stroke = CategoryPlot.DEFAULT_GRIDLINE_STROKE;
}
g2.setStroke(stroke);
g2.draw(line);
}
Draws a grid line against the range axis. |
public void drawRangeMarker(Graphics2D g2,
CategoryPlot plot,
ValueAxis axis,
Marker marker,
Rectangle2D dataArea) {
if (marker instanceof ValueMarker) {
ValueMarker vm = (ValueMarker) marker;
double value = vm.getValue();
Range range = axis.getRange();
if (!range.contains(value)) {
return;
}
final Composite savedComposite = g2.getComposite();
g2.setComposite(AlphaComposite.getInstance(
AlphaComposite.SRC_OVER, marker.getAlpha()));
PlotOrientation orientation = plot.getOrientation();
double v = axis.valueToJava2D(value, dataArea,
plot.getRangeAxisEdge());
Line2D line = null;
if (orientation == PlotOrientation.HORIZONTAL) {
line = new Line2D.Double(v, dataArea.getMinY(), v,
dataArea.getMaxY());
}
else if (orientation == PlotOrientation.VERTICAL) {
line = new Line2D.Double(dataArea.getMinX(), v,
dataArea.getMaxX(), v);
}
g2.setPaint(marker.getPaint());
g2.setStroke(marker.getStroke());
g2.draw(line);
String label = marker.getLabel();
RectangleAnchor anchor = marker.getLabelAnchor();
if (label != null) {
Font labelFont = marker.getLabelFont();
g2.setFont(labelFont);
g2.setPaint(marker.getLabelPaint());
Point2D coordinates = calculateRangeMarkerTextAnchorPoint(
g2, orientation, dataArea, line.getBounds2D(),
marker.getLabelOffset(), LengthAdjustmentType.EXPAND,
anchor);
TextUtilities.drawAlignedString(label, g2,
(float) coordinates.getX(), (float) coordinates.getY(),
marker.getLabelTextAnchor());
}
g2.setComposite(savedComposite);
}
else if (marker instanceof IntervalMarker) {
IntervalMarker im = (IntervalMarker) marker;
double start = im.getStartValue();
double end = im.getEndValue();
Range range = axis.getRange();
if (!(range.intersects(start, end))) {
return;
}
final Composite savedComposite = g2.getComposite();
g2.setComposite(AlphaComposite.getInstance(
AlphaComposite.SRC_OVER, marker.getAlpha()));
double start2d = axis.valueToJava2D(start, dataArea,
plot.getRangeAxisEdge());
double end2d = axis.valueToJava2D(end, dataArea,
plot.getRangeAxisEdge());
double low = Math.min(start2d, end2d);
double high = Math.max(start2d, end2d);
PlotOrientation orientation = plot.getOrientation();
Rectangle2D rect = null;
if (orientation == PlotOrientation.HORIZONTAL) {
// clip left and right bounds to data area
low = Math.max(low, dataArea.getMinX());
high = Math.min(high, dataArea.getMaxX());
rect = new Rectangle2D.Double(low,
dataArea.getMinY(), high - low,
dataArea.getHeight());
}
else if (orientation == PlotOrientation.VERTICAL) {
// clip top and bottom bounds to data area
low = Math.max(low, dataArea.getMinY());
high = Math.min(high, dataArea.getMaxY());
rect = new Rectangle2D.Double(dataArea.getMinX(),
low, dataArea.getWidth(),
high - low);
}
Paint p = marker.getPaint();
if (p instanceof GradientPaint) {
GradientPaint gp = (GradientPaint) p;
GradientPaintTransformer t = im.getGradientPaintTransformer();
if (t != null) {
gp = t.transform(gp, rect);
}
g2.setPaint(gp);
}
else {
g2.setPaint(p);
}
g2.fill(rect);
// now draw the outlines, if visible...
if (im.getOutlinePaint() != null && im.getOutlineStroke() != null) {
if (orientation == PlotOrientation.VERTICAL) {
Line2D line = new Line2D.Double();
double x0 = dataArea.getMinX();
double x1 = dataArea.getMaxX();
g2.setPaint(im.getOutlinePaint());
g2.setStroke(im.getOutlineStroke());
if (range.contains(start)) {
line.setLine(x0, start2d, x1, start2d);
g2.draw(line);
}
if (range.contains(end)) {
line.setLine(x0, end2d, x1, end2d);
g2.draw(line);
}
}
else { // PlotOrientation.HORIZONTAL
Line2D line = new Line2D.Double();
double y0 = dataArea.getMinY();
double y1 = dataArea.getMaxY();
g2.setPaint(im.getOutlinePaint());
g2.setStroke(im.getOutlineStroke());
if (range.contains(start)) {
line.setLine(start2d, y0, start2d, y1);
g2.draw(line);
}
if (range.contains(end)) {
line.setLine(end2d, y0, end2d, y1);
g2.draw(line);
}
}
}
String label = marker.getLabel();
RectangleAnchor anchor = marker.getLabelAnchor();
if (label != null) {
Font labelFont = marker.getLabelFont();
g2.setFont(labelFont);
g2.setPaint(marker.getLabelPaint());
Point2D coordinates = calculateRangeMarkerTextAnchorPoint(
g2, orientation, dataArea, rect,
marker.getLabelOffset(), marker.getLabelOffsetType(),
anchor);
TextUtilities.drawAlignedString(label, g2,
(float) coordinates.getX(), (float) coordinates.getY(),
marker.getLabelTextAnchor());
}
g2.setComposite(savedComposite);
}
}
Draws a marker for the range axis. |
public boolean equals(Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof AbstractCategoryItemRenderer)) {
return false;
}
AbstractCategoryItemRenderer that = (AbstractCategoryItemRenderer) obj;
if (!ObjectUtilities.equal(this.itemLabelGenerator,
that.itemLabelGenerator)) {
return false;
}
if (!ObjectUtilities.equal(this.itemLabelGeneratorList,
that.itemLabelGeneratorList)) {
return false;
}
if (!ObjectUtilities.equal(this.baseItemLabelGenerator,
that.baseItemLabelGenerator)) {
return false;
}
if (!ObjectUtilities.equal(this.toolTipGenerator,
that.toolTipGenerator)) {
return false;
}
if (!ObjectUtilities.equal(this.toolTipGeneratorList,
that.toolTipGeneratorList)) {
return false;
}
if (!ObjectUtilities.equal(this.baseToolTipGenerator,
that.baseToolTipGenerator)) {
return false;
}
if (!ObjectUtilities.equal(this.itemURLGenerator,
that.itemURLGenerator)) {
return false;
}
if (!ObjectUtilities.equal(this.itemURLGeneratorList,
that.itemURLGeneratorList)) {
return false;
}
if (!ObjectUtilities.equal(this.baseItemURLGenerator,
that.baseItemURLGenerator)) {
return false;
}
if (!ObjectUtilities.equal(this.legendItemLabelGenerator,
that.legendItemLabelGenerator)) {
return false;
}
if (!ObjectUtilities.equal(this.legendItemToolTipGenerator,
that.legendItemToolTipGenerator)) {
return false;
}
if (!ObjectUtilities.equal(this.legendItemURLGenerator,
that.legendItemURLGenerator)) {
return false;
}
return super.equals(obj);
}
Tests this renderer for equality with another object. |
public Range findRangeBounds(CategoryDataset dataset) {
return DatasetUtilities.findRangeBounds(dataset);
}
Returns the range of values the renderer requires to display all the
items from the specified dataset. |
public CategoryItemLabelGenerator getBaseItemLabelGenerator() {
return this.baseItemLabelGenerator;
}
Returns the base item label generator. |
public CategoryURLGenerator getBaseItemURLGenerator() {
return this.baseItemURLGenerator;
}
Returns the base item URL generator. |
public CategoryToolTipGenerator getBaseToolTipGenerator() {
return this.baseToolTipGenerator;
}
Returns the base tool tip generator (the "layer 2" generator). |
public int getColumnCount() {
return this.columnCount;
}
|
protected CategoryAxis getDomainAxis(CategoryPlot plot,
int index) {
CategoryAxis result = plot.getDomainAxis(index);
if (result == null) {
result = plot.getDomainAxis();
}
return result;
}
Returns a domain axis for a plot. |
public DrawingSupplier getDrawingSupplier() {
DrawingSupplier result = null;
CategoryPlot cp = getPlot();
if (cp != null) {
result = cp.getDrawingSupplier();
}
return result;
}
Returns the drawing supplier from the plot. |
public CategoryItemLabelGenerator getItemLabelGenerator(int row,
int column) {
return getSeriesItemLabelGenerator(row);
}
Returns the item label generator for a data item. This implementation
simply passes control to the #getSeriesItemLabelGenerator(int)
method. If, for some reason, you want a different generator for
individual items, you can override this method. |
public CategoryURLGenerator getItemURLGenerator(int row,
int column) {
return getSeriesItemURLGenerator(row);
}
Returns the URL generator for a data item. This method just calls the
getSeriesItemURLGenerator method, but you can override this behaviour if
you want to. |
public LegendItem getLegendItem(int datasetIndex,
int series) {
CategoryPlot p = getPlot();
if (p == null) {
return null;
}
// check that a legend item needs to be displayed...
if (!isSeriesVisible(series) || !isSeriesVisibleInLegend(series)) {
return null;
}
CategoryDataset dataset = p.getDataset(datasetIndex);
String label = this.legendItemLabelGenerator.generateLabel(dataset,
series);
String description = label;
String toolTipText = null;
if (this.legendItemToolTipGenerator != null) {
toolTipText = this.legendItemToolTipGenerator.generateLabel(
dataset, series);
}
String urlText = null;
if (this.legendItemURLGenerator != null) {
urlText = this.legendItemURLGenerator.generateLabel(dataset,
series);
}
Shape shape = lookupSeriesShape(series);
Paint paint = lookupSeriesPaint(series);
Paint outlinePaint = lookupSeriesOutlinePaint(series);
Stroke outlineStroke = lookupSeriesOutlineStroke(series);
LegendItem item = new LegendItem(label, description, toolTipText,
urlText, shape, paint, outlineStroke, outlinePaint);
item.setSeriesKey(dataset.getRowKey(series));
item.setSeriesIndex(series);
item.setDataset(dataset);
item.setDatasetIndex(datasetIndex);
return item;
}
|
public CategorySeriesLabelGenerator getLegendItemLabelGenerator() {
return this.legendItemLabelGenerator;
}
Returns the legend item label generator. |
public CategorySeriesLabelGenerator getLegendItemToolTipGenerator() {
return this.legendItemToolTipGenerator;
}
Returns the legend item tool tip generator. |
public CategorySeriesLabelGenerator getLegendItemURLGenerator() {
return this.legendItemURLGenerator;
}
Returns the legend item URL generator. |
public LegendItemCollection getLegendItems() {
if (this.plot == null) {
return new LegendItemCollection();
}
LegendItemCollection result = new LegendItemCollection();
int index = this.plot.getIndexOf(this);
CategoryDataset dataset = this.plot.getDataset(index);
if (dataset != null) {
int seriesCount = dataset.getRowCount();
for (int i = 0; i < seriesCount; i++) {
if (isSeriesVisibleInLegend(i)) {
LegendItem item = getLegendItem(index, i);
if (item != null) {
result.add(item);
}
}
}
}
return result;
}
Returns a (possibly empty) collection of legend items for the series
that this renderer is responsible for drawing. |
public int getPassCount() {
return 1;
}
Returns the number of passes through the dataset required by the
renderer. This method returns 1, subclasses should
override if they need more passes. |
public CategoryPlot getPlot() {
return this.plot;
}
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) {
ValueAxis result = plot.getRangeAxis(index);
if (result == null) {
result = plot.getRangeAxis();
}
return result;
}
Returns a range axis for a plot. |
public int getRowCount() {
return this.rowCount;
}
|
public CategoryItemLabelGenerator getSeriesItemLabelGenerator(int series) {
// return the generator for ALL series, if there is one...
if (this.itemLabelGenerator != null) {
return this.itemLabelGenerator;
}
// otherwise look up the generator table
CategoryItemLabelGenerator generator = (CategoryItemLabelGenerator)
this.itemLabelGeneratorList.get(series);
if (generator == null) {
generator = this.baseItemLabelGenerator;
}
return generator;
}
Returns the item label generator for a series. |
public CategoryURLGenerator getSeriesItemURLGenerator(int series) {
// return the generator for ALL series, if there is one...
if (this.itemURLGenerator != null) {
return this.itemURLGenerator;
}
// otherwise look up the generator table
CategoryURLGenerator generator
= (CategoryURLGenerator) this.itemURLGeneratorList.get(series);
if (generator == null) {
generator = this.baseItemURLGenerator;
}
return generator;
}
Returns the URL generator for a series. |
public CategoryToolTipGenerator getSeriesToolTipGenerator(int series) {
return (CategoryToolTipGenerator) this.toolTipGeneratorList.get(series);
}
Returns the tool tip generator for the specified series (a "layer 1"
generator). |
public CategoryToolTipGenerator getToolTipGenerator() {
return this.toolTipGenerator;
} Deprecated! This - method should no longer be used (as of version 1.0.6).
It is sufficient to rely on #getSeriesToolTipGenerator(int)
and #getBaseToolTipGenerator() .
Returns the tool tip generator that will be used for ALL items in the
dataset (the "layer 0" generator). |
public CategoryToolTipGenerator getToolTipGenerator(int row,
int column) {
CategoryToolTipGenerator result = null;
if (this.toolTipGenerator != null) {
result = this.toolTipGenerator;
}
else {
result = getSeriesToolTipGenerator(row);
if (result == null) {
result = this.baseToolTipGenerator;
}
}
return result;
}
Returns the tool tip generator that should be used for the specified
item. This method looks up the generator using the "three-layer"
approach outlined in the general description of this interface. You
can override this method if you want to return a different generator per
item. |
public int hashCode() {
int result = super.hashCode();
return result;
}
Returns a hash code for the renderer. |
public CategoryItemRendererState initialise(Graphics2D g2,
Rectangle2D dataArea,
CategoryPlot plot,
int rendererIndex,
PlotRenderingInfo info) {
setPlot(plot);
CategoryDataset data = plot.getDataset(rendererIndex);
if (data != null) {
this.rowCount = data.getRowCount();
this.columnCount = data.getColumnCount();
}
else {
this.rowCount = 0;
this.columnCount = 0;
}
return createState(info);
}
Initialises the renderer and returns a state object that will be used
for the remainder of the drawing process for a single chart. The state
object allows for the fact that the renderer may be used simultaneously
by multiple threads (each thread will work with a separate state object). |
public void setBaseItemLabelGenerator(CategoryItemLabelGenerator generator) {
this.baseItemLabelGenerator = generator;
fireChangeEvent();
}
Sets the base item label generator and sends a
RendererChangeEvent to all registered listeners. |
public void setBaseItemURLGenerator(CategoryURLGenerator generator) {
this.baseItemURLGenerator = generator;
fireChangeEvent();
}
|
public void setBaseToolTipGenerator(CategoryToolTipGenerator generator) {
this.baseToolTipGenerator = generator;
fireChangeEvent();
}
|
public void setItemLabelGenerator(CategoryItemLabelGenerator generator) {
this.itemLabelGenerator = generator;
fireChangeEvent();
} Deprecated! This - method should no longer be used (as of version 1.0.6).
It is sufficient to rely on #setSeriesItemLabelGenerator(int,
CategoryItemLabelGenerator) and
#setBaseItemLabelGenerator(CategoryItemLabelGenerator) .
Sets the item label generator for ALL series and sends a
RendererChangeEvent to all registered listeners. |
public void setItemURLGenerator(CategoryURLGenerator generator) {
this.itemURLGenerator = generator;
fireChangeEvent();
} Deprecated! This - method should no longer be used (as of version 1.0.6).
It is sufficient to rely on #setSeriesItemURLGenerator(int,
CategoryURLGenerator) and
#setBaseItemURLGenerator(CategoryURLGenerator) .
Sets the item URL generator for ALL series and sends a
RendererChangeEvent to all registered listeners. |
public void setLegendItemLabelGenerator(CategorySeriesLabelGenerator generator) {
if (generator == null) {
throw new IllegalArgumentException("Null 'generator' argument.");
}
this.legendItemLabelGenerator = generator;
fireChangeEvent();
}
Sets the legend item label generator and sends a
RendererChangeEvent to all registered listeners. |
public void setLegendItemToolTipGenerator(CategorySeriesLabelGenerator generator) {
this.legendItemToolTipGenerator = generator;
fireChangeEvent();
}
Sets the legend item tool tip generator and sends a
RendererChangeEvent to all registered listeners. |
public void setLegendItemURLGenerator(CategorySeriesLabelGenerator generator) {
this.legendItemURLGenerator = generator;
fireChangeEvent();
}
Sets the legend item URL generator and sends a
RendererChangeEvent to all registered listeners. |
public void setPlot(CategoryPlot plot) {
if (plot == null) {
throw new IllegalArgumentException("Null 'plot' argument.");
}
this.plot = plot;
}
Sets the plot that the renderer has been assigned to. This method is
usually called by the CategoryPlot , in normal usage you
shouldn't need to call this method directly. |
public void setSeriesItemLabelGenerator(int series,
CategoryItemLabelGenerator generator) {
this.itemLabelGeneratorList.set(series, generator);
fireChangeEvent();
}
Sets the item label generator for a series and sends a
RendererChangeEvent to all registered listeners. |
public void setSeriesItemURLGenerator(int series,
CategoryURLGenerator generator) {
this.itemURLGeneratorList.set(series, generator);
fireChangeEvent();
}
Sets the URL generator for a series and sends a
RendererChangeEvent to all registered listeners. |
public void setSeriesToolTipGenerator(int series,
CategoryToolTipGenerator generator) {
this.toolTipGeneratorList.set(series, generator);
fireChangeEvent();
}
Sets the tool tip generator for a series and sends a
RendererChangeEvent to all registered listeners. |
public void setToolTipGenerator(CategoryToolTipGenerator generator) {
this.toolTipGenerator = generator;
fireChangeEvent();
} Deprecated! This - method should no longer be used (as of version 1.0.6).
It is sufficient to rely on #setSeriesToolTipGenerator(int,
CategoryToolTipGenerator) and
#setBaseToolTipGenerator(CategoryToolTipGenerator) .
|