Tonny Kohar wrote:
Hi,

Some error in batik especially during runtime are not reported through
Throw clause that we can catch using try..catch block, because some part
of batik catch this error first and instead of re throw, it is pass the
exception to the userAgent.displayError(Exception). So in your
userAgent/inherited user agent, try to print the stack trace of the
exception in method userAgent.displayError(Exception). The default
userAgent.displayError() is just empty method.

I just added print statements to displayError, didn't get anything. I am using a modified default JSVGCanvas implementation, this one had the displayError methods set to display a popup.



Secondly, how do you import the new created node. Are you using the batik SVG Implementation Document import? Ignoring the performance issues first (batik import is fast enough) try to use the Batik SVG Document import to make sure that the created node is using Batik class, because I saw some place in Batik code that cast some node into its own class eg: (SVGOMDocument)doc. This cast could throw exception if the node is not batik class.

What do you mean by importing? You mean physically node.importNode()? I am not doing this, i create a node from the main SVGDocument and then append my nodes to it with the correct namespace. Do you remember where it casts the nodes into it's own implementation ?


I did however try this yesterday by replacing

oldlayer.getParentNode().replaceChild(newlayer,oldlayer);

with

oldlayer.getParentNode().replaceChild(getSVGDocument().importNode(newlayer, true),oldlayer);


Does that cover your concern?

Thanks for your help
Jorg



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to