use of net.sf.latexdraw.model.api.shape.Polyline in project latexdraw by arnobl.
the class TestPolyline method testIsTypeOf.
@Test
public void testIsTypeOf() {
final Polyline shape = ShapeFactory.INST.createPolyline(Collections.emptyList());
assertFalse(shape.isTypeOf(Rectangle.class));
assertFalse(shape.isTypeOf(Circle.class));
assertTrue(shape.isTypeOf(Shape.class));
assertTrue(shape.isTypeOf(ModifiablePointsShape.class));
assertTrue(shape.isTypeOf(Polygon.class));
assertTrue(shape.isTypeOf(Polyline.class));
assertTrue(shape.isTypeOf(shape.getClass()));
}
use of net.sf.latexdraw.model.api.shape.Polyline in project latexdraw by arnobl.
the class TestParsingQline method testNoDbleBord.
@Test
public void testNoDbleBord() {
parser("\\psset{doubleline=true}\\qline(35cm,20cm)(11.12cm,-2cm)");
final Polyline line = getShapeAt(0);
assertFalse(line.hasDbleBord());
}
use of net.sf.latexdraw.model.api.shape.Polyline in project latexdraw by arnobl.
the class TestParsingQline method testNoShadow.
@Test
public void testNoShadow() {
parser("\\psset{shadow=true}\\qline(35cm,20cm)(11.12cm,-2cm)");
final Polyline line = getShapeAt(0);
assertFalse(line.hasShadow());
}
use of net.sf.latexdraw.model.api.shape.Polyline in project latexdraw by arnobl.
the class TestParsingQline method testCoordinatesCm.
@Test
public void testCoordinatesCm() {
parser("\\qline(35cm,20cm)(11.12cm,-2cm)");
final Polyline line = getShapeAt(0);
assertEquals(2, line.getNbPoints());
assertEquals(35d * Shape.PPC, line.getPtAt(0).getX(), 0.001);
assertEquals(20d * Shape.PPC * -1d, line.getPtAt(0).getY(), 0.001);
assertEquals(11.12 * Shape.PPC, line.getPtAt(1).getX(), 0.001);
assertEquals(-2d * Shape.PPC * -1d, line.getPtAt(1).getY(), 0.001);
}
use of net.sf.latexdraw.model.api.shape.Polyline in project latexdraw by arnobl.
the class TestParsingPsline method testFloatSigns.
@Test
public void testFloatSigns() {
parser("\\psline(+++35.5,--50.5)(--+12, -1)");
final Polyline line = (Polyline) parsedShapes.get(0);
assertEquals(35.5 * Shape.PPC, line.getPtAt(0).getX(), 0.0001);
assertEquals(-50.5 * Shape.PPC, line.getPtAt(0).getY(), 0.0001);
assertEquals(12d * Shape.PPC, line.getPtAt(1).getX(), 0.0001);
assertEquals(1d * Shape.PPC, line.getPtAt(1).getY(), 0.0001);
}
Aggregations