use of net.sf.latexdraw.models.interfaces.shape.IPolyline in project latexdraw by arnobl.
the class TestParsingPsline method testCoordinatesFloat2.
@Test
public void testCoordinatesFloat2() {
parser("\\psline(35.5,50.5)(12, 1)");
final IPolyline line = (IPolyline) listener.getShapes().get(0);
assertEquals(35.5 * IShape.PPC, line.getPtAt(0).getX(), 0.0001);
assertEquals(-50.5 * IShape.PPC, line.getPtAt(0).getY(), 0.0001);
assertEquals(12d * IShape.PPC, line.getPtAt(1).getX(), 0.0001);
assertEquals(-1d * IShape.PPC, line.getPtAt(1).getY(), 0.0001);
}
use of net.sf.latexdraw.models.interfaces.shape.IPolyline in project latexdraw by arnobl.
the class TestParsingPsline method testBugTwoSameArrows.
@Test
public void testBugTwoSameArrows() {
parser("\\psline{<-<}(-0.1,-0.2)(2,5)");
final IPolyline sh = (IPolyline) listener.getShapes().get(0);
assertEquals(ArrowStyle.LEFT_ARROW, sh.getArrowAt(0).getArrowStyle());
assertEquals(ArrowStyle.LEFT_ARROW, sh.getArrowAt(1).getArrowStyle());
assertNotEquals(sh.getArrowAt(0), sh.getArrowAt(1));
}
use of net.sf.latexdraw.models.interfaces.shape.IPolyline in project latexdraw by arnobl.
the class TestParsingPsline method testCoordinatesPt.
@Test
public void testCoordinatesPt() {
parser("\\psline(35pt,20pt)(10pt,5pt)");
final IPolyline line = (IPolyline) listener.getShapes().get(0);
assertEquals(2, line.getNbPoints());
assertEquals(35d * IShape.PPC / PSTricksConstants.CM_VAL_PT, line.getPtAt(0).getX(), 0.0001);
assertEquals(-20d * IShape.PPC / PSTricksConstants.CM_VAL_PT, line.getPtAt(0).getY(), 0.0001);
assertEquals(10d * IShape.PPC / PSTricksConstants.CM_VAL_PT, line.getPtAt(1).getX(), 0.0001);
assertEquals(-5d * IShape.PPC / PSTricksConstants.CM_VAL_PT, line.getPtAt(1).getY(), 0.0001);
}
use of net.sf.latexdraw.models.interfaces.shape.IPolyline 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 IPolyline line = getShapeAt(0);
assertFalse(line.hasDbleBord());
}
use of net.sf.latexdraw.models.interfaces.shape.IPolyline in project latexdraw by arnobl.
the class TestIPolyline method testIsTypeOf.
@Test
public void testIsTypeOf() {
final IPolyline shape = ShapeFactory.INST.createPolyline(Collections.emptyList());
assertFalse(shape.isTypeOf(null));
assertFalse(shape.isTypeOf(IRectangle.class));
assertFalse(shape.isTypeOf(ICircle.class));
assertTrue(shape.isTypeOf(IShape.class));
assertTrue(shape.isTypeOf(IModifiablePointsShape.class));
assertTrue(shape.isTypeOf(IPolygon.class));
assertTrue(shape.isTypeOf(IPolyline.class));
assertTrue(shape.isTypeOf(shape.getClass()));
}
Aggregations