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.| Modifier and Type | Field and Description |
|---|---|
private java.awt.Paint |
axisLabelPaint
The axis label paint.
|
private org.jfree.ui.RectangleInsets |
axisOffset
The axis offsets.
|
private BarPainter |
barPainter
The bar painter.
|
private java.awt.Paint |
baselinePaint
The baseline paint (used for domain and range zero baselines)
|
private java.awt.Paint |
chartBackgroundPaint
The background paint for the chart.
|
private java.awt.Paint |
crosshairPaint
The crosshair paint.
|
private java.awt.Paint |
domainGridlinePaint
The domain grid line paint.
|
private DrawingSupplier |
drawingSupplier
The drawing supplier.
|
private java.awt.Paint |
errorIndicatorPaint
The error indicator paint for the
StatisticalBarRenderer. |
private java.awt.Font |
extraLargeFont
The largest font size.
|
private java.awt.Paint |
gridBandAlternatePaint
The grid band alternate paint for a
SymbolAxis. |
private java.awt.Paint |
gridBandPaint
The grid band paint for a
SymbolAxis. |
private java.awt.Paint |
itemLabelPaint
The item label paint.
|
private java.awt.Paint |
labelLinkPaint
The label link paint for pie charts.
|
private PieLabelLinkStyle |
labelLinkStyle
The label link style for pie charts.
|
private java.awt.Font |
largeFont
A large font.
|
private java.awt.Paint |
legendBackgroundPaint
The legend background paint.
|
private java.awt.Paint |
legendItemPaint
The legend item paint.
|
private java.lang.String |
name
The name of this theme.
|
private java.awt.Paint |
plotBackgroundPaint
The background paint for the plot.
|
private java.awt.Paint |
plotOutlinePaint
The plot outline paint.
|
private java.awt.Paint |
rangeGridlinePaint
The range grid line paint.
|
private java.awt.Font |
regularFont
The regular font size.
|
private ShadowGenerator |
shadowGenerator
The shadow generator (can be null).
|
private java.awt.Paint |
shadowPaint
The shadow paint.
|
private boolean |
shadowVisible
A flag that controls whether or not shadows are visible (for example,
in a bar renderer).
|
private java.awt.Font |
smallFont
The small font size.
|
private java.awt.Paint |
subtitlePaint
The paint used to display subtitles.
|
private java.awt.Paint |
thermometerPaint
The thermometer paint.
|
private java.awt.Paint |
tickLabelPaint
The tick label paint.
|
private java.awt.Paint |
titlePaint
The paint used to display the main chart title.
|
private java.awt.Paint |
wallPaint
The paint used to fill the interior of the 'walls' in the background
of a plot with a 3D effect.
|
private XYBarPainter |
xyBarPainter
The XY bar painter.
|
| 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.
|
private void |
readObject(java.io.ObjectInputStream stream)
Provides serialization support.
|
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.
|
private void |
writeObject(java.io.ObjectOutputStream stream)
Provides serialization support.
|
private java.lang.String name
private java.awt.Font extraLargeFont
private java.awt.Font largeFont
private java.awt.Font regularFont
private java.awt.Font smallFont
private transient java.awt.Paint titlePaint
private transient java.awt.Paint subtitlePaint
private transient java.awt.Paint chartBackgroundPaint
private transient java.awt.Paint legendBackgroundPaint
private transient java.awt.Paint legendItemPaint
private DrawingSupplier drawingSupplier
private transient java.awt.Paint plotBackgroundPaint
private transient java.awt.Paint plotOutlinePaint
private PieLabelLinkStyle labelLinkStyle
private transient java.awt.Paint labelLinkPaint
private transient java.awt.Paint domainGridlinePaint
private transient java.awt.Paint rangeGridlinePaint
private transient java.awt.Paint baselinePaint
private transient java.awt.Paint crosshairPaint
private org.jfree.ui.RectangleInsets axisOffset
private transient java.awt.Paint axisLabelPaint
private transient java.awt.Paint tickLabelPaint
private transient java.awt.Paint itemLabelPaint
private boolean shadowVisible
private transient java.awt.Paint shadowPaint
private BarPainter barPainter
private XYBarPainter xyBarPainter
private transient java.awt.Paint thermometerPaint
private transient java.awt.Paint wallPaint
private transient java.awt.Paint errorIndicatorPaint
StatisticalBarRenderer.private transient java.awt.Paint gridBandPaint
SymbolAxis.private transient java.awt.Paint gridBandAlternatePaint
SymbolAxis.private ShadowGenerator shadowGenerator
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 ChartThemechart - 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.Objectobj - the object (null permitted).public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone in interface org.jfree.util.PublicCloneableclone in class java.lang.Objectjava.lang.CloneNotSupportedException - if the theme cannot be cloned.private void writeObject(java.io.ObjectOutputStream stream)
throws java.io.IOException
stream - the output stream (null not permitted).java.io.IOException - if there is an I/O error.private void readObject(java.io.ObjectInputStream stream)
throws java.io.IOException,
java.lang.ClassNotFoundException
stream - the input stream (null not permitted).java.io.IOException - if there is an I/O error.java.lang.ClassNotFoundException - if there is a classpath problem.