xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From George Armhold <armh...@cs.rutgers.edu>
Subject Re: SVGGraphics2D.getRoot() truncates SVG document?
Date Mon, 17 Sep 2001 15:37:47 GMT

Vincent Hardy wrote:

> George Armhold wrote:
> >
> > I'm trying to manipulate the DOM generated by an SVGGraphics2D in order
> > to add some javascript.  I find that if I call SVGGraphics.getRoot(), it
> > wipes out any existing tags in the DOM.  The example below will
> > demonstrate this.
> Right, this is the expected behavior of the SVGGraphics2D. If you'd like
> an example of how to use it for what you are trying to do, you can
> have a look at the org.apache.batik.svggen.SwingPrettyPrint class which
> does manipulate the DOM generated by SVGGraphics2D.
> You can also have a look at the DOMTreeManager and the DOMGroupManager
> for more explanations on how the DOM is managed in SVGGraphics2D.

Actually I'm already trying to follow the model in SwingPrettyPrint
but I'm still baffled (an annotated version of that code would be
really helpful to us mere mortals.) I can't figure out how to get
access to either the <svg> or <defs> tag in the document so I can
append a <script> tag containing some javascript common to the entire
document.  Following the example in SwingPrettyPrint I can get access
to the <g> nodes, but I can't seem to get above that in the document
structure without mangling it.  


George Armhold
Rutgers University
Bioinformatics Initiative

To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org

View raw message