Module platform

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 Details

    • StandardChartTheme

      public StandardChartTheme(String name)
      Creates a new default instance.
      Parameters:
      name - the name of the theme (null not permitted).
    • StandardChartTheme

      public StandardChartTheme(String name, boolean shadow)
      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

      public static ChartTheme createJFreeTheme()
      Creates and returns the default 'JFree' chart theme.
      Returns:
      A chart theme.
    • createDarknessTheme

      public static ChartTheme createDarknessTheme()
      Creates and returns a theme called "Darkness". In this theme, the charts have a black background.
      Returns:
      The "Darkness" theme.
    • createLegacyTheme

      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.
    • getExtraLargeFont

      public Font getExtraLargeFont()
      Returns the largest font for this theme.
      Returns:
      The largest font for this theme.
      See Also:
    • setExtraLargeFont

      public void setExtraLargeFont(Font font)
      Sets the largest font for this theme.
      Parameters:
      font - the font (null not permitted).
      See Also:
    • getLargeFont

      public Font getLargeFont()
      Returns the large font for this theme.
      Returns:
      The large font (never null).
      See Also:
    • setLargeFont

      public void setLargeFont(Font font)
      Sets the large font for this theme.
      Parameters:
      font - the font (null not permitted).
      See Also:
    • getRegularFont

      public Font getRegularFont()
      Returns the regular font.
      Returns:
      The regular font (never null).
      See Also:
    • setRegularFont

      public void setRegularFont(Font font)
      Sets the regular font for this theme.
      Parameters:
      font - the font (null not permitted).
      See Also:
    • getSmallFont

      public Font getSmallFont()
      Returns the small font.
      Returns:
      The small font (never null).
      See Also:
    • setSmallFont

      public void setSmallFont(Font font)
      Sets the small font for this theme.
      Parameters:
      font - the font (null not permitted).
      See Also:
    • getTitlePaint

      public Paint getTitlePaint()
      Returns the title paint.
      Returns:
      The title paint (never null).
      See Also:
    • setTitlePaint

      public void setTitlePaint(Paint paint)
      Sets the title paint.
      Parameters:
      paint - the paint (null not permitted).
      See Also:
    • getSubtitlePaint

      public Paint getSubtitlePaint()
      Returns the subtitle paint.
      Returns:
      The subtitle paint (never null).
      See Also:
    • setSubtitlePaint

      public void setSubtitlePaint(Paint paint)
      Sets the subtitle paint.
      Parameters:
      paint - the paint (null not permitted).
      See Also:
    • getChartBackgroundPaint

      public Paint getChartBackgroundPaint()
      Returns the chart background paint.
      Returns:
      The chart background paint (never null).
      See Also:
    • setChartBackgroundPaint

      public void setChartBackgroundPaint(Paint paint)
      Sets the chart background paint.
      Parameters:
      paint - the paint (null not permitted).
      See Also:
    • getLegendBackgroundPaint

      public Paint getLegendBackgroundPaint()
      Returns the legend background paint.
      Returns:
      The legend background paint (never null).
      See Also:
    • setLegendBackgroundPaint

      public void setLegendBackgroundPaint(Paint paint)
      Sets the legend background paint.
      Parameters:
      paint - the paint (null not permitted).
      See Also:
    • getLegendItemPaint

      public Paint getLegendItemPaint()
      Returns the legend item paint.
      Returns:
      The legend item paint (never null).
      See Also:
    • setLegendItemPaint

      public void setLegendItemPaint(Paint paint)
      Sets the legend item paint.
      Parameters:
      paint - the paint (null not permitted).
      See Also:
    • getPlotBackgroundPaint

      public Paint getPlotBackgroundPaint()
      Returns the plot background paint.
      Returns:
      The plot background paint (never null).
      See Also:
    • setPlotBackgroundPaint

      public void setPlotBackgroundPaint(Paint paint)
      Sets the plot background paint.
      Parameters:
      paint - the paint (null not permitted).
      See Also:
    • getPlotOutlinePaint

      public Paint getPlotOutlinePaint()
      Returns the plot outline paint.
      Returns:
      The plot outline paint (never null).
      See Also:
    • setPlotOutlinePaint

      public void setPlotOutlinePaint(Paint paint)
      Sets the plot outline paint.
      Parameters:
      paint - the paint (null not permitted).
      See Also:
    • getLabelLinkStyle

      public PieLabelLinkStyle getLabelLinkStyle()
      Returns the label link style for pie charts.
      Returns:
      The label link style (never null).
      See Also:
    • setLabelLinkStyle

      public void setLabelLinkStyle(PieLabelLinkStyle style)
      Sets the label link style for pie charts.
      Parameters:
      style - the style (null not permitted).
      See Also:
    • getLabelLinkPaint

      public Paint getLabelLinkPaint()
      Returns the label link paint for pie charts.
      Returns:
      The label link paint (never null).
      See Also:
    • setLabelLinkPaint

      public void setLabelLinkPaint(Paint paint)
      Sets the label link paint for pie charts.
      Parameters:
      paint - the paint (null not permitted).
      See Also:
    • getDomainGridlinePaint

      public Paint getDomainGridlinePaint()
      Returns the domain grid line paint.
      Returns:
      The domain grid line paint (never null).
      See Also:
    • setDomainGridlinePaint

      public void setDomainGridlinePaint(Paint paint)
      Sets the domain grid line paint.
      Parameters:
      paint - the paint (null not permitted).
      See Also:
    • getRangeGridlinePaint

      public Paint getRangeGridlinePaint()
      Returns the range grid line paint.
      Returns:
      The range grid line paint (never null).
      See Also:
    • setRangeGridlinePaint

      public void setRangeGridlinePaint(Paint paint)
      Sets the range grid line paint.
      Parameters:
      paint - the paint (null not permitted).
      See Also:
    • getBaselinePaint

      public Paint getBaselinePaint()
      Returns the baseline paint.
      Returns:
      The baseline paint.
    • setBaselinePaint

      public void setBaselinePaint(Paint paint)
      Sets the baseline paint.
      Parameters:
      paint - the paint (null not permitted).
    • getCrosshairPaint

      public Paint getCrosshairPaint()
      Returns the crosshair paint.
      Returns:
      The crosshair paint.
    • setCrosshairPaint

      public void setCrosshairPaint(Paint paint)
      Sets the crosshair paint.
      Parameters:
      paint - the paint (null not permitted).
    • getAxisOffset

      public RectangleInsets getAxisOffset()
      Returns the axis offsets.
      Returns:
      The axis offsets (never null).
      See Also:
    • setAxisOffset

      public void setAxisOffset(RectangleInsets offset)
      Sets the axis offset.
      Parameters:
      offset - the offset (null not permitted).
      See Also:
    • getAxisLabelPaint

      public Paint getAxisLabelPaint()
      Returns the axis label paint.
      Returns:
      The axis label paint (never null).
      See Also:
    • setAxisLabelPaint

      public void setAxisLabelPaint(Paint paint)
      Sets the axis label paint.
      Parameters:
      paint - the paint (null not permitted).
      See Also:
    • getTickLabelPaint

      public Paint getTickLabelPaint()
      Returns the tick label paint.
      Returns:
      The tick label paint (never null).
      See Also:
    • setTickLabelPaint

      public void setTickLabelPaint(Paint paint)
      Sets the tick label paint.
      Parameters:
      paint - the paint (null not permitted).
      See Also:
    • getItemLabelPaint

      public Paint getItemLabelPaint()
      Returns the item label paint.
      Returns:
      The item label paint (never null).
      See Also:
    • setItemLabelPaint

      public void setItemLabelPaint(Paint paint)
      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

      public Paint getShadowPaint()
      Returns the shadow paint.
      Returns:
      The shadow paint (never null).
      See Also:
    • setShadowPaint

      public void setShadowPaint(Paint paint)
      Sets the shadow paint.
      Parameters:
      paint - the paint (null not permitted).
      See Also:
    • getBarPainter

      public BarPainter getBarPainter()
      Returns the bar painter.
      Returns:
      The bar painter (never null).
      See Also:
    • setBarPainter

      public void setBarPainter(BarPainter painter)
      Sets the bar painter.
      Parameters:
      painter - the painter (null not permitted).
      See Also:
    • getXYBarPainter

      public XYBarPainter getXYBarPainter()
      Returns the XY bar painter.
      Returns:
      The XY bar painter (never null).
      See Also:
    • setXYBarPainter

      public void setXYBarPainter(XYBarPainter painter)
      Sets the XY bar painter.
      Parameters:
      painter - the painter (null not permitted).
      See Also:
    • getThermometerPaint

      public Paint getThermometerPaint()
      Returns the thermometer paint.
      Returns:
      The thermometer paint (never null).
      See Also:
    • setThermometerPaint

      public void setThermometerPaint(Paint paint)
      Sets the thermometer paint.
      Parameters:
      paint - the paint (null not permitted).
      See Also:
    • getErrorIndicatorPaint

      public Paint getErrorIndicatorPaint()
      Returns the error indicator paint.
      Returns:
      The error indicator paint (never null).
      See Also:
    • setErrorIndicatorPaint

      public void setErrorIndicatorPaint(Paint paint)
      Sets the error indicator paint.
      Parameters:
      paint - the paint (null not permitted).
      See Also:
    • getGridBandPaint

      public Paint getGridBandPaint()
      Returns the grid band paint.
      Returns:
      The grid band paint (never null).
      See Also:
    • setGridBandPaint

      public void setGridBandPaint(Paint paint)
      Sets the grid band paint.
      Parameters:
      paint - the paint (null not permitted).
      See Also:
    • getGridBandAlternatePaint

      public Paint getGridBandAlternatePaint()
      Returns the grid band alternate paint (used for a SymbolAxis).
      Returns:
      The paint (never null).
      See Also:
    • setGridBandAlternatePaint

      public void setGridBandAlternatePaint(Paint paint)
      Sets the grid band alternate paint (used for a SymbolAxis).
      Parameters:
      paint - the paint (null not permitted).
      See Also:
    • getName

      public String getName()
      Returns the name of this theme.
      Returns:
      The name of this theme.
    • getDrawingSupplier

      public DrawingSupplier getDrawingSupplier()
      Returns a clone of the drawing supplier for this theme.
      Returns:
      A clone of the drawing supplier.
    • setDrawingSupplier

      public void setDrawingSupplier(DrawingSupplier supplier)
      Sets the drawing supplier for this theme.
      Parameters:
      supplier - the supplier (null not permitted).
      See Also:
    • apply

      public void apply(JFreeChart chart)
      Applies this theme to the supplied chart.
      Specified by:
      apply in interface ChartTheme
      Parameters:
      chart - the chart (null not permitted).
    • applyToTitle

      protected void applyToTitle(Title title)
      Applies the attributes of this theme to the specified title.
      Parameters:
      title - the title.
    • applyToBlockContainer

      protected void applyToBlockContainer(BlockContainer bc)
      Applies the attributes of this theme to the specified container.
      Parameters:
      bc - a block container (null not permitted).
    • applyToBlock

      protected void applyToBlock(Block b)
      Applies the attributes of this theme to the specified block.
      Parameters:
      b - the block.
    • applyToPlot

      protected void applyToPlot(Plot plot)
      Applies the attributes of this theme to a plot.
      Parameters:
      plot - the plot (null).
    • applyToPiePlot

      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).
    • applyToMultiplePiePlot

      protected void applyToMultiplePiePlot(MultiplePiePlot plot)
      Applies the attributes of this theme to a MultiplePiePlot.
      Parameters:
      plot - the plot (null not permitted).
    • applyToCategoryPlot

      protected void applyToCategoryPlot(CategoryPlot plot)
      Applies the attributes of this theme to a CategoryPlot.
      Parameters:
      plot - the plot (null not permitted).
    • applyToXYPlot

      protected void applyToXYPlot(XYPlot plot)
      Applies the attributes of this theme to a XYPlot.
      Parameters:
      plot - the plot (null not permitted).
    • applyToFastScatterPlot

      protected void applyToFastScatterPlot(FastScatterPlot plot)
      Applies the attributes of this theme to a FastScatterPlot.
      Parameters:
      plot - the plot (null not permitted).
    • applyToPolarPlot

      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).
    • applyToSpiderWebPlot

      protected void applyToSpiderWebPlot(SpiderWebPlot plot)
      Applies the attributes of this theme to a SpiderWebPlot.
      Parameters:
      plot - the plot (null not permitted).
    • applyToMeterPlot

      protected void applyToMeterPlot(MeterPlot plot)
      Applies the attributes of this theme to a MeterPlot.
      Parameters:
      plot - the plot (null not permitted).
    • applyToThermometerPlot

      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.
    • applyToCategoryAxis

      protected void applyToCategoryAxis(CategoryAxis axis)
      Applies the attributes for this theme to a CategoryAxis.
      Parameters:
      axis - the axis (null not permitted).
    • applyToValueAxis

      protected void applyToValueAxis(ValueAxis axis)
      Applies the attributes for this theme to a ValueAxis.
      Parameters:
      axis - the axis (null not permitted).
    • applyToSymbolAxis

      protected void applyToSymbolAxis(SymbolAxis axis)
      Applies the attributes for this theme to a SymbolAxis.
      Parameters:
      axis - the axis (null not permitted).
    • applyToPeriodAxis

      protected void applyToPeriodAxis(PeriodAxis axis)
      Applies the attributes for this theme to a PeriodAxis.
      Parameters:
      axis - the axis (null not permitted).
    • applyToAbstractRenderer

      protected void applyToAbstractRenderer(AbstractRenderer renderer)
      Applies the attributes for this theme to an AbstractRenderer.
      Parameters:
      renderer - the renderer (null not permitted).
    • applyToCategoryItemRenderer

      protected void applyToCategoryItemRenderer(CategoryItemRenderer renderer)
      Applies the settings of this theme to the specified renderer.
      Parameters:
      renderer - the renderer (null not permitted).
    • applyToXYItemRenderer

      protected void applyToXYItemRenderer(XYItemRenderer renderer)
      Applies the settings of this theme to the specified renderer.
      Parameters:
      renderer - the renderer (null not permitted).
    • applyToXYAnnotation

      protected void applyToXYAnnotation(XYAnnotation annotation)
      Applies the settings of this theme to the specified annotation.
      Parameters:
      annotation - the annotation.
    • equals

      public boolean equals(Object obj)
      Tests this theme for equality with an arbitrary object.
      Overrides:
      equals in class Object
      Parameters:
      obj - the object (null permitted).
      Returns:
      A boolean.
    • clone

      public Object clone() throws CloneNotSupportedException
      Returns a clone of this theme.
      Specified by:
      clone in interface PublicCloneable
      Overrides:
      clone in class Object
      Returns:
      A clone.
      Throws:
      CloneNotSupportedException - if the theme cannot be cloned.