java.lang.Object
org.jfree.chart.StandardChartTheme
- All Implemented Interfaces:
Serializable
,Cloneable
,ChartTheme
,PublicCloneable
public class StandardChartTheme
extends Object
implements ChartTheme, Cloneable, PublicCloneable, Serializable
A default implementation of the
ChartTheme
interface. This
implementation just collects a whole bunch of chart attributes and mimics
the manual process of applying each attribute to the right sub-object
within the JFreeChart instance. It's not elegant code, but it works.- See Also:
-
Constructor Summary
ConstructorDescriptionStandardChartTheme
(String name) Creates a new default instance.StandardChartTheme
(String name, boolean shadow) Creates a new default instance. -
Method Summary
Modifier and TypeMethodDescriptionvoid
apply
(JFreeChart chart) Applies this theme to the supplied chart.protected void
applyToAbstractRenderer
(AbstractRenderer renderer) Applies the attributes for this theme to anAbstractRenderer
.protected void
Applies the attributes of this theme to the specified block.protected void
Applies the attributes of this theme to the specified container.protected void
Applies the attributes for this theme to aCategoryAxis
.protected void
Applies the settings of this theme to the specified renderer.protected void
Applies the attributes of this theme to aCategoryPlot
.protected void
Applies the attributes of this theme to aFastScatterPlot
.protected void
applyToMeterPlot
(MeterPlot plot) Applies the attributes of this theme to aMeterPlot
.protected void
Applies the attributes of this theme to aMultiplePiePlot
.protected void
applyToPeriodAxis
(PeriodAxis axis) Applies the attributes for this theme to aPeriodAxis
.protected void
applyToPiePlot
(PiePlot plot) Applies the attributes of this theme to aPiePlot
instance.protected void
applyToPlot
(Plot plot) Applies the attributes of this theme to a plot.protected void
applyToPolarPlot
(PolarPlot plot) Applies the attributes of this theme to aPolarPlot
.protected void
Applies the attributes of this theme to aSpiderWebPlot
.protected void
applyToSymbolAxis
(SymbolAxis axis) Applies the attributes for this theme to aSymbolAxis
.protected void
Applies the attributes for this theme to aThermometerPlot
.protected void
applyToTitle
(Title title) Applies the attributes of this theme to the specified title.protected void
applyToValueAxis
(ValueAxis axis) Applies the attributes for this theme to aValueAxis
.protected void
applyToXYAnnotation
(XYAnnotation annotation) Applies the settings of this theme to the specified annotation.protected void
applyToXYItemRenderer
(XYItemRenderer renderer) Applies the settings of this theme to the specified renderer.protected void
applyToXYPlot
(XYPlot plot) Applies the attributes of this theme to aXYPlot
.clone()
Returns a clone of this theme.static ChartTheme
Creates and returns a theme called "Darkness".static ChartTheme
Creates and returns the default 'JFree' chart theme.static ChartTheme
Creates and returns aChartTheme
that doesn't apply any changes to the JFreeChart defaults.boolean
Tests this theme for equality with an arbitrary object.Returns the axis label paint.Returns the axis offsets.Returns the bar painter.Returns the baseline paint.Returns the chart background paint.Returns the crosshair paint.Returns the domain grid line paint.Returns a clone of the drawing supplier for this theme.Returns the error indicator paint.Returns the largest font for this theme.Returns the grid band alternate paint (used for aSymbolAxis
).Returns the grid band paint.Returns the item label paint.Returns the label link paint for pie charts.Returns the label link style for pie charts.Returns the large font for this theme.Returns the legend background paint.Returns the legend item paint.getName()
Returns the name of this theme.Returns the plot background paint.Returns the plot outline paint.Returns the range grid line paint.Returns the regular font.Returns the shadow paint.Returns the small font.Returns the subtitle paint.Returns the thermometer paint.Returns the tick label paint.Returns the title paint.Returns the XY bar painter.boolean
Returns the shadow visibility flag.void
setAxisLabelPaint
(Paint paint) Sets the axis label paint.void
setAxisOffset
(RectangleInsets offset) Sets the axis offset.void
setBarPainter
(BarPainter painter) Sets the bar painter.void
setBaselinePaint
(Paint paint) Sets the baseline paint.void
setChartBackgroundPaint
(Paint paint) Sets the chart background paint.void
setCrosshairPaint
(Paint paint) Sets the crosshair paint.void
setDomainGridlinePaint
(Paint paint) Sets the domain grid line paint.void
setDrawingSupplier
(DrawingSupplier supplier) Sets the drawing supplier for this theme.void
setErrorIndicatorPaint
(Paint paint) Sets the error indicator paint.void
setExtraLargeFont
(Font font) Sets the largest font for this theme.void
setGridBandAlternatePaint
(Paint paint) Sets the grid band alternate paint (used for aSymbolAxis
).void
setGridBandPaint
(Paint paint) Sets the grid band paint.void
setItemLabelPaint
(Paint paint) Sets the item label paint.void
setLabelLinkPaint
(Paint paint) Sets the label link paint for pie charts.void
Sets the label link style for pie charts.void
setLargeFont
(Font font) Sets the large font for this theme.void
setLegendBackgroundPaint
(Paint paint) Sets the legend background paint.void
setLegendItemPaint
(Paint paint) Sets the legend item paint.void
setPlotBackgroundPaint
(Paint paint) Sets the plot background paint.void
setPlotOutlinePaint
(Paint paint) Sets the plot outline paint.void
setRangeGridlinePaint
(Paint paint) Sets the range grid line paint.void
setRegularFont
(Font font) Sets the regular font for this theme.void
setShadowPaint
(Paint paint) Sets the shadow paint.void
setShadowVisible
(boolean visible) Sets the shadow visibility flag.void
setSmallFont
(Font font) Sets the small font for this theme.void
setSubtitlePaint
(Paint paint) Sets the subtitle paint.void
setThermometerPaint
(Paint paint) Sets the thermometer paint.void
setTickLabelPaint
(Paint paint) Sets the tick label paint.void
setTitlePaint
(Paint paint) Sets the title paint.void
setXYBarPainter
(XYBarPainter painter) Sets the XY bar painter.
-
Constructor Details
-
StandardChartTheme
Creates a new default instance.- Parameters:
name
- the name of the theme (null
not permitted).
-
StandardChartTheme
Creates a new default instance.- Parameters:
name
- the name of the theme (null
not permitted).shadow
- a flag that controls whether a shadow generator is included.
-
-
Method Details
-
createJFreeTheme
Creates and returns the default 'JFree' chart theme.- Returns:
- A chart theme.
-
createDarknessTheme
Creates and returns a theme called "Darkness". In this theme, the charts have a black background.- Returns:
- The "Darkness" theme.
-
createLegacyTheme
Creates and returns aChartTheme
that doesn't apply any changes to the JFreeChart defaults. This produces the "legacy" look for JFreeChart.- Returns:
- A legacy theme.
-
getExtraLargeFont
Returns the largest font for this theme.- Returns:
- The largest font for this theme.
- See Also:
-
setExtraLargeFont
Sets the largest font for this theme.- Parameters:
font
- the font (null
not permitted).- See Also:
-
getLargeFont
Returns the large font for this theme.- Returns:
- The large font (never
null
). - See Also:
-
setLargeFont
Sets the large font for this theme.- Parameters:
font
- the font (null
not permitted).- See Also:
-
getRegularFont
Returns the regular font.- Returns:
- The regular font (never
null
). - See Also:
-
setRegularFont
Sets the regular font for this theme.- Parameters:
font
- the font (null
not permitted).- See Also:
-
getSmallFont
Returns the small font.- Returns:
- The small font (never
null
). - See Also:
-
setSmallFont
Sets the small font for this theme.- Parameters:
font
- the font (null
not permitted).- See Also:
-
getTitlePaint
Returns the title paint.- Returns:
- The title paint (never
null
). - See Also:
-
setTitlePaint
Sets the title paint.- Parameters:
paint
- the paint (null
not permitted).- See Also:
-
getSubtitlePaint
Returns the subtitle paint.- Returns:
- The subtitle paint (never
null
). - See Also:
-
setSubtitlePaint
Sets the subtitle paint.- Parameters:
paint
- the paint (null
not permitted).- See Also:
-
getChartBackgroundPaint
Returns the chart background paint.- Returns:
- The chart background paint (never
null
). - See Also:
-
setChartBackgroundPaint
Sets the chart background paint.- Parameters:
paint
- the paint (null
not permitted).- See Also:
-
getLegendBackgroundPaint
Returns the legend background paint.- Returns:
- The legend background paint (never
null
). - See Also:
-
setLegendBackgroundPaint
Sets the legend background paint.- Parameters:
paint
- the paint (null
not permitted).- See Also:
-
getLegendItemPaint
Returns the legend item paint.- Returns:
- The legend item paint (never
null
). - See Also:
-
setLegendItemPaint
Sets the legend item paint.- Parameters:
paint
- the paint (null
not permitted).- See Also:
-
getPlotBackgroundPaint
Returns the plot background paint.- Returns:
- The plot background paint (never
null
). - See Also:
-
setPlotBackgroundPaint
Sets the plot background paint.- Parameters:
paint
- the paint (null
not permitted).- See Also:
-
getPlotOutlinePaint
Returns the plot outline paint.- Returns:
- The plot outline paint (never
null
). - See Also:
-
setPlotOutlinePaint
Sets the plot outline paint.- Parameters:
paint
- the paint (null
not permitted).- See Also:
-
getLabelLinkStyle
Returns the label link style for pie charts.- Returns:
- The label link style (never
null
). - See Also:
-
setLabelLinkStyle
Sets the label link style for pie charts.- Parameters:
style
- the style (null
not permitted).- See Also:
-
getLabelLinkPaint
Returns the label link paint for pie charts.- Returns:
- The label link paint (never
null
). - See Also:
-
setLabelLinkPaint
Sets the label link paint for pie charts.- Parameters:
paint
- the paint (null
not permitted).- See Also:
-
getDomainGridlinePaint
Returns the domain grid line paint.- Returns:
- The domain grid line paint (never
null
). - See Also:
-
setDomainGridlinePaint
Sets the domain grid line paint.- Parameters:
paint
- the paint (null
not permitted).- See Also:
-
getRangeGridlinePaint
Returns the range grid line paint.- Returns:
- The range grid line paint (never
null
). - See Also:
-
setRangeGridlinePaint
Sets the range grid line paint.- Parameters:
paint
- the paint (null
not permitted).- See Also:
-
getBaselinePaint
Returns the baseline paint.- Returns:
- The baseline paint.
-
setBaselinePaint
Sets the baseline paint.- Parameters:
paint
- the paint (null
not permitted).
-
getCrosshairPaint
Returns the crosshair paint.- Returns:
- The crosshair paint.
-
setCrosshairPaint
Sets the crosshair paint.- Parameters:
paint
- the paint (null
not permitted).
-
getAxisOffset
Returns the axis offsets.- Returns:
- The axis offsets (never
null
). - See Also:
-
setAxisOffset
Sets the axis offset.- Parameters:
offset
- the offset (null
not permitted).- See Also:
-
getAxisLabelPaint
Returns the axis label paint.- Returns:
- The axis label paint (never
null
). - See Also:
-
setAxisLabelPaint
Sets the axis label paint.- Parameters:
paint
- the paint (null
not permitted).- See Also:
-
getTickLabelPaint
Returns the tick label paint.- Returns:
- The tick label paint (never
null
). - See Also:
-
setTickLabelPaint
Sets the tick label paint.- Parameters:
paint
- the paint (null
not permitted).- See Also:
-
getItemLabelPaint
Returns the item label paint.- Returns:
- The item label paint (never
null
). - See Also:
-
setItemLabelPaint
Sets the item label paint.- Parameters:
paint
- the paint (null
not permitted).- See Also:
-
isShadowVisible
public boolean isShadowVisible()Returns the shadow visibility flag.- Returns:
- The shadow visibility flag.
- See Also:
-
setShadowVisible
public void setShadowVisible(boolean visible) Sets the shadow visibility flag.- Parameters:
visible
- the flag.- See Also:
-
getShadowPaint
Returns the shadow paint.- Returns:
- The shadow paint (never
null
). - See Also:
-
setShadowPaint
Sets the shadow paint.- Parameters:
paint
- the paint (null
not permitted).- See Also:
-
getBarPainter
Returns the bar painter.- Returns:
- The bar painter (never
null
). - See Also:
-
setBarPainter
Sets the bar painter.- Parameters:
painter
- the painter (null
not permitted).- See Also:
-
getXYBarPainter
Returns the XY bar painter.- Returns:
- The XY bar painter (never
null
). - See Also:
-
setXYBarPainter
Sets the XY bar painter.- Parameters:
painter
- the painter (null
not permitted).- See Also:
-
getThermometerPaint
Returns the thermometer paint.- Returns:
- The thermometer paint (never
null
). - See Also:
-
setThermometerPaint
Sets the thermometer paint.- Parameters:
paint
- the paint (null
not permitted).- See Also:
-
getErrorIndicatorPaint
Returns the error indicator paint.- Returns:
- The error indicator paint (never
null
). - See Also:
-
setErrorIndicatorPaint
Sets the error indicator paint.- Parameters:
paint
- the paint (null
not permitted).- See Also:
-
getGridBandPaint
Returns the grid band paint.- Returns:
- The grid band paint (never
null
). - See Also:
-
setGridBandPaint
Sets the grid band paint.- Parameters:
paint
- the paint (null
not permitted).- See Also:
-
getGridBandAlternatePaint
Returns the grid band alternate paint (used for aSymbolAxis
).- Returns:
- The paint (never
null
). - See Also:
-
setGridBandAlternatePaint
Sets the grid band alternate paint (used for aSymbolAxis
).- Parameters:
paint
- the paint (null
not permitted).- See Also:
-
getName
Returns the name of this theme.- Returns:
- The name of this theme.
-
getDrawingSupplier
Returns a clone of the drawing supplier for this theme.- Returns:
- A clone of the drawing supplier.
-
setDrawingSupplier
Sets the drawing supplier for this theme.- Parameters:
supplier
- the supplier (null
not permitted).- See Also:
-
apply
Applies this theme to the supplied chart.- Specified by:
apply
in interfaceChartTheme
- Parameters:
chart
- the chart (null
not permitted).
-
applyToTitle
Applies the attributes of this theme to the specified title.- Parameters:
title
- the title.
-
applyToBlockContainer
Applies the attributes of this theme to the specified container.- Parameters:
bc
- a block container (null
not permitted).
-
applyToBlock
Applies the attributes of this theme to the specified block.- Parameters:
b
- the block.
-
applyToPlot
Applies the attributes of this theme to a plot.- Parameters:
plot
- the plot (null
).
-
applyToPiePlot
Applies the attributes of this theme to aPiePlot
instance. This method also clears any set values for the section paint, outline etc, so that the theme'sDrawingSupplier
will be used.- Parameters:
plot
- the plot (null
not permitted).
-
applyToMultiplePiePlot
Applies the attributes of this theme to aMultiplePiePlot
.- Parameters:
plot
- the plot (null
not permitted).
-
applyToCategoryPlot
Applies the attributes of this theme to aCategoryPlot
.- Parameters:
plot
- the plot (null
not permitted).
-
applyToXYPlot
Applies the attributes of this theme to aXYPlot
.- Parameters:
plot
- the plot (null
not permitted).
-
applyToFastScatterPlot
Applies the attributes of this theme to aFastScatterPlot
.- Parameters:
plot
- the plot (null
not permitted).
-
applyToPolarPlot
Applies the attributes of this theme to aPolarPlot
. This method is called from theapplyToPlot(Plot)
method.- Parameters:
plot
- the plot (null
not permitted).
-
applyToSpiderWebPlot
Applies the attributes of this theme to aSpiderWebPlot
.- Parameters:
plot
- the plot (null
not permitted).
-
applyToMeterPlot
Applies the attributes of this theme to aMeterPlot
.- Parameters:
plot
- the plot (null
not permitted).
-
applyToThermometerPlot
Applies the attributes for this theme to aThermometerPlot
. This method is called from theapplyToPlot(Plot)
method.- Parameters:
plot
- the plot.
-
applyToCategoryAxis
Applies the attributes for this theme to aCategoryAxis
.- Parameters:
axis
- the axis (null
not permitted).
-
applyToValueAxis
Applies the attributes for this theme to aValueAxis
.- Parameters:
axis
- the axis (null
not permitted).
-
applyToSymbolAxis
Applies the attributes for this theme to aSymbolAxis
.- Parameters:
axis
- the axis (null
not permitted).
-
applyToPeriodAxis
Applies the attributes for this theme to aPeriodAxis
.- Parameters:
axis
- the axis (null
not permitted).
-
applyToAbstractRenderer
Applies the attributes for this theme to anAbstractRenderer
.- Parameters:
renderer
- the renderer (null
not permitted).
-
applyToCategoryItemRenderer
Applies the settings of this theme to the specified renderer.- Parameters:
renderer
- the renderer (null
not permitted).
-
applyToXYItemRenderer
Applies the settings of this theme to the specified renderer.- Parameters:
renderer
- the renderer (null
not permitted).
-
applyToXYAnnotation
Applies the settings of this theme to the specified annotation.- Parameters:
annotation
- the annotation.
-
equals
Tests this theme for equality with an arbitrary object. -
clone
Returns a clone of this theme.- Specified by:
clone
in interfacePublicCloneable
- Overrides:
clone
in classObject
- Returns:
- A clone.
- Throws:
CloneNotSupportedException
- if the theme cannot be cloned.
-