OK, that's what I thought. I'm having some trouble with that. How would I wait for that tree to render? This is what I have (condensed): // This variable is set to true when the "rendering complete" event fires. boolean treeRendered = false; jsvgCanvas.setDocument(svgDocument); this.waitForGVTTree(); // Returns when the GVT "rendering complete" method is fired or after 5000ms.
public boolean waitForGVTTree() {
final long startTime = System.currentTimeMillis();
final long waitTime = 5000;
long currentTime = System.currentTimeMillis();
long timeElapsed = currentTime - startTime;
try {
while (!treeRendered && (timeElapsed < waitTime)) {
Thread.sleep(250);
Thread.yield();
currentTime = System.currentTimeMillis();
timeElapsed = currentTime - startTime;
treeRendered = // Check to see if the "rendering complete" event
has been fired.
}
} catch (InterruptedException intEx) {
intEx.printStackTrace();
}
return returnValue;
}
What currently happens is that I experience the 5 second timeout, THEN the
"rendering complete" method fires. I'm not sure why this is blocking the
entire time. Essentially what I want to do is associate every call to
JSVGCanvas.setDocument(...) with a pause to wait for the tree to finish
rendering before moving on to process other events. As it stands, every call
to JSVGCanvas.setDocument(...) is followed by a 5 second pause, then
notification of the "rendering complete" method.
Michael Bishop
________________________________
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Tue 11/21/2006 7:07 AM
To: [email protected]
Cc: [email protected]
Subject: Re: GVT Tree Rendering
Hi Michael,
"Bishop, Michael W. CONTR J9C880" <[EMAIL PROTECTED]> wrote on
11/20/2006 02:18:44 PM:
> In what cases do I need to stop and wait for the GVT Tree to
render? The
> first time I initialize the canvas? Every time I switch documents on
the
> canvas?
Everytime you load a document, the current UpdateManager is disposed
of
and the new UpdateManager is not available until after the first
rendering.
The UpdateManager is tied to the document not the Canvas.
> Resizing the canvas? Can anyone tell me when I need to reset and
> recheck this value? I get errors in my application about a null
UpdateManager
> when refreshing documents and switching pages.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<<winmail.dat>>
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
