Search in sources :

Example 1 with CombinedDomainCategoryPlot

use of org.jfree.chart.plot.CombinedDomainCategoryPlot in project SIMVA-SoS by SESoS.

the class StandardChartTheme method applyToCategoryPlot.

/**
 * Applies the attributes of this theme to a {@link CategoryPlot}.
 *
 * @param plot  the plot (<code>null</code> not permitted).
 */
protected void applyToCategoryPlot(CategoryPlot plot) {
    plot.setAxisOffset(this.axisOffset);
    plot.setDomainGridlinePaint(this.domainGridlinePaint);
    plot.setRangeGridlinePaint(this.rangeGridlinePaint);
    plot.setRangeZeroBaselinePaint(this.baselinePaint);
    plot.setShadowGenerator(this.shadowGenerator);
    // process all domain axes
    int domainAxisCount = plot.getDomainAxisCount();
    for (int i = 0; i < domainAxisCount; i++) {
        CategoryAxis axis = plot.getDomainAxis(i);
        if (axis != null) {
            applyToCategoryAxis(axis);
        }
    }
    // process all range axes
    int rangeAxisCount = plot.getRangeAxisCount();
    for (int i = 0; i < rangeAxisCount; i++) {
        ValueAxis axis = plot.getRangeAxis(i);
        if (axis != null) {
            applyToValueAxis(axis);
        }
    }
    // process all renderers
    int rendererCount = plot.getRendererCount();
    for (int i = 0; i < rendererCount; i++) {
        CategoryItemRenderer r = plot.getRenderer(i);
        if (r != null) {
            applyToCategoryItemRenderer(r);
        }
    }
    if (plot instanceof CombinedDomainCategoryPlot) {
        CombinedDomainCategoryPlot cp = (CombinedDomainCategoryPlot) plot;
        Iterator iterator = cp.getSubplots().iterator();
        while (iterator.hasNext()) {
            CategoryPlot subplot = (CategoryPlot) iterator.next();
            if (subplot != null) {
                applyToPlot(subplot);
            }
        }
    }
    if (plot instanceof CombinedRangeCategoryPlot) {
        CombinedRangeCategoryPlot cp = (CombinedRangeCategoryPlot) plot;
        Iterator iterator = cp.getSubplots().iterator();
        while (iterator.hasNext()) {
            CategoryPlot subplot = (CategoryPlot) iterator.next();
            if (subplot != null) {
                applyToPlot(subplot);
            }
        }
    }
}
Also used : CategoryItemRenderer(org.jfree.chart.renderer.category.CategoryItemRenderer) CategoryAxis(org.jfree.chart.axis.CategoryAxis) SubCategoryAxis(org.jfree.chart.axis.SubCategoryAxis) CombinedRangeCategoryPlot(org.jfree.chart.plot.CombinedRangeCategoryPlot) ValueAxis(org.jfree.chart.axis.ValueAxis) CombinedDomainCategoryPlot(org.jfree.chart.plot.CombinedDomainCategoryPlot) Iterator(java.util.Iterator) Paint(java.awt.Paint) CategoryPlot(org.jfree.chart.plot.CategoryPlot) CombinedRangeCategoryPlot(org.jfree.chart.plot.CombinedRangeCategoryPlot) CombinedDomainCategoryPlot(org.jfree.chart.plot.CombinedDomainCategoryPlot)

Aggregations

Paint (java.awt.Paint)1 Iterator (java.util.Iterator)1 CategoryAxis (org.jfree.chart.axis.CategoryAxis)1 SubCategoryAxis (org.jfree.chart.axis.SubCategoryAxis)1 ValueAxis (org.jfree.chart.axis.ValueAxis)1 CategoryPlot (org.jfree.chart.plot.CategoryPlot)1 CombinedDomainCategoryPlot (org.jfree.chart.plot.CombinedDomainCategoryPlot)1 CombinedRangeCategoryPlot (org.jfree.chart.plot.CombinedRangeCategoryPlot)1 CategoryItemRenderer (org.jfree.chart.renderer.category.CategoryItemRenderer)1