The second example shows how you can access to the DOM tree when a URI has been used to display an SVG document.
final JSVGComponent svgComp = new JSVGComponent(); svgComp.loadSVGDocument("foo.svg"); svgComp.addSVGDocumentLoaderListener(new SVGDocumentLoaderAdapter() { public void documentLoadingCompleted(SVGDocumentLoaderEvent evt) { SVGDocument svgDoc = svgComp.getSVGDocument(); //... } });
Conformed to the single thread rule of swing, the listeners are executed in the swing thread. The sequence of the method calls for a particular listener and the order of the listeners themselves are guaranteed.
The JSVGComponent can pick up some informations to a user agent. The {@link SVGUserAgent} provides a way to control the resolution used to display an SVG document (controling the pixel to millimeter conversion factor), perform an operation in respond to a click on an hyperlink, control the default language to use, or specify a user stylesheet, or how to display errors when an error occured while building/rendering a document (invalid XML file, missing attributes...).
@author Stephane Hillion @version $Id: JSVGComponent.java,v 1.66 2003/03/14 21:53:19 nsochele Exp $
|
|
|
|
|
|