initDialog.setSize(ds);
initDialog.setVisible(true);
final JSVGViewerFrame v = new JSVGViewerFrame(this);
JSVGCanvas c = v.getJSVGCanvas();
c.addSVGDocumentLoaderListener(new SVGDocumentLoaderAdapter() {
public void documentLoadingStarted(SVGDocumentLoaderEvent e) {
pb.setValue(1);
}
public void documentLoadingCompleted(SVGDocumentLoaderEvent e) {
pb.setValue(2);
}
});
c.addGVTTreeBuilderListener(new GVTTreeBuilderAdapter() {
public void gvtBuildCompleted(GVTTreeBuilderEvent e) {
pb.setValue(3);
}
});
c.addGVTTreeRendererListener(new GVTTreeRendererAdapter() {
public void gvtRenderingCompleted(GVTTreeRendererEvent e) {
initDialog.dispose();
v.dispose();
System.gc();
run();
}
});
c.setSize(100, 100);
svgInitializationURI = Main.class.getResource(SVG_INITIALIZATION).toString();
c.loadSVGDocument(svgInitializationURI);
}