/**
* Confirm that cloning works.
*/
public void testCloning() {
Rectangle2D legendShape = new Rectangle2D.Double(1.0, 2.0, 3.0, 4.0);
XYLineAndShapeRenderer r1 = new XYLineAndShapeRenderer();
r1.setLegendLine(legendShape);
XYLineAndShapeRenderer r2 = null;
try {
r2 = (XYLineAndShapeRenderer) r1.clone();
}
catch (CloneNotSupportedException e) {
e.printStackTrace();
}
assertTrue(r1 != r2);
assertTrue(r1.getClass() == r2.getClass());
assertTrue(r1.equals(r2));
r1.setSeriesLinesVisible(0, false);
assertFalse(r1.equals(r2));
r2.setSeriesLinesVisible(0, false);
assertTrue(r1.equals(r2));
legendShape.setRect(4.0, 3.0, 2.0, 1.0);
assertFalse(r1.equals(r2));
r2.setLegendLine(new Rectangle2D.Double(4.0, 3.0, 2.0, 1.0));
assertTrue(r1.equals(r2));
r1.setSeriesShapesVisible(1, true);
assertFalse(r1.equals(r2));
r2.setSeriesShapesVisible(1, true);
assertTrue(r1.equals(r2));
r1.setSeriesShapesFilled(1, true);
assertFalse(r1.equals(r2));
r2.setSeriesShapesFilled(1, true);
assertTrue(r1.equals(r2));
}