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 19:44:21 GMT
"Evenblij, Paul" wrote:

>   SVGGraphics2D svgGenerator = new SVGGraphics2D(ctx, false);
>   DOMTreeManager treeManager = svgGenerator.getDOMTreeManager();
> 
>   // create the <defs> element containing our scripts
>   Element scriptDefs = createScriptDefs(document);
>   // give it to the tree manager
>   treeManager.appendGroup(scriptDefs, null);
> 
> As far as I can tell, the treeManager takes care of z-order administration
> when more than one SVGGraphics2D instance are adding to the same tree. It
> will append your group to the topLevelGroup and tell all domGroupManagers
> (every SVGGraphics2D instance has one) that a new group will be started. I
> don't know of any other way to add to the top level (short of hacking your
> own way in the Batik code, that is;)


I just tried your suggestion.  It seems to create a new <defs> tag that
gets appended to the uppermost <g> tag.  This isn't exactly what I had
in mind (I wanted access to the uppermost <defs> tag) but it seems to
work ok for my needs.  This allows me to insert a piece of javascript
once per document rather than inserting it redundantly into each new <g>
tag.

Thanks for your help.


--
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


Mime
View raw message