Search in sources :

Example 1 with GradientBarPainter

use of org.jfree.chart.renderer.category.GradientBarPainter in project SIMVA-SoS by SESoS.

the class ChartFactory method setChartTheme.

/**
 * Sets the current chart theme.  This will be applied to all new charts
 * created via methods in this class.
 *
 * @param theme  the theme (<code>null</code> not permitted).
 *
 * @see #getChartTheme()
 * @see ChartUtilities#applyCurrentTheme(JFreeChart)
 *
 * @since 1.0.11
 */
public static void setChartTheme(ChartTheme theme) {
    ParamChecks.nullNotPermitted(theme, "theme");
    currentTheme = theme;
    // theme, and reset the bar painters in that case...
    if (theme instanceof StandardChartTheme) {
        StandardChartTheme sct = (StandardChartTheme) theme;
        if (sct.getName().equals("Legacy")) {
            BarRenderer.setDefaultBarPainter(new StandardBarPainter());
            XYBarRenderer.setDefaultBarPainter(new StandardXYBarPainter());
        } else {
            BarRenderer.setDefaultBarPainter(new GradientBarPainter());
            XYBarRenderer.setDefaultBarPainter(new GradientXYBarPainter());
        }
    }
}
Also used : GradientBarPainter(org.jfree.chart.renderer.category.GradientBarPainter) StandardBarPainter(org.jfree.chart.renderer.category.StandardBarPainter) GradientXYBarPainter(org.jfree.chart.renderer.xy.GradientXYBarPainter) StandardXYBarPainter(org.jfree.chart.renderer.xy.StandardXYBarPainter)

Aggregations

GradientBarPainter (org.jfree.chart.renderer.category.GradientBarPainter)1 StandardBarPainter (org.jfree.chart.renderer.category.StandardBarPainter)1 GradientXYBarPainter (org.jfree.chart.renderer.xy.GradientXYBarPainter)1 StandardXYBarPainter (org.jfree.chart.renderer.xy.StandardXYBarPainter)1