use of net.sf.latexdraw.models.interfaces.shape.IEllipse in project latexdraw by arnobl.
the class TestParsingPsellipse method testCoordinatesCm.
@Test
public void testCoordinatesCm() {
parser("\\psellipse(0,0)(35cm,20cm)");
IEllipse ell = getShapeAt(0);
assertEquals(-35d * IShape.PPC, ell.getPosition().getX(), 0.001);
assertEquals(-20d * IShape.PPC * -1d, ell.getPosition().getY(), 0.001);
assertEquals(35d * IShape.PPC * 2d, ell.getWidth(), 0.001);
assertEquals(20d * IShape.PPC * 2d, ell.getHeight(), 0.001);
}
use of net.sf.latexdraw.models.interfaces.shape.IEllipse in project latexdraw by arnobl.
the class TestParsingPsellipse method testParse2CoordinatesTwoFirstMissing.
@Test
public void testParse2CoordinatesTwoFirstMissing() {
parser("\\psellipse(,)(35,50)");
IEllipse ell = getShapeAt(0);
assertEquals(IShape.PPC - 35 * IShape.PPC, ell.getPosition().getX(), 0.001);
assertEquals(-IShape.PPC + 50d * IShape.PPC, ell.getPosition().getY(), 0.001);
assertEquals(35d * IShape.PPC * 2d, ell.getWidth(), 0.001);
assertEquals(50d * IShape.PPC * 2d, ell.getHeight(), 0.001);
}
use of net.sf.latexdraw.models.interfaces.shape.IEllipse in project latexdraw by arnobl.
the class TestIEllipse method testConstructors3OK.
@Test
public void testConstructors3OK() {
final IEllipse ell = ShapeFactory.INST.createEllipse(ShapeFactory.INST.createPoint(20, 26), ShapeFactory.INST.createPoint(30, 35));
assertEqualsDouble(20., ell.getPosition().getX());
assertEqualsDouble(35., ell.getPosition().getY());
assertEqualsDouble(10., ell.getWidth());
assertEqualsDouble(9., ell.getHeight());
}
use of net.sf.latexdraw.models.interfaces.shape.IEllipse in project latexdraw by arnobl.
the class TestIEllipse method testIsTypeOf.
@Test
public void testIsTypeOf() {
final IEllipse shape = ShapeFactory.INST.createEllipse();
assertFalse(shape.isTypeOf(null));
assertFalse(shape.isTypeOf(IRectangle.class));
assertFalse(shape.isTypeOf(ICircle.class));
assertTrue(shape.isTypeOf(IShape.class));
assertTrue(shape.isTypeOf(IPositionShape.class));
assertTrue(shape.isTypeOf(IRectangularShape.class));
assertTrue(shape.isTypeOf(IEllipse.class));
assertTrue(shape.isTypeOf(shape.getClass()));
}
use of net.sf.latexdraw.models.interfaces.shape.IEllipse in project latexdraw by arnobl.
the class TestIEllipse method testConstructors2.
@Test
public void testConstructors2() {
final IEllipse ell = ShapeFactory.INST.createEllipse();
assertEquals(4, ell.getNbPoints());
}
Aggregations