Search in sources :

Example 1 with CompositeTitle

use of org.jfree.chart.title.CompositeTitle in project SIMVA-SoS by SESoS.

the class StandardChartTheme method applyToTitle.

/**
 * Applies the attributes of this theme to the specified title.
 *
 * @param title  the title.
 */
protected void applyToTitle(Title title) {
    if (title instanceof TextTitle) {
        TextTitle tt = (TextTitle) title;
        tt.setFont(this.largeFont);
        tt.setPaint(this.subtitlePaint);
    } else if (title instanceof LegendTitle) {
        LegendTitle lt = (LegendTitle) title;
        if (lt.getBackgroundPaint() != null) {
            lt.setBackgroundPaint(this.legendBackgroundPaint);
        }
        lt.setItemFont(this.regularFont);
        lt.setItemPaint(this.legendItemPaint);
        if (lt.getWrapper() != null) {
            applyToBlockContainer(lt.getWrapper());
        }
    } else if (title instanceof PaintScaleLegend) {
        PaintScaleLegend psl = (PaintScaleLegend) title;
        psl.setBackgroundPaint(this.legendBackgroundPaint);
        ValueAxis axis = psl.getAxis();
        if (axis != null) {
            applyToValueAxis(axis);
        }
    } else if (title instanceof CompositeTitle) {
        CompositeTitle ct = (CompositeTitle) title;
        BlockContainer bc = ct.getContainer();
        List blocks = bc.getBlocks();
        Iterator iterator = blocks.iterator();
        while (iterator.hasNext()) {
            Block b = (Block) iterator.next();
            if (b instanceof Title) {
                applyToTitle((Title) b);
            }
        }
    }
}
Also used : TextTitle(org.jfree.chart.title.TextTitle) PaintScaleLegend(org.jfree.chart.title.PaintScaleLegend) BlockContainer(org.jfree.chart.block.BlockContainer) ValueAxis(org.jfree.chart.axis.ValueAxis) Iterator(java.util.Iterator) LabelBlock(org.jfree.chart.block.LabelBlock) Block(org.jfree.chart.block.Block) Title(org.jfree.chart.title.Title) TextTitle(org.jfree.chart.title.TextTitle) LegendTitle(org.jfree.chart.title.LegendTitle) CompositeTitle(org.jfree.chart.title.CompositeTitle) LegendTitle(org.jfree.chart.title.LegendTitle) List(java.util.List) CompositeTitle(org.jfree.chart.title.CompositeTitle)

Aggregations

Iterator (java.util.Iterator)1 List (java.util.List)1 ValueAxis (org.jfree.chart.axis.ValueAxis)1 Block (org.jfree.chart.block.Block)1 BlockContainer (org.jfree.chart.block.BlockContainer)1 LabelBlock (org.jfree.chart.block.LabelBlock)1 CompositeTitle (org.jfree.chart.title.CompositeTitle)1 LegendTitle (org.jfree.chart.title.LegendTitle)1 PaintScaleLegend (org.jfree.chart.title.PaintScaleLegend)1 TextTitle (org.jfree.chart.title.TextTitle)1 Title (org.jfree.chart.title.Title)1