Java Code Examples for org.jfree.chart.entity.StandardEntityCollection#add()

The following examples show how to use org.jfree.chart.entity.StandardEntityCollection#add() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ChartRenderingInfoTest.java    From openstock with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Confirm that the equals method can distinguish all the required fields.
 */
@Test
public void testEquals() {
    ChartRenderingInfo i1 = new ChartRenderingInfo();
    ChartRenderingInfo i2 = new ChartRenderingInfo();
    assertEquals(i1, i2);

    i1.setChartArea(new Rectangle2D.Double(1.0, 2.0, 3.0, 4.0));
    assertFalse(i1.equals(i2));
    i2.setChartArea(new Rectangle2D.Double(1.0, 2.0, 3.0, 4.0));
    assertEquals(i1, i2);

    i1.getPlotInfo().setDataArea(new Rectangle(1, 2, 3, 4));
    assertFalse(i1.equals(i2));
    i2.getPlotInfo().setDataArea(new Rectangle(1, 2, 3, 4));
    assertEquals(i1, i2);

    StandardEntityCollection e1 = new StandardEntityCollection();
    e1.add(new ChartEntity(new Rectangle(1, 2, 3, 4)));
    i1.setEntityCollection(e1);
    assertFalse(i1.equals(i2));
    StandardEntityCollection e2 = new StandardEntityCollection();
    e2.add(new ChartEntity(new Rectangle(1, 2, 3, 4)));
    i2.setEntityCollection(e2);
}
 
Example 2
Source File: ChartRenderingInfoTest.java    From ccu-historian with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Confirm that the equals method can distinguish all the required fields.
 */
@Test
public void testEquals() {
    ChartRenderingInfo i1 = new ChartRenderingInfo();
    ChartRenderingInfo i2 = new ChartRenderingInfo();
    assertEquals(i1, i2);

    i1.setChartArea(new Rectangle2D.Double(1.0, 2.0, 3.0, 4.0));
    assertFalse(i1.equals(i2));
    i2.setChartArea(new Rectangle2D.Double(1.0, 2.0, 3.0, 4.0));
    assertEquals(i1, i2);

    i1.getPlotInfo().setDataArea(new Rectangle(1, 2, 3, 4));
    assertFalse(i1.equals(i2));
    i2.getPlotInfo().setDataArea(new Rectangle(1, 2, 3, 4));
    assertEquals(i1, i2);

    StandardEntityCollection e1 = new StandardEntityCollection();
    e1.add(new ChartEntity(new Rectangle(1, 2, 3, 4)));
    i1.setEntityCollection(e1);
    assertFalse(i1.equals(i2));
    StandardEntityCollection e2 = new StandardEntityCollection();
    e2.add(new ChartEntity(new Rectangle(1, 2, 3, 4)));
    i2.setEntityCollection(e2);
}
 
Example 3
Source File: ChartRenderingInfoTest.java    From SIMVA-SoS with Apache License 2.0 6 votes vote down vote up
/**
 * Confirm that the equals method can distinguish all the required fields.
 */
@Test
public void testEquals() {
    ChartRenderingInfo i1 = new ChartRenderingInfo();
    ChartRenderingInfo i2 = new ChartRenderingInfo();
    assertEquals(i1, i2);

    i1.setChartArea(new Rectangle2D.Double(1.0, 2.0, 3.0, 4.0));
    assertFalse(i1.equals(i2));
    i2.setChartArea(new Rectangle2D.Double(1.0, 2.0, 3.0, 4.0));
    assertEquals(i1, i2);

    i1.getPlotInfo().setDataArea(new Rectangle(1, 2, 3, 4));
    assertFalse(i1.equals(i2));
    i2.getPlotInfo().setDataArea(new Rectangle(1, 2, 3, 4));
    assertEquals(i1, i2);

    StandardEntityCollection e1 = new StandardEntityCollection();
    e1.add(new ChartEntity(new Rectangle(1, 2, 3, 4)));
    i1.setEntityCollection(e1);
    assertFalse(i1.equals(i2));
    StandardEntityCollection e2 = new StandardEntityCollection();
    e2.add(new ChartEntity(new Rectangle(1, 2, 3, 4)));
    i2.setEntityCollection(e2);
}
 
Example 4
Source File: ChartRenderingInfoTest.java    From ECG-Viewer with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Confirm that the equals method can distinguish all the required fields.
 */
@Test
public void testEquals() {
    ChartRenderingInfo i1 = new ChartRenderingInfo();
    ChartRenderingInfo i2 = new ChartRenderingInfo();
    assertEquals(i1, i2);

    i1.setChartArea(new Rectangle2D.Double(1.0, 2.0, 3.0, 4.0));
    assertFalse(i1.equals(i2));
    i2.setChartArea(new Rectangle2D.Double(1.0, 2.0, 3.0, 4.0));
    assertEquals(i1, i2);

    i1.getPlotInfo().setDataArea(new Rectangle(1, 2, 3, 4));
    assertFalse(i1.equals(i2));
    i2.getPlotInfo().setDataArea(new Rectangle(1, 2, 3, 4));
    assertEquals(i1, i2);

    StandardEntityCollection e1 = new StandardEntityCollection();
    e1.add(new ChartEntity(new Rectangle(1, 2, 3, 4)));
    i1.setEntityCollection(e1);
    assertFalse(i1.equals(i2));
    StandardEntityCollection e2 = new StandardEntityCollection();
    e2.add(new ChartEntity(new Rectangle(1, 2, 3, 4)));
    i2.setEntityCollection(e2);
}
 
Example 5
Source File: StandardEntityCollectionTests.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Confirm that the equals method can distinguish all the required fields.
 */
public void testEquals() {
    StandardEntityCollection c1 = new StandardEntityCollection();
    StandardEntityCollection c2 = new StandardEntityCollection();
    assertTrue(c1.equals(c2));

    PieSectionEntity e1 = new PieSectionEntity(new Rectangle2D.Double(1.0,
            2.0, 3.0, 4.0), new DefaultPieDataset(), 0, 1, "Key",
            "ToolTip", "URL");
    c1.add(e1);
    assertFalse(c1.equals(c2));
    PieSectionEntity e2 = new PieSectionEntity(new Rectangle2D.Double(1.0,
            2.0, 3.0, 4.0), new DefaultPieDataset(), 0, 1, "Key",
            "ToolTip", "URL");
    c2.add(e2);
    assertTrue(c1.equals(c2));
}
 
Example 6
Source File: ChartRenderingInfoTests.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Confirm that the equals method can distinguish all the required fields.
 */
public void testEquals() {
    ChartRenderingInfo i1 = new ChartRenderingInfo();
    ChartRenderingInfo i2 = new ChartRenderingInfo();
    assertTrue(i1.equals(i2));

    i1.setChartArea(new Rectangle2D.Double(1.0, 2.0, 3.0, 4.0));
    assertFalse(i1.equals(i2));
    i2.setChartArea(new Rectangle2D.Double(1.0, 2.0, 3.0, 4.0));
    assertTrue(i1.equals(i2));

    i1.getPlotInfo().setDataArea(new Rectangle(1, 2, 3, 4));
    assertFalse(i1.equals(i2));
    i2.getPlotInfo().setDataArea(new Rectangle(1, 2, 3, 4));
    assertTrue(i1.equals(i2));

    StandardEntityCollection e1 = new StandardEntityCollection();
    e1.add(new ChartEntity(new Rectangle(1, 2, 3, 4)));
    i1.setEntityCollection(e1);
    assertFalse(i1.equals(i2));
    StandardEntityCollection e2 = new StandardEntityCollection();
    e2.add(new ChartEntity(new Rectangle(1, 2, 3, 4)));
    i2.setEntityCollection(e2);
}
 
Example 7
Source File: StandardEntityCollectionTests.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Confirm that the equals method can distinguish all the required fields.
 */
public void testEquals() {
    StandardEntityCollection c1 = new StandardEntityCollection();
    StandardEntityCollection c2 = new StandardEntityCollection();
    assertTrue(c1.equals(c2));
    
    PieSectionEntity e1 = new PieSectionEntity(new Rectangle2D.Double(1.0, 
            2.0, 3.0, 4.0), new DefaultPieDataset(), 0, 1, "Key", 
            "ToolTip", "URL");
    c1.add(e1);
    assertFalse(c1.equals(c2));
    PieSectionEntity e2 = new PieSectionEntity(new Rectangle2D.Double(1.0, 
            2.0, 3.0, 4.0), new DefaultPieDataset(), 0, 1, "Key", 
            "ToolTip", "URL");
    c2.add(e2);
    assertTrue(c1.equals(c2));        
}
 
Example 8
Source File: ChartRenderingInfoTests.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Confirm that the equals method can distinguish all the required fields.
 */
public void testEquals() {
    ChartRenderingInfo i1 = new ChartRenderingInfo();
    ChartRenderingInfo i2 = new ChartRenderingInfo();
    assertTrue(i1.equals(i2));
    
    i1.setChartArea(new Rectangle2D.Double(1.0, 2.0, 3.0, 4.0));
    assertFalse(i1.equals(i2));
    i2.setChartArea(new Rectangle2D.Double(1.0, 2.0, 3.0, 4.0));
    assertTrue(i1.equals(i2));
    
    i1.getPlotInfo().setDataArea(new Rectangle(1, 2, 3, 4));
    assertFalse(i1.equals(i2));
    i2.getPlotInfo().setDataArea(new Rectangle(1, 2, 3, 4));
    assertTrue(i1.equals(i2));
    
    StandardEntityCollection e1 = new StandardEntityCollection();
    e1.add(new ChartEntity(new Rectangle(1, 2, 3, 4)));
    i1.setEntityCollection(e1);
    assertFalse(i1.equals(i2));
    StandardEntityCollection e2 = new StandardEntityCollection();
    e2.add(new ChartEntity(new Rectangle(1, 2, 3, 4)));
    i2.setEntityCollection(e2); 
}
 
Example 9
Source File: ChartRenderingInfoTest.java    From buffer_bci with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Confirm that the equals method can distinguish all the required fields.
 */
@Test
public void testEquals() {
    ChartRenderingInfo i1 = new ChartRenderingInfo();
    ChartRenderingInfo i2 = new ChartRenderingInfo();
    assertEquals(i1, i2);

    i1.setChartArea(new Rectangle2D.Double(1.0, 2.0, 3.0, 4.0));
    assertFalse(i1.equals(i2));
    i2.setChartArea(new Rectangle2D.Double(1.0, 2.0, 3.0, 4.0));
    assertEquals(i1, i2);

    i1.getPlotInfo().setDataArea(new Rectangle(1, 2, 3, 4));
    assertFalse(i1.equals(i2));
    i2.getPlotInfo().setDataArea(new Rectangle(1, 2, 3, 4));
    assertEquals(i1, i2);

    StandardEntityCollection e1 = new StandardEntityCollection();
    e1.add(new ChartEntity(new Rectangle(1, 2, 3, 4)));
    i1.setEntityCollection(e1);
    assertFalse(i1.equals(i2));
    StandardEntityCollection e2 = new StandardEntityCollection();
    e2.add(new ChartEntity(new Rectangle(1, 2, 3, 4)));
    i2.setEntityCollection(e2);
}