assertEquals(300, r.getHeight());
}
@Test
public void testGroupComplex() {
final Shape s = new Location(50, 100,
new Group(
new Circle(20),
new Rectangle(100, 200),
new Location(150, 50,
new Stroke(Color.RED,
new Filled(
new Group(
new Rectangle(50, 30),
new Outline(new Rectangle(300, 60)),
new Stroke(Color.CYAN,
new Polygon(
new DefaultPoint(50, 50),
new DefaultPoint(60, 100),
new DefaultPoint(100, 110),
new DefaultPoint(120, 60)
)
),
new Location(100, 200,
new Stroke(Color.ORANGE,
new Outline(new Circle(50))
)
)
)
)
)
)
)
);
shapes.common.Location b = s.accept(v);
shapes.common.Rectangle r = (shapes.common.Rectangle) b.getChild();
assertEquals(30, b.getX());
assertEquals(80, b.getY());
assertEquals(470, r.getWidth());
assertEquals(320, r.getHeight());