use of net.sf.latexdraw.models.interfaces.shape.IPolyline in project latexdraw by arnobl.
the class TestParsingPsline method testCoordinatesCm.
@Test
public void testCoordinatesCm() {
parser("\\psline(35cm,20cm)(1.2cm,2cm)");
final IPolyline line = (IPolyline) listener.getShapes().get(0);
assertEquals(35d * IShape.PPC, line.getPtAt(0).getX(), 0.0001);
assertEquals(-20d * IShape.PPC, line.getPtAt(0).getY(), 0.0001);
assertEquals(1.2 * IShape.PPC, line.getPtAt(1).getX(), 0.0001);
assertEquals(-2d * IShape.PPC, line.getPtAt(1).getY(), 0.0001);
}
use of net.sf.latexdraw.models.interfaces.shape.IPolyline in project latexdraw by arnobl.
the class TestParsingQline method testCoordinatesCm.
@Test
public void testCoordinatesCm() {
parser("\\qline(35cm,20cm)(11.12cm,-2cm)");
final IPolyline line = getShapeAt(0);
assertEquals(2, line.getNbPoints());
assertEquals(35d * IShape.PPC, line.getPtAt(0).getX(), 0.001);
assertEquals(20d * IShape.PPC * -1d, line.getPtAt(0).getY(), 0.001);
assertEquals(11.12 * IShape.PPC, line.getPtAt(1).getX(), 0.001);
assertEquals(-2d * IShape.PPC * -1d, line.getPtAt(1).getY(), 0.001);
}
use of net.sf.latexdraw.models.interfaces.shape.IPolyline in project latexdraw by arnobl.
the class TestParsingQline method testMustNotBeFilled.
@Test
public void testMustNotBeFilled() {
parser("\\qline(35cm,20cm)(11.12cm,-2cm)");
final IPolyline line = getShapeAt(0);
assertEquals(FillingStyle.NONE, line.getFillingStyle());
}
use of net.sf.latexdraw.models.interfaces.shape.IPolyline 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 IPolyline line = getShapeAt(0);
assertFalse(line.hasShadow());
}
use of net.sf.latexdraw.models.interfaces.shape.IPolyline in project latexdraw by arnobl.
the class TestIPolyline method testConstructor.
@Test
public void testConstructor() {
final IPoint pt1 = ShapeFactory.INST.createPoint(1, 1);
final IPoint pt2 = ShapeFactory.INST.createPoint(2, 2);
final IPolyline pol = ShapeFactory.INST.createPolyline(Arrays.asList(pt1, pt2));
assertEquals(pt1, pol.getPtAt(0));
assertEquals(pt2, pol.getPtAt(-1));
}
Aggregations