java.lang.Object
org.jfree.chart.renderer.AbstractRenderer
org.jfree.chart.renderer.DefaultPolarItemRenderer
- All Implemented Interfaces:
Serializable
,Cloneable
,PolarItemRenderer
A renderer that can be used with the
PolarPlot
class.- See Also:
-
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
ConstructorDescriptionCreates a new instance of DefaultPolarItemRenderer -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addEntity
(EntityCollection entities, Shape area, XYDataset dataset, int series, int item, double entityX, double entityY) Adds an entity to the collection.clone()
Returns a clone of the renderer.void
drawAngularGridLines
(Graphics2D g2, PolarPlot plot, List ticks, Rectangle2D dataArea) Draw the angular gridlines - the spokes.void
drawRadialGridLines
(Graphics2D g2, PolarPlot plot, ValueAxis radialAxis, List ticks, Rectangle2D dataArea) Draw the radial gridlines - the rings.void
drawSeries
(Graphics2D g2, Rectangle2D dataArea, PlotRenderingInfo info, PolarPlot plot, XYDataset dataset, int seriesIndex) Plots the data for a given series.boolean
Tests this renderer for equality with an arbitrary object.Returns the default tool tip generator.boolean
Returnstrue
if first and last point of a series will be connected,false
otherwise.Returns the drawing supplier from the plot.boolean
Returnstrue
if the renderer will draw an outline around a filled polygon,false
otherwise.Get the composite that is used for filling.getLegendItem
(int series) Return the legend for the given series.Returns the legend item tool tip generator.Returns the legend item URL generator.Returns the shape used to represent a line in the legend.getPlot()
Return the plot associated with this renderer.getSeriesToolTipGenerator
(int series) Returns the tool tip generator for the specified series.boolean
Returnstrue
if a shape will be drawn for every item, orfalse
if not.getToolTipGenerator
(int series, int item) Returns the tooltip generator for the specified series and item.Returns the URL generator.boolean
Returnstrue
if the renderer should use the fill paint setting to fill shapes, andfalse
if it should just use the regular paint.boolean
isSeriesFilled
(int series) Returnstrue
if the renderer should fill the specified series, andfalse
otherwise.void
setBaseToolTipGenerator
(XYToolTipGenerator generator) Sets the default tool tip generator and sends aRendererChangeEvent
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 aRendererChangeEvent
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 aRendererChangeEvent
to all registered listeners.void
setFillComposite
(Composite composite) Sets the composite which will be used for filling polygons and sends aRendererChangeEvent
to all registered listeners.void
Sets the legend item tool tip generator and sends aRendererChangeEvent
to all registered listeners.void
setLegendItemURLGenerator
(XYSeriesLabelGenerator generator) Sets the legend item URL generator and sends aRendererChangeEvent
to all registered listeners.void
setLegendLine
(Shape line) Sets the shape used as a line in each legend item and sends aRendererChangeEvent
to all registered listeners.void
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 tooltip generator for the specified series.void
setShapesVisible
(boolean visible) Set the flag that controls whether a shape will be drawn for every item, or not and sends aRendererChangeEvent
to all registered listeners.void
setURLGenerator
(XYURLGenerator urlGenerator) Sets the URL generator.void
setUseFillPaint
(boolean flag) Sets the flag that controls whether the fill paint is used to fill shapes, and sends aRendererChangeEvent
to all registered listeners.Methods inherited from class org.jfree.chart.renderer.AbstractRenderer
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, hashCode, 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
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 Details
-
DefaultPolarItemRenderer
public DefaultPolarItemRenderer()Creates a new instance of DefaultPolarItemRenderer
-
-
Method Details
-
setPlot
Set the plot associated with this renderer.- Specified by:
setPlot
in interfacePolarItemRenderer
- Parameters:
plot
- the plot.- See Also:
-
getPlot
Return the plot associated with this renderer.- Specified by:
getPlot
in interfacePolarItemRenderer
- Returns:
- The plot.
- See Also:
-
getDrawOutlineWhenFilled
public boolean getDrawOutlineWhenFilled()Returnstrue
if the renderer will draw an outline around a filled polygon,false
otherwise.- Returns:
- A boolean.
-
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 aRendererChangeEvent
to all registered listeners.- Parameters:
drawOutlineWhenFilled
- the flag.
-
getFillComposite
Get the composite that is used for filling.- Returns:
- The composite (never
null
).
-
setFillComposite
Sets the composite which will be used for filling polygons and sends aRendererChangeEvent
to all registered listeners.- Parameters:
composite
- the composite to use (null
not permitted).
-
getShapesVisible
public boolean getShapesVisible()Returnstrue
if a shape will be drawn for every item, orfalse
if not.- Returns:
- A boolean.
-
setShapesVisible
public void setShapesVisible(boolean visible) Set the flag that controls whether a shape will be drawn for every item, or not and sends aRendererChangeEvent
to all registered listeners.- Parameters:
visible
- the flag.
-
getConnectFirstAndLastPoint
public boolean getConnectFirstAndLastPoint()Returnstrue
if first and last point of a series will be connected,false
otherwise.- Returns:
- The current status of the flag.
-
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 aRendererChangeEvent
to all registered listeners.- Parameters:
connect
- the flag.
-
getDrawingSupplier
Returns the drawing supplier from the plot.- Specified by:
getDrawingSupplier
in classAbstractRenderer
- Returns:
- The drawing supplier.
-
isSeriesFilled
public boolean isSeriesFilled(int series) Returnstrue
if the renderer should fill the specified series, andfalse
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()Returnstrue
if the renderer should use the fill paint setting to fill shapes, andfalse
if it should just use the regular paint.- Returns:
- A boolean.
- See Also:
-
setUseFillPaint
public void setUseFillPaint(boolean flag) Sets the flag that controls whether the fill paint is used to fill shapes, and sends aRendererChangeEvent
to all registered listeners.- Parameters:
flag
- the flag.- See Also:
-
getLegendLine
Returns the shape used to represent a line in the legend.- Returns:
- The legend line (never
null
). - See Also:
-
setLegendLine
Sets the shape used as a line in each legend item and sends aRendererChangeEvent
to all registered listeners.- Parameters:
line
- the line (null
not permitted).- See Also:
-
addEntity
protected void addEntity(EntityCollection entities, 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 (ifnull
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 ifarea
isnull
).entityY
- the entity's center y-coordinate in user space (only used ifarea
isnull
).
-
drawSeries
public void drawSeries(Graphics2D g2, Rectangle2D dataArea, PlotRenderingInfo info, PolarPlot plot, XYDataset dataset, int seriesIndex) Plots the data for a given series.- Specified by:
drawSeries
in interfacePolarItemRenderer
- 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
Draw the angular gridlines - the spokes.- Specified by:
drawAngularGridLines
in interfacePolarItemRenderer
- Parameters:
g2
- the drawing surface.plot
- the plot (null
not permitted).ticks
- the ticks (null
not permitted).dataArea
- the data area.
-
drawRadialGridLines
public void drawRadialGridLines(Graphics2D g2, PolarPlot plot, ValueAxis radialAxis, List ticks, Rectangle2D dataArea) Draw the radial gridlines - the rings.- Specified by:
drawRadialGridLines
in interfacePolarItemRenderer
- Parameters:
g2
- the drawing surface (null
not permitted).plot
- the plot (null
not permitted).radialAxis
- the radial axis (null
not permitted).ticks
- the ticks (null
not permitted).dataArea
- the data area.
-
getLegendItem
Return the legend for the given series.- Specified by:
getLegendItem
in interfacePolarItemRenderer
- Parameters:
series
- the series index.- Returns:
- The legend item.
-
getToolTipGenerator
Returns the tooltip generator for the specified series and item.- Specified by:
getToolTipGenerator
in interfacePolarItemRenderer
- Parameters:
series
- the series index.item
- the item index.- Returns:
- The tooltip generator (possibly
null
).
-
getSeriesToolTipGenerator
Returns the tool tip generator for the specified series.- Specified by:
getSeriesToolTipGenerator
in interfacePolarItemRenderer
- Parameters:
series
- the series index (zero based).- Returns:
- The tooltip generator (possibly
null
). - See Also:
-
setSeriesToolTipGenerator
Sets the tooltip generator for the specified series.- Specified by:
setSeriesToolTipGenerator
in interfacePolarItemRenderer
- Parameters:
series
- the series index.generator
- the tool tip generator (null
permitted).- See Also:
-
getBaseToolTipGenerator
Returns the default tool tip generator.- Specified by:
getBaseToolTipGenerator
in interfacePolarItemRenderer
- Returns:
- The default tool tip generator (possibly
null
). - See Also:
-
setBaseToolTipGenerator
Sets the default tool tip generator and sends aRendererChangeEvent
to all registered listeners.- Specified by:
setBaseToolTipGenerator
in interfacePolarItemRenderer
- Parameters:
generator
- the generator (null
permitted).- See Also:
-
getURLGenerator
Returns the URL generator.- Specified by:
getURLGenerator
in interfacePolarItemRenderer
- Returns:
- The URL generator (possibly
null
).
-
setURLGenerator
Sets the URL generator.- Specified by:
setURLGenerator
in interfacePolarItemRenderer
- Parameters:
urlGenerator
- the generator (null
permitted)
-
getLegendItemToolTipGenerator
Returns the legend item tool tip generator.- Returns:
- The tool tip generator (possibly
null
). - See Also:
-
setLegendItemToolTipGenerator
Sets the legend item tool tip generator and sends aRendererChangeEvent
to all registered listeners.- Parameters:
generator
- the generator (null
permitted).- See Also:
-
getLegendItemURLGenerator
Returns the legend item URL generator.- Returns:
- The URL generator (possibly
null
). - See Also:
-
setLegendItemURLGenerator
Sets the legend item URL generator and sends aRendererChangeEvent
to all registered listeners.- Parameters:
generator
- the generator (null
permitted).- See Also:
-
equals
Tests this renderer for equality with an arbitrary object.- Overrides:
equals
in classAbstractRenderer
- Parameters:
obj
- the object (null
not permitted).- Returns:
true
if this renderer is equal toobj
, andfalse
otherwise.
-
clone
Returns a clone of the renderer.- Overrides:
clone
in classAbstractRenderer
- Returns:
- A clone.
- Throws:
CloneNotSupportedException
- if the renderer cannot be cloned.
-