Example usage for org.jfree.ui Spacer RELATIVE

List of usage examples for org.jfree.ui Spacer RELATIVE

Introduction

In this page you can find the example usage for org.jfree.ui Spacer RELATIVE.

Prototype

int RELATIVE

To view the source code for org.jfree.ui Spacer RELATIVE.

Click Source Link

Document

A constant for 'relative' spacing.

Usage

From source file:de.berlios.statcvs.xml.chart.AbstractChart.java

/**
 * create chart with titles and credit information
 *///from   w  ww.j a  v a2 s . co m
protected void setup(boolean defaultShowLegend) {
    if (chart == null) {
        throw new NullPointerException("Chart is not initialized");
    }

    if (this.subtitle != null && settings.getBoolean("showSubtitle", true)) {
        Font font = new Font("SansSerif", Font.PLAIN, 12);
        TextTitle title = new TextTitle(this.subtitle, font);
        title.setSpacer(new Spacer(Spacer.RELATIVE, 0.05, 0.05, 0.05, 0.0));
        chart.addSubtitle(title);
    }

    if (settings.getBoolean("showCredit", true)) {
        Font font = new Font("SansSerif", Font.PLAIN, 9);
        TextTitle copyright = new TextTitle("generated by statcvs-xml\u00B2", font);
        copyright.setPosition(RectangleEdge.BOTTOM);
        copyright.setHorizontalAlignment(HorizontalAlignment.RIGHT);
        chart.addSubtitle(copyright);
    }

    if (!settings.getBoolean("showLegend", defaultShowLegend)) {
        chart.setLegend(null);
    }

    chart.setBackgroundPaint(Color.white);
}