use of net.sf.latexdraw.parsers.svg.parsers.SVGPathParser in project latexdraw by arnobl.
the class TestSVGPathSegCurvetoQuadraticSmooth method testToString.
@Test
public void testToString() throws ParseException {
SVGPathSegMoveto m = new SVGPathSegMoveto(0d, 0d, false);
SVGPathParser parser = new SVGPathParser(m.toString() + " " + seg.toString(), pathSeg -> {
if (pathSeg instanceof SVGPathSegMoveto && cpt == 0) {
cpt++;
return;
}
assertTrue(pathSeg instanceof SVGPathSegCurvetoQuadraticSmooth);
SVGPathSegCurvetoQuadraticSmooth seg2 = (SVGPathSegCurvetoQuadraticSmooth) pathSeg;
assertEquals(seg.getX(), seg2.getX(), 0.0001);
assertEquals(seg.getY(), seg2.getY(), 0.0001);
assertEquals(seg.isRelative(), seg2.isRelative());
});
parser.parse();
}
use of net.sf.latexdraw.parsers.svg.parsers.SVGPathParser in project latexdraw by arnobl.
the class TestSVGPathSegLineto method testToString.
@Test
public void testToString() throws ParseException {
SVGPathSegMoveto m = new SVGPathSegMoveto(0d, 0d, false);
SVGPathParser parser = new SVGPathParser(m.toString() + " " + seg.toString(), pathSeg -> {
if (pathSeg instanceof SVGPathSegMoveto && cpt == 0) {
cpt++;
return;
}
assertTrue(pathSeg instanceof SVGPathSegLineto);
SVGPathSegLineto seg2 = (SVGPathSegLineto) pathSeg;
assertEquals(seg.getX(), seg2.getX(), 0.0001);
assertEquals(seg.getY(), seg2.getY(), 0.0001);
assertEquals(seg.isRelative(), seg2.isRelative());
});
parser.parse();
}
use of net.sf.latexdraw.parsers.svg.parsers.SVGPathParser in project latexdraw by arnobl.
the class TestSVGPathSegLinetoHorizontal method testToString.
@Test
public void testToString() throws ParseException {
SVGPathSegMoveto m = new SVGPathSegMoveto(0d, 0d, false);
SVGPathParser parser = new SVGPathParser(m.toString() + " " + seg.toString(), pathSeg -> {
if (pathSeg instanceof SVGPathSegMoveto && cpt == 0) {
cpt++;
return;
}
assertTrue(pathSeg instanceof SVGPathSegLinetoHorizontal);
SVGPathSegLinetoHorizontal seg2 = (SVGPathSegLinetoHorizontal) pathSeg;
assertEquals(seg.getX(), seg2.getX(), 0.0001);
assertEquals(seg.isRelative(), seg2.isRelative());
});
parser.parse();
}
use of net.sf.latexdraw.parsers.svg.parsers.SVGPathParser in project latexdraw by arnobl.
the class TestSVGPathSegLinetoVertical method testToString.
@Test
public void testToString() throws ParseException {
SVGPathSegMoveto m = new SVGPathSegMoveto(0d, 0d, false);
SVGPathParser parser = new SVGPathParser(m.toString() + " " + seg.toString(), pathSeg -> {
if (pathSeg instanceof SVGPathSegMoveto && cpt == 0) {
cpt++;
return;
}
assertTrue(pathSeg instanceof SVGPathSegLinetoVertical);
SVGPathSegLinetoVertical seg2 = (SVGPathSegLinetoVertical) pathSeg;
assertEquals(seg.getY(), seg2.getY(), 0.0001);
assertEquals(seg.isRelative(), seg2.isRelative());
});
parser.parse();
}
use of net.sf.latexdraw.parsers.svg.parsers.SVGPathParser in project latexdraw by arnobl.
the class TestSVGPathSegMoveto method testToString.
@Test
public void testToString() throws ParseException {
SVGPathParser parser = new SVGPathParser(seg.toString(), pathSeg -> {
assertTrue(pathSeg instanceof SVGPathSegMoveto);
SVGPathSegMoveto seg2 = (SVGPathSegMoveto) pathSeg;
assertEquals(seg.getX(), seg2.getX(), 0.0001);
assertEquals(seg.getY(), seg2.getY(), 0.0001);
assertEquals(seg.isRelative(), seg2.isRelative());
});
parser.parse();
}
Aggregations