Package org.jfree.chart
Class StandardChartTheme
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
ConstructorsConstructorDescriptionStandardChartTheme(String name) Creates a new default instance.StandardChartTheme(String name, boolean shadow) Creates a new default instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidapply(JFreeChart chart) Applies this theme to the supplied chart.protected voidapplyToAbstractRenderer(AbstractRenderer renderer) Applies the attributes for this theme to anAbstractRenderer.protected voidApplies the attributes of this theme to the specified block.protected voidApplies the attributes of this theme to the specified container.protected voidApplies the attributes for this theme to aCategoryAxis.protected voidApplies the settings of this theme to the specified renderer.protected voidApplies the attributes of this theme to aCategoryPlot.protected voidApplies the attributes of this theme to aFastScatterPlot.protected voidapplyToMeterPlot(MeterPlot plot) Applies the attributes of this theme to aMeterPlot.protected voidApplies the attributes of this theme to aMultiplePiePlot.protected voidapplyToPeriodAxis(PeriodAxis axis) Applies the attributes for this theme to aPeriodAxis.protected voidapplyToPiePlot(PiePlot plot) Applies the attributes of this theme to aPiePlotinstance.protected voidapplyToPlot(Plot plot) Applies the attributes of this theme to a plot.protected voidapplyToPolarPlot(PolarPlot plot) Applies the attributes of this theme to aPolarPlot.protected voidApplies the attributes of this theme to aSpiderWebPlot.protected voidapplyToSymbolAxis(SymbolAxis axis) Applies the attributes for this theme to aSymbolAxis.protected voidApplies the attributes for this theme to aThermometerPlot.protected voidapplyToTitle(Title title) Applies the attributes of this theme to the specified title.protected voidapplyToValueAxis(ValueAxis axis) Applies the attributes for this theme to aValueAxis.protected voidapplyToXYAnnotation(XYAnnotation annotation) Applies the settings of this theme to the specified annotation.protected voidapplyToXYItemRenderer(XYItemRenderer renderer) Applies the settings of this theme to the specified renderer.protected voidapplyToXYPlot(XYPlot plot) Applies the attributes of this theme to aXYPlot.clone()Returns a clone of this theme.static ChartThemeCreates and returns a theme called "Darkness".static ChartThemeCreates and returns the default 'JFree' chart theme.static ChartThemeCreates and returns aChartThemethat doesn't apply any changes to the JFreeChart defaults.booleanTests 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.inthashCode()booleanReturns the shadow visibility flag.voidsetAxisLabelPaint(Paint paint) Sets the axis label paint.voidsetAxisOffset(RectangleInsets offset) Sets the axis offset.voidsetBarPainter(BarPainter painter) Sets the bar painter.voidsetBaselinePaint(Paint paint) Sets the baseline paint.voidsetChartBackgroundPaint(Paint paint) Sets the chart background paint.voidsetCrosshairPaint(Paint paint) Sets the crosshair paint.voidsetDomainGridlinePaint(Paint paint) Sets the domain grid line paint.voidsetDrawingSupplier(DrawingSupplier supplier) Sets the drawing supplier for this theme.voidsetErrorIndicatorPaint(Paint paint) Sets the error indicator paint.voidsetExtraLargeFont(Font font) Sets the largest font for this theme.voidsetGridBandAlternatePaint(Paint paint) Sets the grid band alternate paint (used for aSymbolAxis).voidsetGridBandPaint(Paint paint) Sets the grid band paint.voidsetItemLabelPaint(Paint paint) Sets the item label paint.voidsetLabelLinkPaint(Paint paint) Sets the label link paint for pie charts.voidSets the label link style for pie charts.voidsetLargeFont(Font font) Sets the large font for this theme.voidsetLegendBackgroundPaint(Paint paint) Sets the legend background paint.voidsetLegendItemPaint(Paint paint) Sets the legend item paint.voidsetPlotBackgroundPaint(Paint paint) Sets the plot background paint.voidsetPlotOutlinePaint(Paint paint) Sets the plot outline paint.voidsetRangeGridlinePaint(Paint paint) Sets the range grid line paint.voidsetRegularFont(Font font) Sets the regular font for this theme.voidsetShadowPaint(Paint paint) Sets the shadow paint.voidsetShadowVisible(boolean visible) Sets the shadow visibility flag.voidsetSmallFont(Font font) Sets the small font for this theme.voidsetSubtitlePaint(Paint paint) Sets the subtitle paint.voidsetThermometerPaint(Paint paint) Sets the thermometer paint.voidsetTickLabelPaint(Paint paint) Sets the tick label paint.voidsetTitlePaint(Paint paint) Sets the title paint.voidsetXYBarPainter(XYBarPainter painter) Sets the XY bar painter.
-
Constructor Details
-
StandardChartTheme
Creates a new default instance.- Parameters:
name- the name of the theme (nullnot permitted).
-
StandardChartTheme
Creates a new default instance.- Parameters:
name- the name of the theme (nullnot 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 aChartThemethat 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 (nullnot 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 (nullnot 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 (nullnot 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 (nullnot 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 (nullnot 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 (nullnot 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 (nullnot 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 (nullnot 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 (nullnot 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 (nullnot 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 (nullnot 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 (nullnot 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 (nullnot 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 (nullnot 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 (nullnot permitted).- See Also:
-
getBaselinePaint
Returns the baseline paint.- Returns:
- The baseline paint.
-
setBaselinePaint
Sets the baseline paint.- Parameters:
paint- the paint (nullnot permitted).
-
getCrosshairPaint
Returns the crosshair paint.- Returns:
- The crosshair paint.
-
setCrosshairPaint
Sets the crosshair paint.- Parameters:
paint- the paint (nullnot permitted).
-
getAxisOffset
Returns the axis offsets.- Returns:
- The axis offsets (never
null). - See Also:
-
setAxisOffset
Sets the axis offset.- Parameters:
offset- the offset (nullnot 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 (nullnot 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 (nullnot 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 (nullnot permitted).- See Also:
-
isShadowVisible
Returns the shadow visibility flag.- Returns:
- The shadow visibility flag.
- See Also:
-
setShadowVisible
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 (nullnot 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 (nullnot 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 (nullnot 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 (nullnot 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 (nullnot 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 (nullnot 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 (nullnot 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 (nullnot permitted).- See Also:
-
apply
Applies this theme to the supplied chart.- Specified by:
applyin interfaceChartTheme- Parameters:
chart- the chart (nullnot 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 (nullnot 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 aPiePlotinstance. This method also clears any set values for the section paint, outline etc, so that the theme'sDrawingSupplierwill be used.- Parameters:
plot- the plot (nullnot permitted).
-
applyToMultiplePiePlot
Applies the attributes of this theme to aMultiplePiePlot.- Parameters:
plot- the plot (nullnot permitted).
-
applyToCategoryPlot
Applies the attributes of this theme to aCategoryPlot.- Parameters:
plot- the plot (nullnot permitted).
-
applyToXYPlot
Applies the attributes of this theme to aXYPlot.- Parameters:
plot- the plot (nullnot permitted).
-
applyToFastScatterPlot
Applies the attributes of this theme to aFastScatterPlot.- Parameters:
plot- the plot (nullnot permitted).
-
applyToPolarPlot
Applies the attributes of this theme to aPolarPlot. This method is called from theapplyToPlot(Plot)method.- Parameters:
plot- the plot (nullnot permitted).
-
applyToSpiderWebPlot
Applies the attributes of this theme to aSpiderWebPlot.- Parameters:
plot- the plot (nullnot permitted).
-
applyToMeterPlot
Applies the attributes of this theme to aMeterPlot.- Parameters:
plot- the plot (nullnot 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 (nullnot permitted).
-
applyToValueAxis
Applies the attributes for this theme to aValueAxis.- Parameters:
axis- the axis (nullnot permitted).
-
applyToSymbolAxis
Applies the attributes for this theme to aSymbolAxis.- Parameters:
axis- the axis (nullnot permitted).
-
applyToPeriodAxis
Applies the attributes for this theme to aPeriodAxis.- Parameters:
axis- the axis (nullnot permitted).
-
applyToAbstractRenderer
Applies the attributes for this theme to anAbstractRenderer.- Parameters:
renderer- the renderer (nullnot permitted).
-
applyToCategoryItemRenderer
Applies the settings of this theme to the specified renderer.- Parameters:
renderer- the renderer (nullnot permitted).
-
applyToXYItemRenderer
Applies the settings of this theme to the specified renderer.- Parameters:
renderer- the renderer (nullnot 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. -
hashCode
-
clone
Returns a clone of this theme.- Specified by:
clonein interfacePublicCloneable- Overrides:
clonein classObject- Returns:
- A clone.
- Throws:
CloneNotSupportedException- if the theme cannot be cloned.
-