use of net.sf.latexdraw.models.interfaces.shape.IRectangle in project latexdraw by arnobl.
the class TestParsingPsframe method testCoordinatesCm.
@Test
public void testCoordinatesCm() {
parser("\\psframe(0,0)(35cm,20cm)");
final IRectangle rec = getShapeAt(0);
assertEquals(0d, rec.getPosition().getX(), 0.001);
assertEquals(0d, rec.getPosition().getY(), 0.001);
assertEquals(35d * IShape.PPC, rec.getWidth(), 0.001);
assertEquals(20d * IShape.PPC, rec.getHeight(), 0.001);
}
use of net.sf.latexdraw.models.interfaces.shape.IRectangle in project latexdraw by arnobl.
the class TestIRectangle method testIsTypeOf.
@Test
public void testIsTypeOf() {
final IRectangle shape = ShapeFactory.INST.createRectangle();
assertFalse(shape.isTypeOf(null));
assertFalse(shape.isTypeOf(IEllipse.class));
assertFalse(shape.isTypeOf(ICircle.class));
assertTrue(shape.isTypeOf(IShape.class));
assertTrue(shape.isTypeOf(ILineArcProp.class));
assertTrue(shape.isTypeOf(IPositionShape.class));
assertTrue(shape.isTypeOf(IRectangularShape.class));
assertTrue(shape.isTypeOf(IRectangle.class));
assertTrue(shape.isTypeOf(shape.getClass()));
}
use of net.sf.latexdraw.models.interfaces.shape.IRectangle in project latexdraw by arnobl.
the class TestIRectangle method testConstructorsOK1.
@Test
public void testConstructorsOK1() {
IRectangle rec = ShapeFactory.INST.createRectangle(ShapeFactory.INST.createPoint(20, 26), ShapeFactory.INST.createPoint(30, 35));
assertEqualsDouble(20., rec.getPosition().getX());
assertEqualsDouble(35., rec.getPosition().getY());
assertEqualsDouble(10., rec.getWidth());
assertEqualsDouble(9., rec.getHeight());
}
use of net.sf.latexdraw.models.interfaces.shape.IRectangle in project latexdraw by arnobl.
the class TestIPlot method testCopyFromOther.
@Test
public void testCopyFromOther() {
IRectangle rec = ShapeFactory.INST.createRectangle();
rec.setFillingCol(DviPsColors.BLUE);
shape.copy(rec);
assertEquals(DviPsColors.BLUE, shape.getFillingCol());
}
Aggregations