xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Grant Mc Auley" <gmcau...@som.llu.edu>
Subject Waiting for RenderingCompleted
Date Tue, 09 Sep 2003 22:55:29 GMT
I need to ensure that the UpdateManager and all SVG element are not null
and available before an Applet's init() method returns in the code
below.  In other words, I need to delay init() from returning until
gvtRendingCompleted() is called.

Does anybody have any suggestions on how I might accomplish this?  I
have tried many approaches but to no avail.  I am unclear about the
relationship between the GVTTreeBuilder thread and the main thread.  Any
help with this would be much appreciated as I am facing a deadline.


//----------------------------------------------------------------

init() {

  File f = new File("file.svg");
  canvas = new JSVGCanvas();
  canvas.addGVTTreeRendererListener(new GVTTreeRendererAdapter() {

    public void gvtRenderingCompleted(GVTTreeRendererEvent e) {

      um = canvas.getUpdateManager();
      element = doc.getElementByID("name");
	  . . .

    }

  });
  canvas.setDocumentState(JSVGCanvas.ALWAYS_DYNAMIC);
  String parser = XMLResourceDescriptor.getXMLParserClassName();
  SAXSVGDocumentFactory factory = new SAXSVGDocumentFactory(parser);
  doc = factory.createDocument(f.toURL().toString());
  canvas.setDocument(doc);

  // delay goes here

}

//----------------------------------------------------------------



---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Mime
View raw message