I don't understand a behaviour of my batik canvas:

I put my batik canvas in a panel, that I put in a frame.
I have 2 modes. the frame is visible or not (because it is a server which can display locally or remotely. In this last case, I don't want to draw the frame)

at the beginning of the process (ie after the treebuild complete) I want to append a child to a node of the document.

If I have a local frame (setVisible(true)), I do this and it works fine: the element


        canvas.getUpdateManager().getUpdateRunnableQueue().invokeLater(new Runnable() {

public void run() {

mask.setAttribute("style", "display:none");



but when I put if I run the program with frame.setVisible(false), and I dump the document, I do not have the style attribute set.

So, why the setVisible influences the behavior?

Then, I decided to do this:

        canvas.getUpdateManager().getUpdateRunnableQueue().invokeLater(new Runnable() {

public void run() {





In this case, the element is not appended. I dump the document doing this several seconds after the call is performed

StringWriter stringWriter = new StringWriter();

org.apache.batik.dom.util.DOMUtilities.writeDocument(canvas.getSVGDocument(), stringWriter);



return stringWriter.toString();

Dao Hodac