Search in sources :

Example 16 with SVGPathSegMoveto

use of net.sf.latexdraw.parser.svg.path.SVGPathSegMoveto in project latexdraw by arnobl.

the class TestSVGPathSegCurvetoCubicSmooth method testToString.

@Test
public void testToString() {
    final AtomicBoolean done = new AtomicBoolean(false);
    final SVGPathSegMoveto m = new SVGPathSegMoveto(0d, 0d, false);
    SVGParserUtils.INSTANCE.parseSVGPath(m.toString() + " " + seg.toString(), pathSeg -> {
        if (pathSeg instanceof SVGPathSegMoveto) {
            return;
        }
        done.set(true);
        final SVGPathSegCurvetoCubicSmooth seg2 = (SVGPathSegCurvetoCubicSmooth) pathSeg;
        assertEquals(seg.getX(), seg2.getX(), 0.0001);
        assertEquals(seg.getY(), seg2.getY(), 0.0001);
        assertEquals(seg.isRelative(), seg2.isRelative());
    });
    assertTrue(done.get());
}
Also used : AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) SVGPathSegCurvetoCubicSmooth(net.sf.latexdraw.parser.svg.path.SVGPathSegCurvetoCubicSmooth) SVGPathSegMoveto(net.sf.latexdraw.parser.svg.path.SVGPathSegMoveto) Test(org.junit.jupiter.api.Test)

Example 17 with SVGPathSegMoveto

use of net.sf.latexdraw.parser.svg.path.SVGPathSegMoveto in project latexdraw by arnobl.

the class TestSVGPathSegLinetoHorizontal method testToString.

@Test
void testToString() {
    final AtomicBoolean done = new AtomicBoolean(false);
    final SVGPathSegMoveto m = new SVGPathSegMoveto(0d, 0d, false);
    SVGParserUtils.INSTANCE.parseSVGPath(m.toString() + " " + seg.toString(), pathSeg -> {
        if (pathSeg instanceof SVGPathSegMoveto) {
            return;
        }
        done.set(true);
        final SVGPathSegLinetoHorizontal seg2 = (SVGPathSegLinetoHorizontal) pathSeg;
        assertEquals(seg.getX(), seg2.getX(), 0.0001);
        assertEquals(seg.isRelative(), seg2.isRelative());
    });
    assertTrue(done.get());
}
Also used : AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) SVGPathSegMoveto(net.sf.latexdraw.parser.svg.path.SVGPathSegMoveto) SVGPathSegLinetoHorizontal(net.sf.latexdraw.parser.svg.path.SVGPathSegLinetoHorizontal) Test(org.junit.jupiter.api.Test)

Example 18 with SVGPathSegMoveto

use of net.sf.latexdraw.parser.svg.path.SVGPathSegMoveto in project latexdraw by arnobl.

the class TestSVGPathSegLineto method testToString.

@Test
void testToString() {
    final AtomicBoolean done = new AtomicBoolean(false);
    final SVGPathSegMoveto m = new SVGPathSegMoveto(0d, 0d, false);
    SVGParserUtils.INSTANCE.parseSVGPath(m.toString() + " " + seg.toString(), pathSeg -> {
        if (pathSeg instanceof SVGPathSegMoveto) {
            return;
        }
        done.set(true);
        final SVGPathSegLineto seg2 = (SVGPathSegLineto) pathSeg;
        assertEquals(seg.getX(), seg2.getX(), 0.0001);
        assertEquals(seg.getY(), seg2.getY(), 0.0001);
        assertEquals(seg.isRelative(), seg2.isRelative());
    });
    assertTrue(done.get());
}
Also used : AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) SVGPathSegMoveto(net.sf.latexdraw.parser.svg.path.SVGPathSegMoveto) SVGPathSegLineto(net.sf.latexdraw.parser.svg.path.SVGPathSegLineto) Test(org.junit.jupiter.api.Test)

Aggregations

SVGPathSegMoveto (net.sf.latexdraw.parser.svg.path.SVGPathSegMoveto)18 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)9 Test (org.junit.jupiter.api.Test)9 SVGPathSegList (net.sf.latexdraw.parser.svg.path.SVGPathSegList)7 SVGPathSegClosePath (net.sf.latexdraw.parser.svg.path.SVGPathSegClosePath)5 SVGPathSegLineto (net.sf.latexdraw.parser.svg.path.SVGPathSegLineto)4 Point (net.sf.latexdraw.model.api.shape.Point)3 SVGPathSegArc (net.sf.latexdraw.parser.svg.path.SVGPathSegArc)3 SVGPathSegCurvetoCubic (net.sf.latexdraw.parser.svg.path.SVGPathSegCurvetoCubic)3 SVGPathElement (net.sf.latexdraw.parser.svg.SVGPathElement)2 SVGPathSegCurvetoCubicSmooth (net.sf.latexdraw.parser.svg.path.SVGPathSegCurvetoCubicSmooth)2 Point2D (java.awt.geom.Point2D)1 ArrayList (java.util.ArrayList)1 NoBadaboomCheck (net.sf.latexdraw.NoBadaboomCheck)1 ArcStyle (net.sf.latexdraw.model.api.shape.ArcStyle)1 BezierCurve (net.sf.latexdraw.model.api.shape.BezierCurve)1 SVGDefsElement (net.sf.latexdraw.parser.svg.SVGDefsElement)1 SVGElement (net.sf.latexdraw.parser.svg.SVGElement)1 SVGGElement (net.sf.latexdraw.parser.svg.SVGGElement)1 CtrlPointsSeg (net.sf.latexdraw.parser.svg.path.CtrlPointsSeg)1