Java Code Examples for org.jfree.chart.ChartRenderingInfo#setChartArea()

The following examples show how to use org.jfree.chart.ChartRenderingInfo#setChartArea() . 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: 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 2
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); 
}