Hi Marc,
You don't say how you are updating the SVGDOM, but I have a similar
problem using Document Fragments. My XML file was right and worked in
Opera browser but not in JSVGCanvas. The solution I came across was to
declare the svg name space in the document (i.e xmlns:svg ...)and
use it when creating the new elements (i.e svg:rect), so JSVGCanvas
will understand that the new elements were SVG elements and not any
other XML flavor.
Hope it will helps
Abraham
On Oct 24, 2007 7:00 PM, Marc-Wayne M. Formales <[EMAIL PROTECTED]> wrote:
>
> I'm fairly new to Swing/Batik/SVG so please bear with me.
>
> I have a JApplet that loads an SVG via JSVGCanvas.setDocument(xmlDoc). If
> a user clicks on a certain part of the document (any <a> tag), then I have
> some code that will animate that node and replace it in the document object.
> I am doing this in the update manager, which does run in the gvtRendering
> event, but the UI is not updated with the changes I made. I know that the
> DOM object is correct because if I write that to the file system, the
> changes are there. Is there something that I'm missing?
>
> Here is a snippet from the OnClickAction method:
>
>
> NodeList aLinks = diagramSVG.getElementsByTagName("a");
> for (int i . . . ) {
> final Node aLink = aLinks.item(i);
> .....
> Some code to find the element that was clicked on
> clone the element
> append an animate node to the element
> .....
> }
>
> UpdateManager um = BatikEWD.diaCanvas.getUpdateManager();
> um.getUpdateRunnableQueue().invokeLater(new Runnable() {
> public void run() {
> System.out.println("connID: " + connID);
> diagramSVG.getDocumentElement().replaceChild(animatedALink, aLink);
> //where animatedALink is the modified
> canvas.setDocument(diagramSVG);
> canvas.updateUI(); //I've tried repaint too but nothing seems to
> work
> panel.updateUI(); //I've tried repaint too but nothing seems to
> work
> }
> });
>
>
> Regards,
>
> Marc
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]