use of net.sf.latexdraw.parsers.svg.SVGDocument in project latexdraw by arnobl.
the class TestSVGDocument method testSVGDocument2.
@Test
public void testSVGDocument2() {
SVGDocument doc = new SVGDocument();
assertNotNull(doc.getFirstChild());
assertNotNull(doc.getLastChild());
assertNull(doc.getDocumentURI());
}
use of net.sf.latexdraw.parsers.svg.SVGDocument in project latexdraw by arnobl.
the class TestSVGDocument method testSVGDocument.
@Test
public void testSVGDocument() throws MalformedSVGDocument, URISyntaxException, IOException {
SVGDocument doc = new SVGDocument(new URI("src/test/resources/test.svg"));
assertNotNull(doc.getFirstChild());
assertNotNull(doc.getLastChild());
}
use of net.sf.latexdraw.parsers.svg.SVGDocument in project latexdraw by arnobl.
the class TestSVGDocument method testIsEqualNode.
@Test
public void testIsEqualNode() {
SVGDocument doc = new SVGDocument();
assertTrue(doc1.isEqualNode(doc));
assertFalse(doc1.isEqualNode(null));
assertFalse(doc1.isEqualNode(doc2));
}
use of net.sf.latexdraw.parsers.svg.SVGDocument in project latexdraw by arnobl.
the class TestSVGNodeList method setUp.
@Before
public void setUp() {
doc = new SVGDocument();
list = new SVGNodeList();
}
use of net.sf.latexdraw.parsers.svg.SVGDocument in project latexdraw by arnobl.
the class SVGDot method toSVG.
@Override
public SVGElement toSVG(final SVGDocument doc) {
if (doc == null) {
return null;
}
final SVGElement root = new SVGGElement(doc);
root.setAttribute(LNamespace.LATEXDRAW_NAMESPACE + ':' + LNamespace.XML_TYPE, LNamespace.XML_TYPE_DOT);
root.setAttribute(SVGAttributes.SVG_ID, getSVGID());
root.setAttribute(LNamespace.LATEXDRAW_NAMESPACE + ':' + LNamespace.XML_SIZE, String.valueOf(shape.getDiametre()));
root.setAttribute(LNamespace.LATEXDRAW_NAMESPACE + ':' + LNamespace.XML_DOT_SHAPE, shape.getDotStyle().getPSTToken());
root.setAttribute(LNamespace.LATEXDRAW_NAMESPACE + ':' + LNamespace.XML_POSITION, shape.getPosition().getX() + " " + shape.getPosition().getY());
ViewFactory.INSTANCE.createView(shape).ifPresent(vdot -> JFXToSVG.INSTANCE.shapesToElements(vdot.getChildren(), doc).forEach(elt -> root.appendChild(elt)));
setSVGRotationAttribute(root);
return root;
}
Aggregations