public class

StandardChartTheme

extends Object
implements Serializable Cloneable ChartTheme
java.lang.Object
   ↳ org.jfree.chart.StandardChartTheme

Class Overview

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.

Summary

Public Constructors
StandardChartTheme(String name)
Creates a new default instance.
Public Methods
void apply(JFreeChart chart)
Applies this theme to the supplied chart.
Object clone()
Returns a clone of this theme.
static ChartTheme createDarknessTheme()
Creates and returns a theme called "Darkness".
static ChartTheme createJFreeTheme()
Creates and returns the default 'JFree' chart theme.
static ChartTheme createLegacyTheme()
Creates and returns a ChartTheme that doesn't apply any changes to the JFreeChart defaults.
boolean equals(Object obj)
Tests this theme for equality with an arbitrary object.
Paint getAxisLabelPaint()
Returns the axis label paint.
RectangleInsets getAxisOffset()
Returns the axis offsets.
BarPainter getBarPainter()
Returns the bar painter.
Paint getBaselinePaint()
Returns the baseline paint.
Paint getChartBackgroundPaint()
Returns the chart background paint.
Paint getCrosshairPaint()
Returns the crosshair paint.
Paint getDomainGridlinePaint()
Returns the domain grid line paint.
DrawingSupplier getDrawingSupplier()
Returns a clone of the drawing supplier for this theme.
Paint getErrorIndicatorPaint()
Returns the error indicator paint.
Font getExtraLargeFont()
Returns the largest font for this theme.
Paint getGridBandAlternatePaint()
Returns the grid band alternate paint (used for a SymbolAxis).
Paint getGridBandPaint()
Returns the grid band paint.
Paint getItemLabelPaint()
Returns the item label paint.
Paint getLabelLinkPaint()
Returns the label link paint for pie charts.
PieLabelLinkStyle getLabelLinkStyle()
Returns the label link style for pie charts.
Font getLargeFont()
Returns the large font for this theme.
Paint getLegendBackgroundPaint()
Returns the legend background paint.
Paint getLegendItemPaint()
Returns the legend item paint.
String getName()
Returns the name of this theme.
Paint getPlotBackgroundPaint()
Returns the plot background paint.
Paint getPlotOutlinePaint()
Returns the plot outline paint.
Paint getRangeGridlinePaint()
Returns the range grid line paint.
Font getRegularFont()
Returns the regular font.
Paint getShadowPaint()
Returns the shadow paint.
Font getSmallFont()
Returns the small font.
Paint getSubtitlePaint()
Returns the subtitle paint.
Paint getThermometerPaint()
Returns the thermometer paint.
Paint getTickLabelPaint()
Returns the tick label paint.
Paint getTitlePaint()
Returns the title paint.
Paint getWallPaint()
Returns the wall paint for charts with a 3D effect.
XYBarPainter getXYBarPainter()
Returns the XY bar painter.
boolean isShadowVisible()
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 a SymbolAxis).
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 setLabelLinkStyle(PieLabelLinkStyle style)
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 setWallPaint(Paint paint)
Sets the wall paint for charts with a 3D effect.
void setXYBarPainter(XYBarPainter painter)
Sets the XY bar painter.
Protected Methods
void applyToAbstractRenderer(AbstractRenderer renderer)
Applies the attributes for this theme to an AbstractRenderer.
void applyToBlock(Block b)
Applies the attributes of this theme to the specified block.
void applyToBlockContainer(BlockContainer bc)
Applies the attributes of this theme to the specified container.
void applyToCategoryAxis(CategoryAxis axis)
Applies the attributes for this theme to a CategoryAxis.
void applyToCategoryItemRenderer(CategoryItemRenderer renderer)
Applies the settings of this theme to the specified renderer.
void applyToCategoryPlot(CategoryPlot plot)
Applies the attributes of this theme to a CategoryPlot.
void applyToFastScatterPlot(FastScatterPlot plot)
Applies the attributes of this theme to a FastScatterPlot.
void applyToMeterPlot(MeterPlot plot)
Applies the attributes of this theme to a MeterPlot.
void applyToMultiplePiePlot(MultiplePiePlot plot)
Applies the attributes of this theme to a MultiplePiePlot.
void applyToPeriodAxis(PeriodAxis axis)
Applies the attributes for this theme to a PeriodAxis.
void applyToPiePlot(PiePlot plot)
Applies the attributes of this theme to a PiePlot instance.
void applyToPlot(Plot plot)
Applies the attributes of this theme to a plot.
void applyToPolarPlot(PolarPlot plot)
Applies the attributes of this theme to a PolarPlot.
void applyToSpiderWebPlot(SpiderWebPlot plot)
Applies the attributes of this theme to a SpiderWebPlot.
void applyToSymbolAxis(SymbolAxis axis)
Applies the attributes for this theme to a SymbolAxis.
void applyToThermometerPlot(ThermometerPlot plot)
Applies the attributes for this theme to a ThermometerPlot.
void applyToTitle(Title title)
Applies the attributes of this theme to the specified title.
void applyToValueAxis(ValueAxis axis)
Applies the attributes for this theme to a ValueAxis.
void applyToXYAnnotation(XYAnnotation annotation)
Applies the settings of this theme to the specified annotation.
void applyToXYItemRenderer(XYItemRenderer renderer)
Applies the settings of this theme to the specified renderer.
void applyToXYPlot(XYPlot plot)
Applies the attributes of this theme to a XYPlot.
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.jfree.chart.ChartTheme

Public Constructors

public StandardChartTheme (String name)

Creates a new default instance.

Parameters
name the name of the theme (null not permitted).

Public Methods

public void apply (JFreeChart chart)

Applies this theme to the supplied chart.

Parameters
chart the chart (null not permitted).

public Object clone ()

Returns a clone of this theme.

Returns
  • A clone.
Throws
CloneNotSupportedException if the theme cannot be cloned.

public static ChartTheme createDarknessTheme ()

Creates and returns a theme called "Darkness". In this theme, the charts have a black background.

Returns
  • The "Darkness" theme.

public static ChartTheme createJFreeTheme ()

Creates and returns the default 'JFree' chart theme.

Returns
  • A chart theme.

public static ChartTheme createLegacyTheme ()

Creates and returns a ChartTheme that doesn't apply any changes to the JFreeChart defaults. This produces the "legacy" look for JFreeChart.

Returns
  • A legacy theme.

public boolean equals (Object obj)

Tests this theme for equality with an arbitrary object.

Parameters
obj the object (null permitted).
Returns
  • A boolean.

public Paint getAxisLabelPaint ()

Returns the axis label paint.

Returns
  • The axis label paint (never null).

public RectangleInsets getAxisOffset ()

Returns the axis offsets.

Returns
  • The axis offsets (never null).

public BarPainter getBarPainter ()

Returns the bar painter.

Returns
  • The bar painter (never null).

public Paint getBaselinePaint ()

Returns the baseline paint.

Returns
  • The baseline paint.

public Paint getChartBackgroundPaint ()

Returns the chart background paint.

Returns
  • The chart background paint (never null).

public Paint getCrosshairPaint ()

Returns the crosshair paint.

Returns
  • The crosshair paint.

public Paint getDomainGridlinePaint ()

Returns the domain grid line paint.

Returns
  • The domain grid line paint (never null).

public DrawingSupplier getDrawingSupplier ()

Returns a clone of the drawing supplier for this theme.

Returns
  • A clone of the drawing supplier.

public Paint getErrorIndicatorPaint ()

Returns the error indicator paint.

Returns
  • The error indicator paint (never null).

public Font getExtraLargeFont ()

Returns the largest font for this theme.

Returns
  • The largest font for this theme.

public Paint getGridBandAlternatePaint ()

Returns the grid band alternate paint (used for a SymbolAxis).

Returns
  • The paint (never null).

public Paint getGridBandPaint ()

Returns the grid band paint.

Returns
  • The grid band paint (never null).

public Paint getItemLabelPaint ()

Returns the item label paint.

Returns
  • The item label paint (never null).

public Paint getLabelLinkPaint ()

Returns the label link paint for pie charts.

Returns
  • The label link paint (never null).

public PieLabelLinkStyle getLabelLinkStyle ()

Returns the label link style for pie charts.

Returns
  • The label link style (never null).

public Font getLargeFont ()

Returns the large font for this theme.

Returns
  • The large font (never null).

public Paint getLegendBackgroundPaint ()

Returns the legend background paint.

Returns
  • The legend background paint (never null).

public Paint getLegendItemPaint ()

Returns the legend item paint.

Returns
  • The legend item paint (never null).

public String getName ()

Returns the name of this theme.

Returns
  • The name of this theme.

public Paint getPlotBackgroundPaint ()

Returns the plot background paint.

Returns
  • The plot background paint (never null).

public Paint getPlotOutlinePaint ()

Returns the plot outline paint.

Returns
  • The plot outline paint (never null).

public Paint getRangeGridlinePaint ()

Returns the range grid line paint.

Returns
  • The range grid line paint (never null).

public Font getRegularFont ()

Returns the regular font.

Returns
  • The regular font (never null).

public Paint getShadowPaint ()

Returns the shadow paint.

Returns
  • The shadow paint (never null).

public Font getSmallFont ()

Returns the small font.

Returns
  • The small font (never null).

public Paint getSubtitlePaint ()

Returns the subtitle paint.

Returns
  • The subtitle paint (never null).

public Paint getThermometerPaint ()

Returns the thermometer paint.

Returns
  • The thermometer paint (never null).

public Paint getTickLabelPaint ()

Returns the tick label paint.

Returns
  • The tick label paint (never null).

public Paint getTitlePaint ()

Returns the title paint.

Returns
  • The title paint (never null).

public Paint getWallPaint ()

Returns the wall paint for charts with a 3D effect.

Returns
  • The wall paint (never null).

public XYBarPainter getXYBarPainter ()

Returns the XY bar painter.

Returns
  • The XY bar painter (never null).

public boolean isShadowVisible ()

Returns the shadow visibility flag.

Returns
  • The shadow visibility flag.

public void setAxisLabelPaint (Paint paint)

Sets the axis label paint.

Parameters
paint the paint (null not permitted).

public void setAxisOffset (RectangleInsets offset)

Sets the axis offset.

Parameters
offset the offset (null not permitted).
See Also

public void setBarPainter (BarPainter painter)

Sets the bar painter.

Parameters
painter the painter (null not permitted).
See Also

public void setBaselinePaint (Paint paint)

Sets the baseline paint.

Parameters
paint the paint (null not permitted).

public void setChartBackgroundPaint (Paint paint)

Sets the chart background paint.

Parameters
paint the paint (null not permitted).

public void setCrosshairPaint (Paint paint)

Sets the crosshair paint.

Parameters
paint the paint (null not permitted).

public void setDomainGridlinePaint (Paint paint)

Sets the domain grid line paint.

Parameters
paint the paint (null not permitted).

public void setDrawingSupplier (DrawingSupplier supplier)

Sets the drawing supplier for this theme.

Parameters
supplier the supplier (null not permitted).

public void setErrorIndicatorPaint (Paint paint)

Sets the error indicator paint.

Parameters
paint the paint (null not permitted).

public void setExtraLargeFont (Font font)

Sets the largest font for this theme.

Parameters
font the font (null not permitted).

public void setGridBandAlternatePaint (Paint paint)

Sets the grid band alternate paint (used for a SymbolAxis).

Parameters
paint the paint (null not permitted).

public void setGridBandPaint (Paint paint)

Sets the grid band paint.

Parameters
paint the paint (null not permitted).

public void setItemLabelPaint (Paint paint)

Sets the item label paint.

Parameters
paint the paint (null not permitted).

public void setLabelLinkPaint (Paint paint)

Sets the label link paint for pie charts.

Parameters
paint the paint (null not permitted).

public void setLabelLinkStyle (PieLabelLinkStyle style)

Sets the label link style for pie charts.

Parameters
style the style (null not permitted).

public void setLargeFont (Font font)

Sets the large font for this theme.

Parameters
font the font (null not permitted).
See Also

public void setLegendBackgroundPaint (Paint paint)

Sets the legend background paint.

Parameters
paint the paint (null not permitted).

public void setLegendItemPaint (Paint paint)

Sets the legend item paint.

Parameters
paint the paint (null not permitted).

public void setPlotBackgroundPaint (Paint paint)

Sets the plot background paint.

Parameters
paint the paint (null not permitted).

public void setPlotOutlinePaint (Paint paint)

Sets the plot outline paint.

Parameters
paint the paint (null not permitted).

public void setRangeGridlinePaint (Paint paint)

Sets the range grid line paint.

Parameters
paint the paint (null not permitted).

public void setRegularFont (Font font)

Sets the regular font for this theme.

Parameters
font the font (null not permitted).
See Also

public void setShadowPaint (Paint paint)

Sets the shadow paint.

Parameters
paint the paint (null not permitted).
See Also

public void setShadowVisible (boolean visible)

Sets the shadow visibility flag.

Parameters
visible the flag.

public void setSmallFont (Font font)

Sets the small font for this theme.

Parameters
font the font (null not permitted).
See Also

public void setSubtitlePaint (Paint paint)

Sets the subtitle paint.

Parameters
paint the paint (null not permitted).

public void setThermometerPaint (Paint paint)

Sets the thermometer paint.

Parameters
paint the paint (null not permitted).

public void setTickLabelPaint (Paint paint)

Sets the tick label paint.

Parameters
paint the paint (null not permitted).

public void setTitlePaint (Paint paint)

Sets the title paint.

Parameters
paint the paint (null not permitted).
See Also

public void setWallPaint (Paint paint)

Sets the wall paint for charts with a 3D effect.

Parameters
paint the paint (null not permitted).
See Also

public void setXYBarPainter (XYBarPainter painter)

Sets the XY bar painter.

Parameters
painter the painter (null not permitted).

Protected Methods

protected void applyToAbstractRenderer (AbstractRenderer renderer)

Applies the attributes for this theme to an AbstractRenderer.

Parameters
renderer the renderer (null not permitted).

protected void applyToBlock (Block b)

Applies the attributes of this theme to the specified block.

Parameters
b the block.

protected void applyToBlockContainer (BlockContainer bc)

Applies the attributes of this theme to the specified container.

Parameters
bc a block container (null not permitted).

protected void applyToCategoryAxis (CategoryAxis axis)

Applies the attributes for this theme to a CategoryAxis.

Parameters
axis the axis (null not permitted).

protected void applyToCategoryItemRenderer (CategoryItemRenderer renderer)

Applies the settings of this theme to the specified renderer.

Parameters
renderer the renderer (null not permitted).

protected void applyToCategoryPlot (CategoryPlot plot)

Applies the attributes of this theme to a CategoryPlot.

Parameters
plot the plot (null not permitted).

protected void applyToFastScatterPlot (FastScatterPlot plot)

Applies the attributes of this theme to a FastScatterPlot.

protected void applyToMeterPlot (MeterPlot plot)

Applies the attributes of this theme to a MeterPlot.

Parameters
plot the plot (null not permitted).

protected void applyToMultiplePiePlot (MultiplePiePlot plot)

Applies the attributes of this theme to a MultiplePiePlot.

Parameters
plot the plot (null not permitted).

protected void applyToPeriodAxis (PeriodAxis axis)

Applies the attributes for this theme to a PeriodAxis.

Parameters
axis the axis (null not permitted).

protected void applyToPiePlot (PiePlot plot)

Applies the attributes of this theme to a PiePlot instance. This method also clears any set values for the section paint, outline etc, so that the theme's DrawingSupplier will be used.

Parameters
plot the plot (null not permitted).

protected void applyToPlot (Plot plot)

Applies the attributes of this theme to a plot.

Parameters
plot the plot (null).

protected void applyToPolarPlot (PolarPlot plot)

Applies the attributes of this theme to a PolarPlot. This method is called from the applyToPlot(Plot) method.

Parameters
plot the plot (null not permitted).

protected void applyToSpiderWebPlot (SpiderWebPlot plot)

Applies the attributes of this theme to a SpiderWebPlot.

Parameters
plot the plot (null not permitted).

protected void applyToSymbolAxis (SymbolAxis axis)

Applies the attributes for this theme to a SymbolAxis.

Parameters
axis the axis (null not permitted).

protected void applyToThermometerPlot (ThermometerPlot plot)

Applies the attributes for this theme to a ThermometerPlot. This method is called from the applyToPlot(Plot) method.

Parameters
plot the plot.

protected void applyToTitle (Title title)

Applies the attributes of this theme to the specified title.

Parameters
title the title.

protected void applyToValueAxis (ValueAxis axis)

Applies the attributes for this theme to a ValueAxis.

Parameters
axis the axis (null not permitted).

protected void applyToXYAnnotation (XYAnnotation annotation)

Applies the settings of this theme to the specified annotation.

Parameters
annotation the annotation.

protected void applyToXYItemRenderer (XYItemRenderer renderer)

Applies the settings of this theme to the specified renderer.

Parameters
renderer the renderer (null not permitted).

protected void applyToXYPlot (XYPlot plot)

Applies the attributes of this theme to a XYPlot.

Parameters
plot the plot (null not permitted).