public class StandardChartTheme extends java.lang.Object implements ChartTheme, java.lang.Cloneable, org.jfree.util.PublicCloneable, java.io.Serializable
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.Constructor and Description |
---|
StandardChartTheme(java.lang.String name)
Creates a new default instance.
|
StandardChartTheme(java.lang.String name,
boolean shadow)
Creates a new default instance.
|
Modifier and Type | Method and Description |
---|---|
void |
apply(JFreeChart chart)
Applies this theme to the supplied chart.
|
protected void |
applyToAbstractRenderer(AbstractRenderer renderer)
Applies the attributes for this theme to an
AbstractRenderer . |
protected void |
applyToBlock(Block b)
Applies the attributes of this theme to the specified block.
|
protected void |
applyToBlockContainer(BlockContainer bc)
Applies the attributes of this theme to the specified container.
|
protected void |
applyToCategoryAxis(CategoryAxis axis)
Applies the attributes for this theme to a
CategoryAxis . |
protected void |
applyToCategoryItemRenderer(CategoryItemRenderer renderer)
Applies the settings of this theme to the specified renderer.
|
protected void |
applyToCategoryPlot(CategoryPlot plot)
Applies the attributes of this theme to a
CategoryPlot . |
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 . |
protected void |
applyToMultiplePiePlot(MultiplePiePlot plot)
Applies the attributes of this theme to a
MultiplePiePlot . |
protected void |
applyToPeriodAxis(PeriodAxis axis)
Applies the attributes for this theme to a
PeriodAxis . |
protected void |
applyToPiePlot(PiePlot plot)
Applies the attributes of this theme to a
PiePlot 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 a
PolarPlot . |
protected void |
applyToSpiderWebPlot(SpiderWebPlot plot)
Applies the attributes of this theme to a
SpiderWebPlot . |
protected void |
applyToSymbolAxis(SymbolAxis axis)
Applies the attributes for this theme to a
SymbolAxis . |
protected void |
applyToThermometerPlot(ThermometerPlot plot)
Applies the attributes for this theme to a
ThermometerPlot . |
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 a
ValueAxis . |
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 a
XYPlot . |
java.lang.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(java.lang.Object obj)
Tests this theme for equality with an arbitrary object.
|
java.awt.Paint |
getAxisLabelPaint()
Returns the axis label paint.
|
org.jfree.ui.RectangleInsets |
getAxisOffset()
Returns the axis offsets.
|
BarPainter |
getBarPainter()
Returns the bar painter.
|
java.awt.Paint |
getBaselinePaint()
Returns the baseline paint.
|
java.awt.Paint |
getChartBackgroundPaint()
Returns the chart background paint.
|
java.awt.Paint |
getCrosshairPaint()
Returns the crosshair paint.
|
java.awt.Paint |
getDomainGridlinePaint()
Returns the domain grid line paint.
|
DrawingSupplier |
getDrawingSupplier()
Returns a clone of the drawing supplier for this theme.
|
java.awt.Paint |
getErrorIndicatorPaint()
Returns the error indicator paint.
|
java.awt.Font |
getExtraLargeFont()
Returns the largest font for this theme.
|
java.awt.Paint |
getGridBandAlternatePaint()
Returns the grid band alternate paint (used for a
SymbolAxis ). |
java.awt.Paint |
getGridBandPaint()
Returns the grid band paint.
|
java.awt.Paint |
getItemLabelPaint()
Returns the item label paint.
|
java.awt.Paint |
getLabelLinkPaint()
Returns the label link paint for pie charts.
|
PieLabelLinkStyle |
getLabelLinkStyle()
Returns the label link style for pie charts.
|
java.awt.Font |
getLargeFont()
Returns the large font for this theme.
|
java.awt.Paint |
getLegendBackgroundPaint()
Returns the legend background paint.
|
java.awt.Paint |
getLegendItemPaint()
Returns the legend item paint.
|
java.lang.String |
getName()
Returns the name of this theme.
|
java.awt.Paint |
getPlotBackgroundPaint()
Returns the plot background paint.
|
java.awt.Paint |
getPlotOutlinePaint()
Returns the plot outline paint.
|
java.awt.Paint |
getRangeGridlinePaint()
Returns the range grid line paint.
|
java.awt.Font |
getRegularFont()
Returns the regular font.
|
java.awt.Paint |
getShadowPaint()
Returns the shadow paint.
|
java.awt.Font |
getSmallFont()
Returns the small font.
|
java.awt.Paint |
getSubtitlePaint()
Returns the subtitle paint.
|
java.awt.Paint |
getThermometerPaint()
Returns the thermometer paint.
|
java.awt.Paint |
getTickLabelPaint()
Returns the tick label paint.
|
java.awt.Paint |
getTitlePaint()
Returns the title paint.
|
java.awt.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(java.awt.Paint paint)
Sets the axis label paint.
|
void |
setAxisOffset(org.jfree.ui.RectangleInsets offset)
Sets the axis offset.
|
void |
setBarPainter(BarPainter painter)
Sets the bar painter.
|
void |
setBaselinePaint(java.awt.Paint paint)
Sets the baseline paint.
|
void |
setChartBackgroundPaint(java.awt.Paint paint)
Sets the chart background paint.
|
void |
setCrosshairPaint(java.awt.Paint paint)
Sets the crosshair paint.
|
void |
setDomainGridlinePaint(java.awt.Paint paint)
Sets the domain grid line paint.
|
void |
setDrawingSupplier(DrawingSupplier supplier)
Sets the drawing supplier for this theme.
|
void |
setErrorIndicatorPaint(java.awt.Paint paint)
Sets the error indicator paint.
|
void |
setExtraLargeFont(java.awt.Font font)
Sets the largest font for this theme.
|
void |
setGridBandAlternatePaint(java.awt.Paint paint)
Sets the grid band alternate paint (used for a
SymbolAxis ). |
void |
setGridBandPaint(java.awt.Paint paint)
Sets the grid band paint.
|
void |
setItemLabelPaint(java.awt.Paint paint)
Sets the item label paint.
|
void |
setLabelLinkPaint(java.awt.Paint paint)
Sets the label link paint for pie charts.
|
void |
setLabelLinkStyle(PieLabelLinkStyle style)
Sets the label link style for pie charts.
|
void |
setLargeFont(java.awt.Font font)
Sets the large font for this theme.
|
void |
setLegendBackgroundPaint(java.awt.Paint paint)
Sets the legend background paint.
|
void |
setLegendItemPaint(java.awt.Paint paint)
Sets the legend item paint.
|
void |
setPlotBackgroundPaint(java.awt.Paint paint)
Sets the plot background paint.
|
void |
setPlotOutlinePaint(java.awt.Paint paint)
Sets the plot outline paint.
|
void |
setRangeGridlinePaint(java.awt.Paint paint)
Sets the range grid line paint.
|
void |
setRegularFont(java.awt.Font font)
Sets the regular font for this theme.
|
void |
setShadowPaint(java.awt.Paint paint)
Sets the shadow paint.
|
void |
setShadowVisible(boolean visible)
Sets the shadow visibility flag.
|
void |
setSmallFont(java.awt.Font font)
Sets the small font for this theme.
|
void |
setSubtitlePaint(java.awt.Paint paint)
Sets the subtitle paint.
|
void |
setThermometerPaint(java.awt.Paint paint)
Sets the thermometer paint.
|
void |
setTickLabelPaint(java.awt.Paint paint)
Sets the tick label paint.
|
void |
setTitlePaint(java.awt.Paint paint)
Sets the title paint.
|
void |
setWallPaint(java.awt.Paint paint)
Sets the wall paint for charts with a 3D effect.
|
void |
setXYBarPainter(XYBarPainter painter)
Sets the XY bar painter.
|
public StandardChartTheme(java.lang.String name)
name
- the name of the theme (null
not permitted).public StandardChartTheme(java.lang.String name, boolean shadow)
name
- the name of the theme (null
not permitted).shadow
- a flag that controls whether a shadow generator is
included.public static ChartTheme createJFreeTheme()
public static ChartTheme createDarknessTheme()
public static ChartTheme createLegacyTheme()
ChartTheme
that doesn't apply any changes
to the JFreeChart defaults. This produces the "legacy" look for
JFreeChart.public java.awt.Font getExtraLargeFont()
setExtraLargeFont(Font)
public void setExtraLargeFont(java.awt.Font font)
font
- the font (null
not permitted).getExtraLargeFont()
public java.awt.Font getLargeFont()
null
).setLargeFont(Font)
public void setLargeFont(java.awt.Font font)
font
- the font (null
not permitted).getLargeFont()
public java.awt.Font getRegularFont()
null
).setRegularFont(Font)
public void setRegularFont(java.awt.Font font)
font
- the font (null
not permitted).getRegularFont()
public java.awt.Font getSmallFont()
null
).setSmallFont(Font)
public void setSmallFont(java.awt.Font font)
font
- the font (null
not permitted).getSmallFont()
public java.awt.Paint getTitlePaint()
null
).setTitlePaint(Paint)
public void setTitlePaint(java.awt.Paint paint)
paint
- the paint (null
not permitted).getTitlePaint()
public java.awt.Paint getSubtitlePaint()
null
).setSubtitlePaint(Paint)
public void setSubtitlePaint(java.awt.Paint paint)
paint
- the paint (null
not permitted).getSubtitlePaint()
public java.awt.Paint getChartBackgroundPaint()
null
).setChartBackgroundPaint(Paint)
public void setChartBackgroundPaint(java.awt.Paint paint)
paint
- the paint (null
not permitted).getChartBackgroundPaint()
public java.awt.Paint getLegendBackgroundPaint()
null
).setLegendBackgroundPaint(Paint)
public void setLegendBackgroundPaint(java.awt.Paint paint)
paint
- the paint (null
not permitted).getLegendBackgroundPaint()
public java.awt.Paint getLegendItemPaint()
null
).setLegendItemPaint(Paint)
public void setLegendItemPaint(java.awt.Paint paint)
paint
- the paint (null
not permitted).getLegendItemPaint()
public java.awt.Paint getPlotBackgroundPaint()
null
).setPlotBackgroundPaint(Paint)
public void setPlotBackgroundPaint(java.awt.Paint paint)
paint
- the paint (null
not permitted).getPlotBackgroundPaint()
public java.awt.Paint getPlotOutlinePaint()
null
).setPlotOutlinePaint(Paint)
public void setPlotOutlinePaint(java.awt.Paint paint)
paint
- the paint (null
not permitted).getPlotOutlinePaint()
public PieLabelLinkStyle getLabelLinkStyle()
null
).setLabelLinkStyle(PieLabelLinkStyle)
public void setLabelLinkStyle(PieLabelLinkStyle style)
style
- the style (null
not permitted).getLabelLinkStyle()
public java.awt.Paint getLabelLinkPaint()
null
).setLabelLinkPaint(Paint)
public void setLabelLinkPaint(java.awt.Paint paint)
paint
- the paint (null
not permitted).getLabelLinkPaint()
public java.awt.Paint getDomainGridlinePaint()
null
).setDomainGridlinePaint(Paint)
public void setDomainGridlinePaint(java.awt.Paint paint)
paint
- the paint (null
not permitted).getDomainGridlinePaint()
public java.awt.Paint getRangeGridlinePaint()
null
).setRangeGridlinePaint(Paint)
public void setRangeGridlinePaint(java.awt.Paint paint)
paint
- the paint (null
not permitted).getRangeGridlinePaint()
public java.awt.Paint getBaselinePaint()
public void setBaselinePaint(java.awt.Paint paint)
paint
- the paint (null
not permitted).public java.awt.Paint getCrosshairPaint()
public void setCrosshairPaint(java.awt.Paint paint)
paint
- the paint (null
not permitted).public org.jfree.ui.RectangleInsets getAxisOffset()
null
).setAxisOffset(RectangleInsets)
public void setAxisOffset(org.jfree.ui.RectangleInsets offset)
offset
- the offset (null
not permitted).getAxisOffset()
public java.awt.Paint getAxisLabelPaint()
null
).setAxisLabelPaint(Paint)
public void setAxisLabelPaint(java.awt.Paint paint)
paint
- the paint (null
not permitted).getAxisLabelPaint()
public java.awt.Paint getTickLabelPaint()
null
).setTickLabelPaint(Paint)
public void setTickLabelPaint(java.awt.Paint paint)
paint
- the paint (null
not permitted).getTickLabelPaint()
public java.awt.Paint getItemLabelPaint()
null
).setItemLabelPaint(Paint)
public void setItemLabelPaint(java.awt.Paint paint)
paint
- the paint (null
not permitted).getItemLabelPaint()
public boolean isShadowVisible()
setShadowVisible(boolean)
public void setShadowVisible(boolean visible)
visible
- the flag.isShadowVisible()
public java.awt.Paint getShadowPaint()
null
).setShadowPaint(Paint)
public void setShadowPaint(java.awt.Paint paint)
paint
- the paint (null
not permitted).getShadowPaint()
public BarPainter getBarPainter()
null
).setBarPainter(BarPainter)
public void setBarPainter(BarPainter painter)
painter
- the painter (null
not permitted).getBarPainter()
public XYBarPainter getXYBarPainter()
null
).setXYBarPainter(XYBarPainter)
public void setXYBarPainter(XYBarPainter painter)
painter
- the painter (null
not permitted).getXYBarPainter()
public java.awt.Paint getThermometerPaint()
null
).setThermometerPaint(Paint)
public void setThermometerPaint(java.awt.Paint paint)
paint
- the paint (null
not permitted).getThermometerPaint()
public java.awt.Paint getWallPaint()
null
).setWallPaint(Paint)
public void setWallPaint(java.awt.Paint paint)
paint
- the paint (null
not permitted).getWallPaint()
public java.awt.Paint getErrorIndicatorPaint()
null
).setErrorIndicatorPaint(Paint)
public void setErrorIndicatorPaint(java.awt.Paint paint)
paint
- the paint (null
not permitted).getErrorIndicatorPaint()
public java.awt.Paint getGridBandPaint()
null
).setGridBandPaint(Paint)
public void setGridBandPaint(java.awt.Paint paint)
paint
- the paint (null
not permitted).getGridBandPaint()
public java.awt.Paint getGridBandAlternatePaint()
SymbolAxis
).null
).setGridBandAlternatePaint(Paint)
public void setGridBandAlternatePaint(java.awt.Paint paint)
SymbolAxis
).paint
- the paint (null
not permitted).getGridBandAlternatePaint()
public java.lang.String getName()
public DrawingSupplier getDrawingSupplier()
public void setDrawingSupplier(DrawingSupplier supplier)
supplier
- the supplier (null
not permitted).getDrawingSupplier()
public void apply(JFreeChart chart)
apply
in interface ChartTheme
chart
- the chart (null
not permitted).protected void applyToTitle(Title title)
title
- the title.protected void applyToBlockContainer(BlockContainer bc)
bc
- a block container (null
not permitted).protected void applyToBlock(Block b)
b
- the block.protected void applyToPlot(Plot plot)
plot
- the plot (null
).protected void applyToPiePlot(PiePlot plot)
PiePlot
instance.
This method also clears any set values for the section paint, outline
etc, so that the theme's DrawingSupplier
will be used.plot
- the plot (null
not permitted).protected void applyToMultiplePiePlot(MultiplePiePlot plot)
MultiplePiePlot
.plot
- the plot (null
not permitted).protected void applyToCategoryPlot(CategoryPlot plot)
CategoryPlot
.plot
- the plot (null
not permitted).protected void applyToXYPlot(XYPlot plot)
XYPlot
.plot
- the plot (null
not permitted).protected void applyToFastScatterPlot(FastScatterPlot plot)
FastScatterPlot
.plot
- the plot (null
not permitted).protected void applyToPolarPlot(PolarPlot plot)
PolarPlot
. This
method is called from the applyToPlot(Plot)
method.plot
- the plot (null
not permitted).protected void applyToSpiderWebPlot(SpiderWebPlot plot)
SpiderWebPlot
.plot
- the plot (null
not permitted).protected void applyToMeterPlot(MeterPlot plot)
MeterPlot
.plot
- the plot (null
not permitted).protected void applyToThermometerPlot(ThermometerPlot plot)
ThermometerPlot
.
This method is called from the applyToPlot(Plot)
method.plot
- the plot.protected void applyToCategoryAxis(CategoryAxis axis)
CategoryAxis
.axis
- the axis (null
not permitted).protected void applyToValueAxis(ValueAxis axis)
ValueAxis
.axis
- the axis (null
not permitted).protected void applyToSymbolAxis(SymbolAxis axis)
SymbolAxis
.axis
- the axis (null
not permitted).protected void applyToPeriodAxis(PeriodAxis axis)
PeriodAxis
.axis
- the axis (null
not permitted).protected void applyToAbstractRenderer(AbstractRenderer renderer)
AbstractRenderer
.renderer
- the renderer (null
not permitted).protected void applyToCategoryItemRenderer(CategoryItemRenderer renderer)
renderer
- the renderer (null
not permitted).protected void applyToXYItemRenderer(XYItemRenderer renderer)
renderer
- the renderer (null
not permitted).protected void applyToXYAnnotation(XYAnnotation annotation)
annotation
- the annotation.public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the object (null
permitted).public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in interface org.jfree.util.PublicCloneable
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
- if the theme cannot be cloned.