"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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]