Hi,
when trying to access the DOM of an SVG document in a JSVGCanvas, it
should be done via an SVGLoadEventDispatcherListener, to assert that the
document is only accessed, when the parsing finished.
For example:
this.svgCanvas.addSVGLoadEventDispatcherListener(new
SVGLoadEventDispatcherAdapter() {
@Override
public void
svgLoadEventDispatchStarted(SVGLoadEventDispatcherEvent e) {
final Element element=
svgCanvas.getSVGDocument().getElementById(elementId);
element.setAttribute("visibility", "hidden");
}
}
});
But, of course, this handler is only called once, when the document was
loaded. But what, if I can't be sure whether the document was already
loaded, but still want to apply this code?
What is the recommended approach to modify the DOM, regardless of the
fact, whether the document finished loading or not?
Regards
Marco
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.