You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Janice Tan <ta...@gmail.com> on 2006/05/04 03:28:52 UTC

Multiple SVGDocument

hi,

was wondering if it is possible to create multiple SVGDocuments in a
SVGDocument.
am trying to create the same effect in a .svg file which normally does
<svg>
   <svg>
   </svg>
    <svg>
   </svg>
</svg>
 can i do something like this in JAVA?

i currently have done multiple SVGDocument each in its own JSVGCanvas. also,
it there any way that i can capture events on the bottom layer? even the
batik Zoom function only zooms in the top layer.

thanks!

Re: Multiple SVGDocument

Posted by André Ávila <as...@nextech.com.br>.
Hi Janice,
  i currently have done multiple SVGDocument each in its own JSVGCanvas. also, it there any way that i can capture events on the bottom layer? even the batik Zoom function only zooms in the top layer.

You would have to create a mechanism to propagate events from the top layer to the bottom layers. I have approached this two ways: 1) create a glass pane that will capture events and redirect them to the proper layer (or all of them) and 2) override setPaintingTransform() and setRenderingTransform() in the top canvas so that it calls the same methods in the bottom ones. Technique 2, which was suggeted by Thomas, is much simpler and will get you the behavior you want.

Hope this helps,

André