Simon AM Cox wrote:
Hi,
I have a browser, losely based on the Squiggle example. I also have a tree which shows only 'g' elements in the SVG document and allows them to be removed from the tree, using either removeChild or replaceChild. On most documents this works fine, however on the 'mapSpain.svg' sample document the JVM seems to hang during either of these calls. I'm using batik 1.5beta, I've just upgraded and it seemed to work before with 1.1.1.
Since you don't mention it I assume you aren't calling removeChild/replaceChild from
the UpdateManager's runnable queue?
If not you are probably running into a threading issue. Search the archives for examples of how
to use the UpdateManager's runnable queue to make DOM modifications with Batik 1.5. As a
bonus the canvas will automatically update for you.
That was the first mistake I made, which stopped it working all of the time. However, I already fixed that and it works for most svg documents, just not mapSpain.svg. I did a little digging with a debugger and the thread seems to be sitting on an Object.wait() amongst some calls like getLanguage().
What I'm trying to get to eventually is allowing hte users to switch layers on/off, I guess if there's a more preffered way of doing this then I'd rather do that. Although, I'd rather do it from Java than use the scripting feature of SVG.
I've worked round the problem now by toggling the 'VISIBILITY' attribute between 'visible' and 'hidden', which seems to fit the job much better (and takes up much less code!).
Thanks
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
