Search in sources :

Example 1 with IntervalXYItemLabelGenerator

use of org.jfree.chart.labels.IntervalXYItemLabelGenerator in project SIMVA-SoS by SESoS.

the class YIntervalRendererTest method testEquals.

/**
 * Check that the equals() method distinguishes all fields.
 */
@Test
public void testEquals() {
    YIntervalRenderer r1 = new YIntervalRenderer();
    YIntervalRenderer r2 = new YIntervalRenderer();
    assertEquals(r1, r2);
    // the following fields are inherited from the AbstractXYItemRenderer
    r1.setItemLabelGenerator(new StandardXYItemLabelGenerator());
    assertFalse(r1.equals(r2));
    r2.setItemLabelGenerator(new StandardXYItemLabelGenerator());
    assertTrue(r1.equals(r2));
    r1.setSeriesItemLabelGenerator(0, new StandardXYItemLabelGenerator());
    assertFalse(r1.equals(r2));
    r2.setSeriesItemLabelGenerator(0, new StandardXYItemLabelGenerator());
    assertTrue(r1.equals(r2));
    r1.setBaseItemLabelGenerator(new StandardXYItemLabelGenerator());
    assertFalse(r1.equals(r2));
    r2.setBaseItemLabelGenerator(new StandardXYItemLabelGenerator());
    assertTrue(r1.equals(r2));
    r1.setToolTipGenerator(new StandardXYToolTipGenerator());
    assertFalse(r1.equals(r2));
    r2.setToolTipGenerator(new StandardXYToolTipGenerator());
    assertTrue(r1.equals(r2));
    r1.setSeriesToolTipGenerator(0, new StandardXYToolTipGenerator());
    assertFalse(r1.equals(r2));
    r2.setSeriesToolTipGenerator(0, new StandardXYToolTipGenerator());
    assertTrue(r1.equals(r2));
    r1.setBaseToolTipGenerator(new StandardXYToolTipGenerator());
    assertFalse(r1.equals(r2));
    r2.setBaseToolTipGenerator(new StandardXYToolTipGenerator());
    assertTrue(r1.equals(r2));
    r1.setURLGenerator(new StandardXYURLGenerator());
    assertFalse(r1.equals(r2));
    r2.setURLGenerator(new StandardXYURLGenerator());
    assertTrue(r1.equals(r2));
    r1.addAnnotation(new XYTextAnnotation("X", 1.0, 2.0), Layer.FOREGROUND);
    assertFalse(r1.equals(r2));
    r2.addAnnotation(new XYTextAnnotation("X", 1.0, 2.0), Layer.FOREGROUND);
    assertTrue(r1.equals(r2));
    r1.addAnnotation(new XYTextAnnotation("X", 1.0, 2.0), Layer.BACKGROUND);
    assertFalse(r1.equals(r2));
    r2.addAnnotation(new XYTextAnnotation("X", 1.0, 2.0), Layer.BACKGROUND);
    assertTrue(r1.equals(r2));
    r1.setDefaultEntityRadius(99);
    assertFalse(r1.equals(r2));
    r2.setDefaultEntityRadius(99);
    assertTrue(r1.equals(r2));
    r1.setLegendItemLabelGenerator(new StandardXYSeriesLabelGenerator("{0} {1}"));
    assertFalse(r1.equals(r2));
    r2.setLegendItemLabelGenerator(new StandardXYSeriesLabelGenerator("{0} {1}"));
    assertTrue(r1.equals(r2));
    r1.setLegendItemToolTipGenerator(new StandardXYSeriesLabelGenerator());
    assertFalse(r1.equals(r2));
    r2.setLegendItemToolTipGenerator(new StandardXYSeriesLabelGenerator());
    assertTrue(r1.equals(r2));
    r1.setLegendItemURLGenerator(new StandardXYSeriesLabelGenerator());
    assertFalse(r1.equals(r2));
    r2.setLegendItemURLGenerator(new StandardXYSeriesLabelGenerator());
    assertTrue(r1.equals(r2));
    r1.setAdditionalItemLabelGenerator(new IntervalXYItemLabelGenerator());
    assertFalse(r1.equals(r2));
    r2.setAdditionalItemLabelGenerator(new IntervalXYItemLabelGenerator());
    assertTrue(r1.equals(r2));
}
Also used : XYTextAnnotation(org.jfree.chart.annotations.XYTextAnnotation) StandardXYToolTipGenerator(org.jfree.chart.labels.StandardXYToolTipGenerator) StandardXYSeriesLabelGenerator(org.jfree.chart.labels.StandardXYSeriesLabelGenerator) StandardXYItemLabelGenerator(org.jfree.chart.labels.StandardXYItemLabelGenerator) StandardXYURLGenerator(org.jfree.chart.urls.StandardXYURLGenerator) IntervalXYItemLabelGenerator(org.jfree.chart.labels.IntervalXYItemLabelGenerator) Test(org.junit.Test)

Aggregations

XYTextAnnotation (org.jfree.chart.annotations.XYTextAnnotation)1 IntervalXYItemLabelGenerator (org.jfree.chart.labels.IntervalXYItemLabelGenerator)1 StandardXYItemLabelGenerator (org.jfree.chart.labels.StandardXYItemLabelGenerator)1 StandardXYSeriesLabelGenerator (org.jfree.chart.labels.StandardXYSeriesLabelGenerator)1 StandardXYToolTipGenerator (org.jfree.chart.labels.StandardXYToolTipGenerator)1 StandardXYURLGenerator (org.jfree.chart.urls.StandardXYURLGenerator)1 Test (org.junit.Test)1