/**
* Tests the setter methods.
*/
public void testSetters() {
Node boxedShape = new MyBoxedShape();
MyShapeContainer parent = new MyShapeContainer();
parent.setOrigin(2.5, 2.5);
boxedShape.setParent(parent);
boxedShape.setOrigin(1.0, 3.3);
boxedShape.setSize(3.2, 4.1);
boxedShape.setMinimumSize(5.1, 6.3);
assertEquals(parent, boxedShape.getParent());
assertEquals(1.0, boxedShape.getOrigin().getX());
assertEquals(3.3, boxedShape.getOrigin().getY());
assertEquals(3.2, boxedShape.getSize().getWidth());
assertEquals(4.1, boxedShape.getSize().getHeight());
assertEquals(5.1, boxedShape.getMinimumSize().getWidth());
assertEquals(6.3, boxedShape.getMinimumSize().getHeight());
// Absolute position
assertEquals(boxedShape.getOrigin().getX() + parent.getAbsoluteX(),
boxedShape.getAbsoluteX());
assertEquals(boxedShape.getOrigin().getY() + parent.getAbsoluteY(),
boxedShape.getAbsoluteY());
boxedShape.setAbsolutePos(8.3, 9.5);
assertEquals(8.3, boxedShape.getAbsoluteX());
assertEquals(9.5, boxedShape.getAbsoluteY());
assertEquals(8.3 - parent.getAbsoluteX(), boxedShape.getOrigin().getX());
assertEquals(9.5 - parent.getAbsoluteY(), boxedShape.getOrigin().getY());
// mapped positions
assertTrue(Math.abs(0.3 - boxedShape.getMappedX(8.6)) < EPS);
assertTrue(Math.abs(1.0 - boxedShape.getMappedY(10.5)) < EPS);
}