use of net.sf.latexdraw.models.interfaces.shape.IRhombus in project latexdraw by arnobl.
the class TestParsingPsdiamond method testCoordinatesCm.
@Test
public void testCoordinatesCm() {
parser("\\psdiamond(0,0)(35cm,20cm)");
IRhombus rh = getShapeAt(0);
assertEquals(-35d * IShape.PPC, rh.getPosition().getX(), 0.001);
assertEquals(-20d * IShape.PPC * -1d, rh.getPosition().getY(), 0.001);
assertEquals(35d * IShape.PPC * 2d, rh.getWidth(), 0.001);
assertEquals(20d * IShape.PPC * 2d, rh.getHeight(), 0.001);
}
use of net.sf.latexdraw.models.interfaces.shape.IRhombus in project latexdraw by arnobl.
the class TestParsingPsdiamond method testParse2CoordinatesFloatSigns2.
@Test
public void testParse2CoordinatesFloatSigns2() {
parser("\\psdiamond(-+.5,+-5)(+++35.5,--50.5)");
IRhombus rh = getShapeAt(0);
assertEquals(-.5 * IShape.PPC - 35.5 * IShape.PPC, rh.getPosition().getX(), 0.001);
assertEquals(-5d * -IShape.PPC + 50.5 * IShape.PPC, rh.getPosition().getY(), 0.001);
assertEquals(35.5 * IShape.PPC * 2d, rh.getWidth(), 0.001);
assertEquals(50.5 * IShape.PPC * 2d, rh.getHeight(), 0.001);
}
use of net.sf.latexdraw.models.interfaces.shape.IRhombus in project latexdraw by arnobl.
the class TestIRhombus method testConstructor1.
@Test
public void testConstructor1() {
final IRhombus shape = ShapeFactory.INST.createRhombus();
assertEqualsDouble(1d, shape.getWidth());
assertEqualsDouble(1d, shape.getHeight());
assertEqualsDouble(0d, shape.getPosition().getX());
assertEqualsDouble(0d, shape.getPosition().getY());
}
use of net.sf.latexdraw.models.interfaces.shape.IRhombus in project latexdraw by arnobl.
the class TestIRhombus method testIsTypeOf.
@Test
public void testIsTypeOf() {
final IRhombus shape = ShapeFactory.INST.createRhombus();
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(IRhombus.class));
assertTrue(shape.isTypeOf(shape.getClass()));
}
Aggregations