org.jfree.chart.renderer
Class DefaultPolarItemRenderer

java.lang.Object
  extended by org.jfree.chart.renderer.AbstractRenderer
      extended by org.jfree.chart.renderer.DefaultPolarItemRenderer
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, PolarItemRenderer

public class DefaultPolarItemRenderer
extends AbstractRenderer
implements PolarItemRenderer

A renderer that can be used with the PolarPlot class.

See Also:
Serialized Form

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
DefaultPolarItemRenderer()
          Creates a new instance of DefaultPolarItemRenderer
 
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.
 java.lang.Object clone()
          Returns a clone of the renderer.
 void drawAngularGridLines(java.awt.Graphics2D g2, PolarPlot plot, java.util.List ticks, java.awt.geom.Rectangle2D dataArea)
          Draw the angular gridlines - the spokes.
 void drawRadialGridLines(java.awt.Graphics2D g2, PolarPlot plot, ValueAxis radialAxis, java.util.List ticks, java.awt.geom.Rectangle2D dataArea)
          Draw the radial gridlines - the rings.
 void drawSeries(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D dataArea, PlotRenderingInfo info, PolarPlot plot, XYDataset dataset, int seriesIndex)
          Plots the data for a given series.
 boolean equals(java.lang.Object obj)
          Tests this renderer for equality with an arbitrary object.
 XYToolTipGenerator getBaseToolTipGenerator()
          Returns the base tool tip generator.
 boolean getConnectFirstAndLastPoint()
          Returns true if first and last point of a series will be connected, false otherwise.
 DrawingSupplier getDrawingSupplier()
          Returns the drawing supplier from the plot.
 boolean getDrawOutlineWhenFilled()
          Returns true if the renderer will draw an outline around a filled polygon, false otherwise.
 java.awt.Composite getFillComposite()
          Get the composite that is used for filling.
 LegendItem getLegendItem(int series)
          Return the legend for the given series.
 XYSeriesLabelGenerator getLegendItemToolTipGenerator()
          Returns the legend item tool tip generator.
 XYSeriesLabelGenerator getLegendItemURLGenerator()
          Returns the legend item URL generator.
 java.awt.Shape getLegendLine()
          Returns the shape used to represent a line in the legend.
 PolarPlot getPlot()
          Return the plot associated with this renderer.
 XYToolTipGenerator getSeriesToolTipGenerator(int series)
          Returns the tool tip generator for a series.
 boolean getShapesVisible()
          Returns true if a shape will be drawn for every item, or false if not.
 XYToolTipGenerator getToolTipGenerator(int series, int item)
          Returns the tool tip generator for a data item.
 XYURLGenerator getURLGenerator()
          Returns the URL generator for HTML image maps.
 boolean getUseFillPaint()
          Returns true if the renderer should use the fill paint setting to fill shapes, and false if it should just use the regular paint.
 boolean isSeriesFilled(int series)
          Returns true if the renderer should fill the specified series, and false otherwise.
 void setBaseToolTipGenerator(XYToolTipGenerator generator)
          Sets the base tool tip generator and sends a RendererChangeEvent to all registered listeners.
 void setConnectFirstAndLastPoint(boolean connect)
          Set the flag that controls whether the first and last point of a series will be connected or not and sends a RendererChangeEvent to all registered listeners.
 void setDrawOutlineWhenFilled(boolean drawOutlineWhenFilled)
          Set the flag that controls whether the outline around a filled polygon will be drawn or not and sends a RendererChangeEvent to all registered listeners.
 void setFillComposite(java.awt.Composite composite)
          Set the composite which will be used for filling polygons and sends a RendererChangeEvent to all registered listeners.
 void setLegendItemToolTipGenerator(XYSeriesLabelGenerator generator)
          Sets the legend item tool tip generator and sends a RendererChangeEvent to all registered listeners.
 void setLegendItemURLGenerator(XYSeriesLabelGenerator generator)
          Sets the legend item URL generator and sends a RendererChangeEvent to all registered listeners.
 void setLegendLine(java.awt.Shape line)
          Sets the shape used as a line in each legend item and sends a RendererChangeEvent to all registered listeners.
 void setPlot(PolarPlot plot)
          Set the plot associated with this renderer.
 void setSeriesFilled(int series, boolean filled)
          Sets a flag that controls whether or not a series is filled.
 void setSeriesToolTipGenerator(int series, XYToolTipGenerator generator)
          Sets the tool tip generator for a series and sends a RendererChangeEvent to all registered listeners.
 void setShapesVisible(boolean visible)
          Set the flag that controls whether a shape will be drawn for every item, or not and sends a RendererChangeEvent to all registered listeners.
 void setURLGenerator(XYURLGenerator urlGenerator)
          Sets the URL generator for HTML image maps.
 void setUseFillPaint(boolean flag)
          Sets the flag that controls whether the fill paint is used to fill shapes, and sends a RendererChangeEvent to all registered listeners.
 
Methods inherited from class org.jfree.chart.renderer.AbstractRenderer
addChangeListener, calculateLabelAnchorPoint, clearSeriesPaints, clearSeriesStrokes, fireChangeEvent, getAutoPopulateSeriesFillPaint, getAutoPopulateSeriesOutlinePaint, getAutoPopulateSeriesOutlineStroke, getAutoPopulateSeriesPaint, getAutoPopulateSeriesShape, getAutoPopulateSeriesStroke, getBaseCreateEntities, getBaseFillPaint, getBaseItemLabelFont, getBaseItemLabelPaint, getBaseItemLabelsVisible, getBaseLegendShape, getBaseLegendTextFont, getBaseLegendTextPaint, getBaseNegativeItemLabelPosition, getBaseOutlinePaint, getBaseOutlineStroke, getBasePaint, getBasePositiveItemLabelPosition, getBaseSeriesVisible, getBaseSeriesVisibleInLegend, getBaseShape, getBaseStroke, getCreateEntities, getDataBoundsIncludesVisibleSeriesOnly, getDefaultEntityRadius, getItemCreateEntity, getItemFillPaint, getItemLabelAnchorOffset, getItemLabelFont, getItemLabelFont, getItemLabelPaint, getItemLabelPaint, getItemOutlinePaint, getItemOutlineStroke, getItemPaint, getItemShape, getItemStroke, getItemVisible, getLegendShape, getLegendTextFont, getLegendTextPaint, getNegativeItemLabelPosition, getNegativeItemLabelPosition, getPositiveItemLabelPosition, getPositiveItemLabelPosition, getSeriesCreateEntities, getSeriesFillPaint, getSeriesItemLabelFont, getSeriesItemLabelPaint, getSeriesNegativeItemLabelPosition, getSeriesOutlinePaint, getSeriesOutlineStroke, getSeriesPaint, getSeriesPositiveItemLabelPosition, getSeriesShape, getSeriesStroke, getSeriesVisible, getSeriesVisible, getSeriesVisibleInLegend, getSeriesVisibleInLegend, getTreatLegendShapeAsLine, hashCode, hasListener, isItemLabelVisible, isSeriesItemLabelsVisible, isSeriesVisible, isSeriesVisibleInLegend, lookupLegendShape, lookupLegendTextFont, lookupLegendTextPaint, lookupSeriesFillPaint, lookupSeriesOutlinePaint, lookupSeriesOutlineStroke, lookupSeriesPaint, lookupSeriesShape, lookupSeriesStroke, notifyListeners, removeChangeListener, setAutoPopulateSeriesFillPaint, setAutoPopulateSeriesOutlinePaint, setAutoPopulateSeriesOutlineStroke, setAutoPopulateSeriesPaint, setAutoPopulateSeriesShape, setAutoPopulateSeriesStroke, setBaseCreateEntities, setBaseCreateEntities, setBaseFillPaint, setBaseFillPaint, setBaseItemLabelFont, setBaseItemLabelFont, setBaseItemLabelPaint, setBaseItemLabelPaint, setBaseItemLabelsVisible, setBaseItemLabelsVisible, setBaseItemLabelsVisible, setBaseLegendShape, setBaseLegendTextFont, setBaseLegendTextPaint, setBaseNegativeItemLabelPosition, setBaseNegativeItemLabelPosition, setBaseOutlinePaint, setBaseOutlinePaint, setBaseOutlineStroke, setBaseOutlineStroke, setBasePaint, setBasePaint, setBasePositiveItemLabelPosition, setBasePositiveItemLabelPosition, setBaseSeriesVisible, setBaseSeriesVisible, setBaseSeriesVisibleInLegend, setBaseSeriesVisibleInLegend, setBaseShape, setBaseShape, setBaseStroke, setBaseStroke, setCreateEntities, setCreateEntities, setDataBoundsIncludesVisibleSeriesOnly, setDefaultEntityRadius, setFillPaint, setFillPaint, setItemLabelAnchorOffset, setItemLabelFont, setItemLabelFont, setItemLabelPaint, setItemLabelPaint, setItemLabelsVisible, setItemLabelsVisible, setItemLabelsVisible, setLegendShape, setLegendTextFont, setLegendTextPaint, setNegativeItemLabelPosition, setNegativeItemLabelPosition, setOutlinePaint, setOutlinePaint, setOutlineStroke, setOutlineStroke, setPaint, setPaint, setPositiveItemLabelPosition, setPositiveItemLabelPosition, 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, setSeriesVisible, setSeriesVisible, setSeriesVisibleInLegend, setSeriesVisibleInLegend, setSeriesVisibleInLegend, setSeriesVisibleInLegend, setShape, setShape, setStroke, setStroke, setTreatLegendShapeAsLine
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jfree.chart.renderer.PolarItemRenderer
addChangeListener, removeChangeListener
 

Constructor Detail

DefaultPolarItemRenderer

public DefaultPolarItemRenderer()
Creates a new instance of DefaultPolarItemRenderer

Method Detail

setPlot

public void setPlot(PolarPlot plot)
Set the plot associated with this renderer.

Specified by:
setPlot in interface PolarItemRenderer
Parameters:
plot - the plot.
See Also:
getPlot()

getPlot

public PolarPlot getPlot()
Return the plot associated with this renderer.

Specified by:
getPlot in interface PolarItemRenderer
Returns:
The plot.
See Also:
setPlot(PolarPlot)

getDrawOutlineWhenFilled

public boolean getDrawOutlineWhenFilled()
Returns true if the renderer will draw an outline around a filled polygon, false otherwise.

Returns:
A boolean.
Since:
1.0.14

setDrawOutlineWhenFilled

public void setDrawOutlineWhenFilled(boolean drawOutlineWhenFilled)
Set the flag that controls whether the outline around a filled polygon will be drawn or not and sends a RendererChangeEvent to all registered listeners.

Parameters:
drawOutlineWhenFilled - the flag.
Since:
1.0.14

getFillComposite

public java.awt.Composite getFillComposite()
Get the composite that is used for filling.

Returns:
The composite (never null).
Since:
1.0.14

setFillComposite

public void setFillComposite(java.awt.Composite composite)
Set the composite which will be used for filling polygons and sends a RendererChangeEvent to all registered listeners.

Parameters:
composite - the composite to use (null not permitted).
Since:
1.0.14

getShapesVisible

public boolean getShapesVisible()
Returns true if a shape will be drawn for every item, or false if not.

Returns:
A boolean.
Since:
1.0.14

setShapesVisible

public void setShapesVisible(boolean visible)
Set the flag that controls whether a shape will be drawn for every item, or not and sends a RendererChangeEvent to all registered listeners.

Parameters:
visible - the flag.
Since:
1.0.14

getConnectFirstAndLastPoint

public boolean getConnectFirstAndLastPoint()
Returns true if first and last point of a series will be connected, false otherwise.

Returns:
The current status of the flag.
Since:
1.0.14

setConnectFirstAndLastPoint

public void setConnectFirstAndLastPoint(boolean connect)
Set the flag that controls whether the first and last point of a series will be connected or not and sends a RendererChangeEvent to all registered listeners.

Parameters:
connect - the flag.
Since:
1.0.14

getDrawingSupplier

public DrawingSupplier getDrawingSupplier()
Returns the drawing supplier from the plot.

Specified by:
getDrawingSupplier in class AbstractRenderer
Returns:
The drawing supplier.

isSeriesFilled

public boolean isSeriesFilled(int series)
Returns true if the renderer should fill the specified series, and false otherwise.

Parameters:
series - the series index (zero-based).
Returns:
A boolean.

setSeriesFilled

public void setSeriesFilled(int series,
                            boolean filled)
Sets a flag that controls whether or not a series is filled.

Parameters:
series - the series index.
filled - the flag.

getUseFillPaint

public boolean getUseFillPaint()
Returns true if the renderer should use the fill paint setting to fill shapes, and false if it should just use the regular paint.

Returns:
A boolean.
Since:
1.0.14
See Also:
setUseFillPaint(boolean)

setUseFillPaint

public void setUseFillPaint(boolean flag)
Sets the flag that controls whether the fill paint is used to fill shapes, and sends a RendererChangeEvent to all registered listeners.

Parameters:
flag - the flag.
Since:
1.0.14
See Also:
getUseFillPaint()

getLegendLine

public java.awt.Shape getLegendLine()
Returns the shape used to represent a line in the legend.

Returns:
The legend line (never null).
See Also:
setLegendLine(Shape)

setLegendLine

public void setLegendLine(java.awt.Shape line)
Sets the shape used as a line in each legend item and sends a RendererChangeEvent to all registered listeners.

Parameters:
line - the line (null not permitted).
See Also:
getLegendLine()

addEntity

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.

Parameters:
entities - the entity collection being populated.
area - the entity area (if null a default will be used).
dataset - the dataset.
series - the series.
item - 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).

drawSeries

public void drawSeries(java.awt.Graphics2D g2,
                       java.awt.geom.Rectangle2D dataArea,
                       PlotRenderingInfo info,
                       PolarPlot plot,
                       XYDataset dataset,
                       int seriesIndex)
Plots the data for a given series.

Specified by:
drawSeries in interface PolarItemRenderer
Parameters:
g2 - the drawing surface.
dataArea - the data area.
info - collects plot rendering info.
plot - the plot.
dataset - the dataset.
seriesIndex - the series index.

drawAngularGridLines

public void drawAngularGridLines(java.awt.Graphics2D g2,
                                 PolarPlot plot,
                                 java.util.List ticks,
                                 java.awt.geom.Rectangle2D dataArea)
Draw the angular gridlines - the spokes.

Specified by:
drawAngularGridLines in interface PolarItemRenderer
Parameters:
g2 - the drawing surface.
plot - the plot.
ticks - the ticks.
dataArea - the data area.

drawRadialGridLines

public void drawRadialGridLines(java.awt.Graphics2D g2,
                                PolarPlot plot,
                                ValueAxis radialAxis,
                                java.util.List ticks,
                                java.awt.geom.Rectangle2D dataArea)
Draw the radial gridlines - the rings.

Specified by:
drawRadialGridLines in interface PolarItemRenderer
Parameters:
g2 - the drawing surface.
plot - the plot.
radialAxis - the radial axis.
ticks - the ticks.
dataArea - the data area.

getLegendItem

public LegendItem getLegendItem(int series)
Return the legend for the given series.

Specified by:
getLegendItem in interface PolarItemRenderer
Parameters:
series - the series index.
Returns:
The legend item.

getToolTipGenerator

public XYToolTipGenerator getToolTipGenerator(int series,
                                              int item)
Description copied from interface: PolarItemRenderer
Returns the tool tip generator for a data item.

Specified by:
getToolTipGenerator in interface PolarItemRenderer
Parameters:
series - the row index (zero based).
item - the column index (zero based).
Returns:
The generator (possibly null).
Since:
1.0.14

getSeriesToolTipGenerator

public XYToolTipGenerator getSeriesToolTipGenerator(int series)
Description copied from interface: PolarItemRenderer
Returns the tool tip generator for a series.

Specified by:
getSeriesToolTipGenerator in interface PolarItemRenderer
Parameters:
series - the series index (zero based).
Returns:
The generator (possibly null).
Since:
1.0.14
See Also:
PolarItemRenderer.setSeriesToolTipGenerator(int, XYToolTipGenerator)

setSeriesToolTipGenerator

public void setSeriesToolTipGenerator(int series,
                                      XYToolTipGenerator generator)
Description copied from interface: PolarItemRenderer
Sets the tool tip generator for a series and sends a RendererChangeEvent to all registered listeners.

Specified by:
setSeriesToolTipGenerator in interface PolarItemRenderer
Parameters:
series - the series index (zero based).
generator - the generator (null permitted).
Since:
1.0.14
See Also:
PolarItemRenderer.getSeriesToolTipGenerator(int)

getBaseToolTipGenerator

public XYToolTipGenerator getBaseToolTipGenerator()
Description copied from interface: PolarItemRenderer
Returns the base tool tip generator.

Specified by:
getBaseToolTipGenerator in interface PolarItemRenderer
Returns:
The generator (possibly null).
Since:
1.0.14
See Also:
PolarItemRenderer.setBaseToolTipGenerator(XYToolTipGenerator)

setBaseToolTipGenerator

public void setBaseToolTipGenerator(XYToolTipGenerator generator)
Description copied from interface: PolarItemRenderer
Sets the base tool tip generator and sends a RendererChangeEvent to all registered listeners.

Specified by:
setBaseToolTipGenerator in interface PolarItemRenderer
Parameters:
generator - the generator (null permitted).
Since:
1.0.14
See Also:
PolarItemRenderer.getBaseToolTipGenerator()

getURLGenerator

public XYURLGenerator getURLGenerator()
Description copied from interface: PolarItemRenderer
Returns the URL generator for HTML image maps.

Specified by:
getURLGenerator in interface PolarItemRenderer
Returns:
The URL generator (possibly null).
Since:
1.0.14

setURLGenerator

public void setURLGenerator(XYURLGenerator urlGenerator)
Description copied from interface: PolarItemRenderer
Sets the URL generator for HTML image maps.

Specified by:
setURLGenerator in interface PolarItemRenderer
Parameters:
urlGenerator - the URL generator (null permitted).
Since:
1.0.14

getLegendItemToolTipGenerator

public XYSeriesLabelGenerator getLegendItemToolTipGenerator()
Returns the legend item tool tip generator.

Returns:
The tool tip generator (possibly null).
Since:
1.0.14
See Also:
setLegendItemToolTipGenerator(XYSeriesLabelGenerator)

setLegendItemToolTipGenerator

public void setLegendItemToolTipGenerator(XYSeriesLabelGenerator generator)
Sets the legend item tool tip generator and sends a RendererChangeEvent to all registered listeners.

Parameters:
generator - the generator (null permitted).
Since:
1.0.14
See Also:
getLegendItemToolTipGenerator()

getLegendItemURLGenerator

public XYSeriesLabelGenerator getLegendItemURLGenerator()
Returns the legend item URL generator.

Returns:
The URL generator (possibly null).
Since:
1.0.14
See Also:
setLegendItemURLGenerator(XYSeriesLabelGenerator)

setLegendItemURLGenerator

public void setLegendItemURLGenerator(XYSeriesLabelGenerator generator)
Sets the legend item URL generator and sends a RendererChangeEvent to all registered listeners.

Parameters:
generator - the generator (null permitted).
Since:
1.0.14
See Also:
getLegendItemURLGenerator()

equals

public boolean equals(java.lang.Object obj)
Tests this renderer for equality with an arbitrary object.

Overrides:
equals in class AbstractRenderer
Parameters:
obj - the object (null not permitted).
Returns:
true if this renderer is equal to obj, and false otherwise.

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Returns a clone of the renderer.

Overrides:
clone in class AbstractRenderer
Returns:
A clone.
Throws:
java.lang.CloneNotSupportedException - if the renderer cannot be cloned.