Hello!
When trying to add an id attribute to elements just created using
SVGGraphics2D, all elements get deleted. This is caused by the method
getRoot() which calls getRoot(null). But why?
Here is my code:
Node elem = svgGenerator.getRoot();
while (elem.getLastChild() != null) {
elem = elem.getLastChild();
}
Element lastElement = (Element)elem;
lastElement.setAttribute("id", "1");
This example comes from here:
http://www.nabble.com/SVGGraphics2D-and-id-td4325094.html
My initial intention was to add links to my SVG elements. So this
approach seems to be the best and only. After providing ids I could add
links easily. If one has got another approach, I would appreciate it
very much!
Sincerely yours,
Sebastian