use of net.sf.latexdraw.models.interfaces.shape.IBezierCurve in project latexdraw by arnobl.
the class TestParsingPSbezier method testSimpleBezierCurve.
@Test
public void testSimpleBezierCurve() {
parser("\\psbezier[linewidth=0.02](1.3918242,0.7584497)(2.0668242,0.95844966)(4.3168244,0.95844966)(4.991824,0.7584497)");
final IBezierCurve bc = getShapeAt(0);
assertEquals(bc.getPtAt(0).getY(), bc.getPtAt(1).getY(), 0.001);
assertEquals(bc.getFirstCtrlPtAt(0).getY(), bc.getFirstCtrlPtAt(1).getY(), 0.001);
assertFalse(bc.isFilled());
}
use of net.sf.latexdraw.models.interfaces.shape.IBezierCurve in project latexdraw by arnobl.
the class TestParsingPSbezier method testSimpleBezierCurveOpen.
@Test
public void testSimpleBezierCurveOpen() {
parser("\\psbezier[linecolor=black, linewidth=0.04](0.014142151,-1.4747834)(0.7212489,-2.1818902)(4.9070354,-1.3818903)(5.614142," + "-0.6747834777832031)(6.321249,0.032323305)(4.2040915,1.8666378)(3.214142,1.7252165)");
final IBezierCurve bc = getShapeAt(0);
assertTrue(bc.isOpened());
}
use of net.sf.latexdraw.models.interfaces.shape.IBezierCurve 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 IBezierCurve bc = getShapeAt(0);
assertEquals(ArrowStyle.BAR_IN, bc.getArrowStyle(0));
assertEquals(ArrowStyle.RIGHT_SQUARE_BRACKET, bc.getArrowStyle(1));
}
use of net.sf.latexdraw.models.interfaces.shape.IBezierCurve in project latexdraw by arnobl.
the class TestIBezierCurve method testCopy.
@Test
public void testCopy() {
final IBezierCurve 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.models.interfaces.shape.IBezierCurve in project latexdraw by arnobl.
the class TestShapeFactory method testCreateBezierCurveFromSameNewCtrlPoint.
@Test
public void testCreateBezierCurveFromSameNewCtrlPoint() {
IBezierCurve bc = ShapeFactory.INST.createBezierCurve(Collections.singletonList(ShapeFactory.INST.createPoint()));
bc = ShapeFactory.INST.createBezierCurveFrom(bc, ShapeFactory.INST.createPoint(1d, 2d));
assertEqualsDouble(1d, bc.getFirstCtrlPtAt(1).getX());
assertEqualsDouble(2d + IBezierCurve.DEFAULT_POSITION_CTRL, bc.getFirstCtrlPtAt(1).getY());
}
Aggregations