I give another example in the hope of making my problem clear. :-)

This is the naive solution:

if (this.svgCanvas.getSVGDocument() != null){
   //do something with the SVGDocument
}else{
  this.svgCanvas.addSVGLoadEventDispatcherListener(new
SVGLoadEventDispatcherAdapter() {
    @Override
    public void
svgLoadEventDispatchStarted(SVGLoadEventDispatcherEvent e) {
        //do something with the SVGDocument
    }
  });
}


I checks whether the SVGDocument can be retrieved (that means: loading has
finished) and modifies it directly. Otherwise it sets up the
LoadEventDispatcherListener to get triggered when loading has finished and
then does the modifications.

The problem is: It is possible that the SVGDocument is null, but directly
after calling getSVGDocument() the loading finishes. Therefore the
svgLoadEventDispatcherEvent gets triggered _before_ I am able to set it
up.

And that is what I am trying to avoid. I need a way to _reliably_ get a
reference to the SVGDocument


Regards
Marco



---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org

Reply via email to