Search in sources :

Example 1 with DefaultDrawingSupplier

use of org.jfree.chart.plot.DefaultDrawingSupplier in project processdash by dtuma.

the class PieChart method configureConsistentColors.

private void configureConsistentColors(final PiePlot plot, PieDataset pieData) {
    DefaultDrawingSupplier s = new DefaultDrawingSupplier();
    String skip = getParameter("consistentSkip");
    if (skip != null)
        for (int i = Integer.parseInt(skip); i-- > 0; ) s.getNextPaint();
    for (Object key : pieData.getKeys()) {
        Paint paint = s.getNextPaint();
        plot.setSectionPaint((Comparable) key, paint);
    }
}
Also used : Paint(java.awt.Paint) DefaultDrawingSupplier(org.jfree.chart.plot.DefaultDrawingSupplier)

Example 2 with DefaultDrawingSupplier

use of org.jfree.chart.plot.DefaultDrawingSupplier in project processdash by dtuma.

the class AreaChart method configureConsistentColors.

private void configureConsistentColors(CategoryPlot plot, CategoryDataset catData) {
    DefaultDrawingSupplier s = new DefaultDrawingSupplier();
    String skip = getParameter("consistentSkip");
    if (skip != null)
        for (int i = Integer.parseInt(skip); i-- > 0; ) s.getNextPaint();
    CategoryItemRenderer rend = plot.getRenderer();
    for (int i = 0; i < catData.getRowCount(); i++) {
        Paint paint = s.getNextPaint();
        rend.setSeriesPaint(i, paint);
    }
}
Also used : CategoryItemRenderer(org.jfree.chart.renderer.category.CategoryItemRenderer) Paint(java.awt.Paint) DefaultDrawingSupplier(org.jfree.chart.plot.DefaultDrawingSupplier) Paint(java.awt.Paint)

Example 3 with DefaultDrawingSupplier

use of org.jfree.chart.plot.DefaultDrawingSupplier in project pentaho-platform by pentaho.

the class JFreeChartEngine method updatePlot.

private static void updatePlot(final Plot plot, final ChartDefinition chartDefinition) {
    plot.setBackgroundPaint(chartDefinition.getPlotBackgroundPaint());
    plot.setBackgroundImage(chartDefinition.getPlotBackgroundImage());
    plot.setNoDataMessage(chartDefinition.getNoDataMessage());
    // create a custom palette if it was defined
    if (chartDefinition.getPaintSequence() != null) {
        DefaultDrawingSupplier drawingSupplier = new DefaultDrawingSupplier(chartDefinition.getPaintSequence(), DefaultDrawingSupplier.DEFAULT_OUTLINE_PAINT_SEQUENCE, DefaultDrawingSupplier.DEFAULT_STROKE_SEQUENCE, DefaultDrawingSupplier.DEFAULT_OUTLINE_STROKE_SEQUENCE, DefaultDrawingSupplier.DEFAULT_SHAPE_SEQUENCE);
        plot.setDrawingSupplier(drawingSupplier);
    }
    // TODO define outline stroke
    plot.setOutlineStroke(null);
    if (plot instanceof CategoryPlot) {
        CategoryPlot categoryPlot = (CategoryPlot) plot;
        CategoryDatasetChartDefinition categoryDatasetChartDefintion = (CategoryDatasetChartDefinition) chartDefinition;
        categoryPlot.setOrientation(categoryDatasetChartDefintion.getOrientation());
        CategoryAxis domainAxis = categoryPlot.getDomainAxis();
        if (domainAxis != null) {
            domainAxis.setLabel(categoryDatasetChartDefintion.getDomainTitle());
            domainAxis.setLabelFont(categoryDatasetChartDefintion.getDomainTitleFont());
            if (categoryDatasetChartDefintion.getDomainTickFont() != null) {
                domainAxis.setTickLabelFont(categoryDatasetChartDefintion.getDomainTickFont());
            }
            domainAxis.setCategoryLabelPositions(categoryDatasetChartDefintion.getCategoryLabelPositions());
        }
        NumberAxis numberAxis = (NumberAxis) categoryPlot.getRangeAxis();
        if (numberAxis != null) {
            numberAxis.setLabel(categoryDatasetChartDefintion.getRangeTitle());
            numberAxis.setLabelFont(categoryDatasetChartDefintion.getRangeTitleFont());
            if (categoryDatasetChartDefintion.getRangeMinimum() != ValueAxis.DEFAULT_LOWER_BOUND) {
                numberAxis.setLowerBound(categoryDatasetChartDefintion.getRangeMinimum());
            }
            if (categoryDatasetChartDefintion.getRangeMaximum() != ValueAxis.DEFAULT_UPPER_BOUND) {
                numberAxis.setUpperBound(categoryDatasetChartDefintion.getRangeMaximum());
            }
            if (categoryDatasetChartDefintion.getRangeTickFormat() != null) {
                numberAxis.setNumberFormatOverride(categoryDatasetChartDefintion.getRangeTickFormat());
            }
            if (categoryDatasetChartDefintion.getRangeTickFont() != null) {
                numberAxis.setTickLabelFont(categoryDatasetChartDefintion.getRangeTickFont());
            }
            if (categoryDatasetChartDefintion.getRangeTickUnits() != null) {
                numberAxis.setTickUnit(new NumberTickUnit(categoryDatasetChartDefintion.getRangeTickUnits()));
            }
        }
    }
    if (plot instanceof PiePlot) {
        PiePlot pie = (PiePlot) plot;
        PieDatasetChartDefinition pieDefinition = (PieDatasetChartDefinition) chartDefinition;
        pie.setInteriorGap(pieDefinition.getInteriorGap());
        pie.setStartAngle(pieDefinition.getStartAngle());
        pie.setLabelFont(pieDefinition.getLabelFont());
        if (pieDefinition.getLabelPaint() != null) {
            pie.setLabelPaint(pieDefinition.getLabelPaint());
        }
        pie.setLabelBackgroundPaint(pieDefinition.getLabelBackgroundPaint());
        if (pieDefinition.isLegendIncluded()) {
            // $NON-NLS-1$
            StandardPieSectionLabelGenerator labelGen = new StandardPieSectionLabelGenerator("{0}");
            pie.setLegendLabelGenerator(labelGen);
        }
        if (pieDefinition.getExplodedSlices() != null) {
            for (Iterator iter = pieDefinition.getExplodedSlices().iterator(); iter.hasNext(); ) {
                pie.setExplodePercent((Comparable) iter.next(), .30);
            }
        }
        pie.setLabelGap(pieDefinition.getLabelGap());
        if (!pieDefinition.isDisplayLabels()) {
            pie.setLabelGenerator(null);
        } else {
            if (pieDefinition.isLegendIncluded()) {
                // $NON-NLS-1$
                StandardPieSectionLabelGenerator labelGen = new StandardPieSectionLabelGenerator("{1} ({2})");
                pie.setLabelGenerator(labelGen);
            } else {
                // $NON-NLS-1$
                StandardPieSectionLabelGenerator labelGen = new StandardPieSectionLabelGenerator("{0} = {1} ({2})");
                pie.setLabelGenerator(labelGen);
            }
        }
    }
    if (plot instanceof MultiplePiePlot) {
        MultiplePiePlot pies = (MultiplePiePlot) plot;
        CategoryDatasetChartDefinition categoryDatasetChartDefintion = (CategoryDatasetChartDefinition) chartDefinition;
        pies.setDataset(categoryDatasetChartDefintion);
    }
    if (plot instanceof MeterPlot) {
        MeterPlot meter = (MeterPlot) plot;
        DialWidgetDefinition widget = (DialWidgetDefinition) chartDefinition;
        List intervals = widget.getIntervals();
        Iterator intervalIterator = intervals.iterator();
        while (intervalIterator.hasNext()) {
            MeterInterval interval = (MeterInterval) intervalIterator.next();
            meter.addInterval(interval);
        }
        meter.setNeedlePaint(widget.getNeedlePaint());
        meter.setDialShape(widget.getDialShape());
        meter.setDialBackgroundPaint(widget.getPlotBackgroundPaint());
        meter.setRange(new Range(widget.getMinimum(), widget.getMaximum()));
    }
    if (plot instanceof XYPlot) {
        XYPlot xyPlot = (XYPlot) plot;
        if (chartDefinition instanceof XYSeriesCollectionChartDefinition) {
            XYSeriesCollectionChartDefinition xySeriesCollectionChartDefintion = (XYSeriesCollectionChartDefinition) chartDefinition;
            xyPlot.setOrientation(xySeriesCollectionChartDefintion.getOrientation());
            ValueAxis domainAxis = xyPlot.getDomainAxis();
            if (domainAxis != null) {
                domainAxis.setLabel(xySeriesCollectionChartDefintion.getDomainTitle());
                domainAxis.setLabelFont(xySeriesCollectionChartDefintion.getDomainTitleFont());
                domainAxis.setVerticalTickLabels(xySeriesCollectionChartDefintion.isDomainVerticalTickLabels());
                if (xySeriesCollectionChartDefintion.getDomainTickFormat() != null) {
                    ((NumberAxis) domainAxis).setNumberFormatOverride(xySeriesCollectionChartDefintion.getDomainTickFormat());
                }
                if (xySeriesCollectionChartDefintion.getDomainTickFont() != null) {
                    domainAxis.setTickLabelFont(xySeriesCollectionChartDefintion.getDomainTickFont());
                }
                if (xySeriesCollectionChartDefintion.getDomainMinimum() != ValueAxis.DEFAULT_LOWER_BOUND) {
                    domainAxis.setLowerBound(xySeriesCollectionChartDefintion.getDomainMinimum());
                }
                if (xySeriesCollectionChartDefintion.getDomainMaximum() != ValueAxis.DEFAULT_UPPER_BOUND) {
                    domainAxis.setUpperBound(xySeriesCollectionChartDefintion.getDomainMaximum());
                }
            }
            ValueAxis rangeAxis = xyPlot.getRangeAxis();
            if (rangeAxis != null) {
                rangeAxis.setLabel(xySeriesCollectionChartDefintion.getRangeTitle());
                rangeAxis.setLabelFont(xySeriesCollectionChartDefintion.getRangeTitleFont());
                if (xySeriesCollectionChartDefintion.getRangeMinimum() != ValueAxis.DEFAULT_LOWER_BOUND) {
                    rangeAxis.setLowerBound(xySeriesCollectionChartDefintion.getRangeMinimum());
                }
                if (xySeriesCollectionChartDefintion.getRangeMaximum() != ValueAxis.DEFAULT_UPPER_BOUND) {
                    rangeAxis.setUpperBound(xySeriesCollectionChartDefintion.getRangeMaximum());
                }
                if (xySeriesCollectionChartDefintion.getRangeMinimum() != ValueAxis.DEFAULT_LOWER_BOUND) {
                    rangeAxis.setLowerBound(xySeriesCollectionChartDefintion.getRangeMinimum());
                }
                if (xySeriesCollectionChartDefintion.getRangeMaximum() != ValueAxis.DEFAULT_UPPER_BOUND) {
                    rangeAxis.setUpperBound(xySeriesCollectionChartDefintion.getRangeMaximum());
                }
                if (xySeriesCollectionChartDefintion.getRangeTickFormat() != null) {
                    ((NumberAxis) rangeAxis).setNumberFormatOverride(xySeriesCollectionChartDefintion.getRangeTickFormat());
                }
                if (xySeriesCollectionChartDefintion.getRangeTickFont() != null) {
                    rangeAxis.setTickLabelFont(xySeriesCollectionChartDefintion.getRangeTickFont());
                }
            }
        } else if (chartDefinition instanceof TimeSeriesCollectionChartDefinition) {
            TimeSeriesCollectionChartDefinition timeSeriesCollectionChartDefintion = (TimeSeriesCollectionChartDefinition) chartDefinition;
            xyPlot.setOrientation(timeSeriesCollectionChartDefintion.getOrientation());
            ValueAxis domainAxis = xyPlot.getDomainAxis();
            if (domainAxis != null) {
                domainAxis.setLabel(timeSeriesCollectionChartDefintion.getDomainTitle());
                domainAxis.setLabelFont(timeSeriesCollectionChartDefintion.getDomainTitleFont());
                domainAxis.setVerticalTickLabels(timeSeriesCollectionChartDefintion.isDomainVerticalTickLabels());
                if (domainAxis instanceof DateAxis) {
                    DateAxis da = (DateAxis) domainAxis;
                    if (timeSeriesCollectionChartDefintion.getDateMinimum() != null) {
                        da.setMinimumDate(timeSeriesCollectionChartDefintion.getDateMinimum());
                    }
                    if (timeSeriesCollectionChartDefintion.getDateMaximum() != null) {
                        da.setMaximumDate(timeSeriesCollectionChartDefintion.getDateMaximum());
                    }
                }
            }
            ValueAxis rangeAxis = xyPlot.getRangeAxis();
            if (rangeAxis != null) {
                rangeAxis.setLabel(timeSeriesCollectionChartDefintion.getRangeTitle());
                rangeAxis.setLabelFont(timeSeriesCollectionChartDefintion.getRangeTitleFont());
                if (timeSeriesCollectionChartDefintion.getRangeMinimum() != ValueAxis.DEFAULT_LOWER_BOUND) {
                    rangeAxis.setLowerBound(timeSeriesCollectionChartDefintion.getRangeMinimum());
                }
                if (timeSeriesCollectionChartDefintion.getRangeMaximum() != ValueAxis.DEFAULT_UPPER_BOUND) {
                    rangeAxis.setUpperBound(timeSeriesCollectionChartDefintion.getRangeMaximum());
                }
            }
        } else if (chartDefinition instanceof XYZSeriesCollectionChartDefinition) {
            XYZSeriesCollectionChartDefinition xyzSeriesCollectionChartDefintion = (XYZSeriesCollectionChartDefinition) chartDefinition;
            xyPlot.setOrientation(xyzSeriesCollectionChartDefintion.getOrientation());
            ValueAxis domainAxis = xyPlot.getDomainAxis();
            if (domainAxis != null) {
                domainAxis.setLabel(xyzSeriesCollectionChartDefintion.getDomainTitle());
                domainAxis.setLabelFont(xyzSeriesCollectionChartDefintion.getDomainTitleFont());
                domainAxis.setVerticalTickLabels(xyzSeriesCollectionChartDefintion.isDomainVerticalTickLabels());
                if (xyzSeriesCollectionChartDefintion.getDomainMinimum() != ValueAxis.DEFAULT_LOWER_BOUND) {
                    domainAxis.setLowerBound(xyzSeriesCollectionChartDefintion.getDomainMinimum());
                }
                if (xyzSeriesCollectionChartDefintion.getDomainMaximum() != ValueAxis.DEFAULT_UPPER_BOUND) {
                    domainAxis.setUpperBound(xyzSeriesCollectionChartDefintion.getDomainMaximum());
                }
                if (xyzSeriesCollectionChartDefintion.getDomainTickFormat() != null) {
                    ((NumberAxis) domainAxis).setNumberFormatOverride(xyzSeriesCollectionChartDefintion.getDomainTickFormat());
                }
                if (xyzSeriesCollectionChartDefintion.getDomainTickFont() != null) {
                    domainAxis.setTickLabelFont(xyzSeriesCollectionChartDefintion.getDomainTickFont());
                }
            }
            ValueAxis rangeAxis = xyPlot.getRangeAxis();
            if (rangeAxis != null) {
                rangeAxis.setLabel(xyzSeriesCollectionChartDefintion.getRangeTitle());
                rangeAxis.setLabelFont(xyzSeriesCollectionChartDefintion.getRangeTitleFont());
                rangeAxis.setLowerBound(xyzSeriesCollectionChartDefintion.getRangeMinimum());
                if (xyzSeriesCollectionChartDefintion.getRangeMinimum() != ValueAxis.DEFAULT_LOWER_BOUND) {
                    rangeAxis.setLowerBound(xyzSeriesCollectionChartDefintion.getRangeMinimum());
                }
                if (xyzSeriesCollectionChartDefintion.getRangeMaximum() != ValueAxis.DEFAULT_UPPER_BOUND) {
                    rangeAxis.setUpperBound(xyzSeriesCollectionChartDefintion.getRangeMaximum());
                }
                if (xyzSeriesCollectionChartDefintion.getRangeTickFormat() != null) {
                    ((NumberAxis) rangeAxis).setNumberFormatOverride(xyzSeriesCollectionChartDefintion.getRangeTickFormat());
                }
                if (xyzSeriesCollectionChartDefintion.getRangeTickFont() != null) {
                    rangeAxis.setTickLabelFont(xyzSeriesCollectionChartDefintion.getRangeTickFont());
                }
            }
        }
    }
}
Also used : DateAxis(org.jfree.chart.axis.DateAxis) NumberAxis(org.jfree.chart.axis.NumberAxis) MeterInterval(org.jfree.chart.plot.MeterInterval) MultiplePiePlot(org.jfree.chart.plot.MultiplePiePlot) StandardPieSectionLabelGenerator(org.jfree.chart.labels.StandardPieSectionLabelGenerator) Range(org.jfree.data.Range) CategoryPlot(org.jfree.chart.plot.CategoryPlot) MeterPlot(org.jfree.chart.plot.MeterPlot) NumberTickUnit(org.jfree.chart.axis.NumberTickUnit) XYPlot(org.jfree.chart.plot.XYPlot) CategoryAxis(org.jfree.chart.axis.CategoryAxis) ValueAxis(org.jfree.chart.axis.ValueAxis) Iterator(java.util.Iterator) PiePlot(org.jfree.chart.plot.PiePlot) MultiplePiePlot(org.jfree.chart.plot.MultiplePiePlot) List(java.util.List) DefaultDrawingSupplier(org.jfree.chart.plot.DefaultDrawingSupplier)

Example 4 with DefaultDrawingSupplier

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

the class StandardChartTheme method createDarknessTheme.

/**
 * Creates and returns a theme called "Darkness".  In this theme, the
 * charts have a black background.
 *
 * @return The "Darkness" theme.
 */
public static ChartTheme createDarknessTheme() {
    StandardChartTheme theme = new StandardChartTheme("Darkness");
    theme.titlePaint = Color.white;
    theme.subtitlePaint = Color.white;
    theme.legendBackgroundPaint = Color.black;
    theme.legendItemPaint = Color.white;
    theme.chartBackgroundPaint = Color.black;
    theme.plotBackgroundPaint = Color.black;
    theme.plotOutlinePaint = Color.yellow;
    theme.baselinePaint = Color.white;
    theme.crosshairPaint = Color.red;
    theme.labelLinkPaint = Color.lightGray;
    theme.tickLabelPaint = Color.white;
    theme.axisLabelPaint = Color.white;
    theme.shadowPaint = Color.darkGray;
    theme.itemLabelPaint = Color.white;
    theme.drawingSupplier = new DefaultDrawingSupplier(new Paint[] { Color.decode("0xFFFF00"), Color.decode("0x0036CC"), Color.decode("0xFF0000"), Color.decode("0xFFFF7F"), Color.decode("0x6681CC"), Color.decode("0xFF7F7F"), Color.decode("0xFFFFBF"), Color.decode("0x99A6CC"), Color.decode("0xFFBFBF"), Color.decode("0xA9A938"), Color.decode("0x2D4587") }, new Paint[] { Color.decode("0xFFFF00"), Color.decode("0x0036CC") }, new Stroke[] { new BasicStroke(2.0f) }, new Stroke[] { new BasicStroke(0.5f) }, DefaultDrawingSupplier.DEFAULT_SHAPE_SEQUENCE);
    theme.wallPaint = Color.darkGray;
    theme.errorIndicatorPaint = Color.lightGray;
    theme.gridBandPaint = new Color(255, 255, 255, 20);
    theme.gridBandAlternatePaint = new Color(255, 255, 255, 40);
    theme.shadowGenerator = null;
    return theme;
}
Also used : BasicStroke(java.awt.BasicStroke) BasicStroke(java.awt.BasicStroke) Stroke(java.awt.Stroke) Color(java.awt.Color) Paint(java.awt.Paint) DefaultDrawingSupplier(org.jfree.chart.plot.DefaultDrawingSupplier)

Example 5 with DefaultDrawingSupplier

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

the class StandardChartThemeTest method testEquals.

/**
 * Confirm that the equals method can distinguish all the required fields.
 */
@Test
public void testEquals() {
    StandardChartTheme t1 = new StandardChartTheme("Name");
    StandardChartTheme t2 = new StandardChartTheme("Name");
    assertTrue(t1.equals(t2));
    // name
    t1 = new StandardChartTheme("t1");
    assertFalse(t1.equals(t2));
    t2 = new StandardChartTheme("t1");
    assertTrue(t1.equals(t2));
    // extraLargeFont
    t1.setExtraLargeFont(new Font("Dialog", Font.PLAIN, 21));
    assertFalse(t1.equals(t2));
    t2.setExtraLargeFont(new Font("Dialog", Font.PLAIN, 21));
    assertTrue(t1.equals(t2));
    // largeFont
    t1.setLargeFont(new Font("Dialog", Font.PLAIN, 19));
    assertFalse(t1.equals(t2));
    t2.setLargeFont(new Font("Dialog", Font.PLAIN, 19));
    assertTrue(t1.equals(t2));
    // regularFont;
    t1.setRegularFont(new Font("Dialog", Font.PLAIN, 17));
    assertFalse(t1.equals(t2));
    t2.setRegularFont(new Font("Dialog", Font.PLAIN, 17));
    assertTrue(t1.equals(t2));
    // titlePaint;
    t1.setTitlePaint(new GradientPaint(0f, 1f, Color.red, 2f, 3f, Color.blue));
    assertFalse(t1.equals(t2));
    t2.setTitlePaint(new GradientPaint(0f, 1f, Color.red, 2f, 3f, Color.blue));
    assertTrue(t1.equals(t2));
    // subtitlePaint;
    t1.setSubtitlePaint(new GradientPaint(1f, 2f, Color.red, 3f, 4f, Color.blue));
    assertFalse(t1.equals(t2));
    t2.setSubtitlePaint(new GradientPaint(1f, 2f, Color.red, 3f, 4f, Color.blue));
    assertTrue(t1.equals(t2));
    // chartBackgroundPaint;
    t1.setChartBackgroundPaint(new GradientPaint(2f, 3f, Color.blue, 4f, 5f, Color.red));
    assertFalse(t1.equals(t2));
    t2.setChartBackgroundPaint(new GradientPaint(2f, 3f, Color.blue, 4f, 5f, Color.red));
    assertTrue(t1.equals(t2));
    // legendBackgroundPaint;
    t1.setLegendBackgroundPaint(new GradientPaint(3f, 4f, Color.gray, 1f, 2f, Color.red));
    assertFalse(t1.equals(t2));
    t2.setLegendBackgroundPaint(new GradientPaint(3f, 4f, Color.gray, 1f, 2f, Color.red));
    assertTrue(t1.equals(t2));
    // legendItemPaint;
    t1.setLegendItemPaint(new GradientPaint(9f, 8f, Color.red, 7f, 6f, Color.blue));
    assertFalse(t1.equals(t2));
    t2.setLegendItemPaint(new GradientPaint(9f, 8f, Color.red, 7f, 6f, Color.blue));
    assertTrue(t1.equals(t2));
    // drawingSupplier;
    t1.setDrawingSupplier(new DefaultDrawingSupplier(new Paint[] { Color.red }, new Paint[] { Color.blue }, new Stroke[] { new BasicStroke(1.0f) }, new Stroke[] { new BasicStroke(1.0f) }, new Shape[] { new Rectangle2D.Double(1.0, 2.0, 3.0, 4.0) }));
    assertFalse(t1.equals(t2));
    t2.setDrawingSupplier(new DefaultDrawingSupplier(new Paint[] { Color.red }, new Paint[] { Color.blue }, new Stroke[] { new BasicStroke(1.0f) }, new Stroke[] { new BasicStroke(1.0f) }, new Shape[] { new Rectangle2D.Double(1.0, 2.0, 3.0, 4.0) }));
    assertTrue(t1.equals(t2));
    // plotBackgroundPaint;
    t1.setPlotBackgroundPaint(new GradientPaint(4f, 3f, Color.red, 6f, 7f, Color.blue));
    assertFalse(t1.equals(t2));
    t2.setPlotBackgroundPaint(new GradientPaint(4f, 3f, Color.red, 6f, 7f, Color.blue));
    assertTrue(t1.equals(t2));
    // plotOutlinePaint;
    t1.setPlotOutlinePaint(new GradientPaint(5f, 2f, Color.blue, 6f, 7f, Color.red));
    assertFalse(t1.equals(t2));
    t2.setPlotOutlinePaint(new GradientPaint(5f, 2f, Color.blue, 6f, 7f, Color.red));
    assertTrue(t1.equals(t2));
    // labelLinkStyle;
    t1.setLabelLinkStyle(PieLabelLinkStyle.STANDARD);
    assertFalse(t1.equals(t2));
    t2.setLabelLinkStyle(PieLabelLinkStyle.STANDARD);
    assertTrue(t1.equals(t2));
    // labelLinkPaint;
    t1.setLabelLinkPaint(new GradientPaint(4f, 3f, Color.red, 2f, 9f, Color.blue));
    assertFalse(t1.equals(t2));
    t2.setLabelLinkPaint(new GradientPaint(4f, 3f, Color.red, 2f, 9f, Color.blue));
    assertTrue(t1.equals(t2));
    // domainGridlinePaint;
    t1.setDomainGridlinePaint(Color.blue);
    assertFalse(t1.equals(t2));
    t2.setDomainGridlinePaint(Color.blue);
    assertTrue(t1.equals(t2));
    // rangeGridlinePaint;
    t1.setRangeGridlinePaint(Color.red);
    assertFalse(t1.equals(t2));
    t2.setRangeGridlinePaint(Color.red);
    assertTrue(t1.equals(t2));
    // axisOffset;
    t1.setAxisOffset(new RectangleInsets(1, 2, 3, 4));
    assertFalse(t1.equals(t2));
    t2.setAxisOffset(new RectangleInsets(1, 2, 3, 4));
    assertTrue(t1.equals(t2));
    // axisLabelPaint;
    t1.setAxisLabelPaint(new GradientPaint(8f, 4f, Color.gray, 2f, 9f, Color.blue));
    assertFalse(t1.equals(t2));
    t2.setAxisLabelPaint(new GradientPaint(8f, 4f, Color.gray, 2f, 9f, Color.blue));
    assertTrue(t1.equals(t2));
    // tickLabelPaint;
    t1.setTickLabelPaint(new GradientPaint(3f, 4f, Color.red, 5f, 6f, Color.yellow));
    assertFalse(t1.equals(t2));
    t2.setTickLabelPaint(new GradientPaint(3f, 4f, Color.red, 5f, 6f, Color.yellow));
    assertTrue(t1.equals(t2));
    // itemLabelPaint;
    t1.setItemLabelPaint(new GradientPaint(2f, 5f, Color.gray, 1f, 2f, Color.blue));
    assertFalse(t1.equals(t2));
    t2.setItemLabelPaint(new GradientPaint(2f, 5f, Color.gray, 1f, 2f, Color.blue));
    assertTrue(t1.equals(t2));
    // shadowVisible;
    t1.setShadowVisible(!t1.isShadowVisible());
    assertFalse(t1.equals(t2));
    t2.setShadowVisible(t1.isShadowVisible());
    assertTrue(t1.equals(t2));
    // shadowPaint;
    t1.setShadowPaint(new GradientPaint(7f, 1f, Color.blue, 4f, 6f, Color.red));
    assertFalse(t1.equals(t2));
    t2.setShadowPaint(new GradientPaint(7f, 1f, Color.blue, 4f, 6f, Color.red));
    assertTrue(t1.equals(t2));
    // barPainter;
    t1.setBarPainter(new StandardBarPainter());
    assertFalse(t1.equals(t2));
    t2.setBarPainter(new StandardBarPainter());
    assertTrue(t1.equals(t2));
    // xyBarPainter;
    t1.setXYBarPainter(new StandardXYBarPainter());
    assertFalse(t1.equals(t2));
    t2.setXYBarPainter(new StandardXYBarPainter());
    assertTrue(t1.equals(t2));
    // thermometerPaint;
    t1.setThermometerPaint(new GradientPaint(9f, 7f, Color.red, 5f, 1f, Color.blue));
    assertFalse(t1.equals(t2));
    t2.setThermometerPaint(new GradientPaint(9f, 7f, Color.red, 5f, 1f, Color.blue));
    assertTrue(t1.equals(t2));
    // wallPaint;
    t1.setWallPaint(new GradientPaint(4f, 5f, Color.red, 1f, 0f, Color.gray));
    assertFalse(t1.equals(t2));
    t2.setWallPaint(new GradientPaint(4f, 5f, Color.red, 1f, 0f, Color.gray));
    assertTrue(t1.equals(t2));
    // errorIndicatorPaint;
    t1.setErrorIndicatorPaint(new GradientPaint(0f, 1f, Color.white, 2f, 3f, Color.blue));
    assertFalse(t1.equals(t2));
    t2.setErrorIndicatorPaint(new GradientPaint(0f, 1f, Color.white, 2f, 3f, Color.blue));
    assertTrue(t1.equals(t2));
    // gridBandPaint
    t1.setGridBandPaint(new GradientPaint(1f, 2f, Color.white, 4f, 8f, Color.red));
    assertFalse(t1.equals(t2));
    t2.setGridBandPaint(new GradientPaint(1f, 2f, Color.white, 4f, 8f, Color.red));
    assertTrue(t1.equals(t2));
    // gridBandAlternatePaint
    t1.setGridBandAlternatePaint(new GradientPaint(1f, 4f, Color.green, 1f, 2f, Color.red));
    assertFalse(t1.equals(t2));
    t2.setGridBandAlternatePaint(new GradientPaint(1f, 4f, Color.green, 1f, 2f, Color.red));
    assertTrue(t1.equals(t2));
}
Also used : BasicStroke(java.awt.BasicStroke) Stroke(java.awt.Stroke) BasicStroke(java.awt.BasicStroke) Shape(java.awt.Shape) StandardBarPainter(org.jfree.chart.renderer.category.StandardBarPainter) GradientPaint(java.awt.GradientPaint) RectangleInsets(org.jfree.ui.RectangleInsets) Paint(java.awt.Paint) GradientPaint(java.awt.GradientPaint) StandardXYBarPainter(org.jfree.chart.renderer.xy.StandardXYBarPainter) Font(java.awt.Font) DefaultDrawingSupplier(org.jfree.chart.plot.DefaultDrawingSupplier) Test(org.junit.Test)

Aggregations

DefaultDrawingSupplier (org.jfree.chart.plot.DefaultDrawingSupplier)6 Paint (java.awt.Paint)5 BasicStroke (java.awt.BasicStroke)2 Color (java.awt.Color)2 Stroke (java.awt.Stroke)2 Font (java.awt.Font)1 GradientPaint (java.awt.GradientPaint)1 Shape (java.awt.Shape)1 ArrayList (java.util.ArrayList)1 Iterator (java.util.Iterator)1 List (java.util.List)1 CategoryAxis (org.jfree.chart.axis.CategoryAxis)1 DateAxis (org.jfree.chart.axis.DateAxis)1 NumberAxis (org.jfree.chart.axis.NumberAxis)1 NumberTickUnit (org.jfree.chart.axis.NumberTickUnit)1 ValueAxis (org.jfree.chart.axis.ValueAxis)1 StandardPieSectionLabelGenerator (org.jfree.chart.labels.StandardPieSectionLabelGenerator)1 CategoryPlot (org.jfree.chart.plot.CategoryPlot)1 DrawingSupplier (org.jfree.chart.plot.DrawingSupplier)1 MeterInterval (org.jfree.chart.plot.MeterInterval)1