use of net.sf.latexdraw.model.api.shape.BezierCurve in project latexdraw by arnobl.
the class TestParsingPSbezier method testParamBarInSqureBracket.
@Test
public void testParamBarInSqureBracket() {
parser("\\psbezier{|-]}(1,2)(3,4)(5,6)(7,8)");
final BezierCurve bc = getShapeAt(0);
assertEquals(ArrowStyle.BAR_IN, bc.getArrowStyle(0));
assertEquals(ArrowStyle.RIGHT_SQUARE_BRACKET, bc.getArrowStyle(1));
}
use of net.sf.latexdraw.model.api.shape.BezierCurve in project latexdraw by arnobl.
the class TestParsingPSbezier method testParse6Coordinates.
@Test
public void testParse6Coordinates() {
parser("\\psbezier(1,2)(3,4)(5,6)(7,8)(9,10)(11,12)");
final BezierCurve bc = getShapeAt(0);
assertEquals(3, bc.getNbPoints());
assertEquals(0d, bc.getPtAt(0).getX(), 0.0001);
assertEquals(0d, bc.getPtAt(0).getY(), 0.0001);
assertEquals(5d * Shape.PPC, bc.getPtAt(1).getX(), 0.0001);
assertEquals(-6d * Shape.PPC, bc.getPtAt(1).getY(), 0.0001);
assertEquals(11d * Shape.PPC, bc.getPtAt(2).getX(), 0.0001);
assertEquals(-12d * Shape.PPC, bc.getPtAt(2).getY(), 0.0001);
assertEquals(-1d * Shape.PPC, bc.getSecondCtrlPtAt(0).getX(), 0.0001);
assertEquals(2d * Shape.PPC, bc.getSecondCtrlPtAt(0).getY(), 0.0001);
assertEquals(7d * Shape.PPC, bc.getSecondCtrlPtAt(1).getX(), 0.0001);
assertEquals(-8d * Shape.PPC, bc.getSecondCtrlPtAt(1).getY(), 0.0001);
assertEquals(3d * Shape.PPC, bc.getFirstCtrlPtAt(1).getX(), 0.0001);
assertEquals(-4d * Shape.PPC, bc.getFirstCtrlPtAt(1).getY(), 0.0001);
assertEquals(9d * Shape.PPC, bc.getFirstCtrlPtAt(2).getX(), 0.0001);
assertEquals(-10d * Shape.PPC, bc.getFirstCtrlPtAt(2).getY(), 0.0001);
}
use of net.sf.latexdraw.model.api.shape.BezierCurve in project latexdraw by arnobl.
the class TestParsingPSbezier method testShowPoints.
@Test
public void testShowPoints() {
parser("\\psbezier[showpoints=true](5,10)(1,2)(3,4)(5,6)");
final BezierCurve bc = getShapeAt(0);
assertTrue(bc.isShowPts());
}
use of net.sf.latexdraw.model.api.shape.BezierCurve in project latexdraw by arnobl.
the class TestBezierCurve method testCopy.
@Test
public void testCopy() {
final BezierCurve sh2 = ShapeFactory.INST.createBezierCurve(Collections.emptyList());
shape.setOpened(sh2.isOpened());
sh2.setOpened(!sh2.isOpened());
shape.copy(sh2);
assertEquals(shape.isOpened(), sh2.isOpened());
}
use of net.sf.latexdraw.model.api.shape.BezierCurve in project latexdraw by arnobl.
the class TestBezierCurve method testDuplicate.
@Test
public void testDuplicate() {
shape.setOpened(!shape.isOpened());
final BezierCurve dup = shape.duplicate();
assertEquals(shape.isOpened(), dup.isOpened());
}
Aggregations