Robert Casties wrote:

Thomas DeWeese wrote:

Should I rather start with the "root" field from SVGAbstractTranscoder after its transcode() method? It seems to do all the necessary preparations.

The problem is that the 'root' field is the GVT tree. The existing code walks the DOM tree, so unless you want to seriously rework your code you need to stick with that. What you will be

> doing is walking the DOM tree and then 'looking up' the associated > node in the GVT tree (under 'root').

I have no problem with reworking the code (it isn't mine anyway :-)

I actually think that walking the DOM tree is better (See below).


What would be the best way to walk the GVT tree and extract the outlines of the shapes? Can I still get to the "href" and "id" attributes? Do I have to do my own clipping with the AOI?

Well the container classes implement the collection apis so you can get an iterator to iterate over the children. You don't really get href and id from the GVT tree, but you can get the associated DOM node. One of the nice things you can do with DOM is getElementsByTagNameNS which can be used to get all the 'a' elements directly (internally it walks the tree but you don't have to), this is one of the reasons I would go with iterating over DOM instead of GVT (of course you would have to watch out for elements in defs etc).

As far as getting outlines you can use getOutline which returns
the concatenated 'shape' for a subtree but this doesn't include
stroke etc. The 'best' thing to use is the 'gvt.ShapeNode.getSensitiveArea()' as this respects stroke bounds and
pointer-events settings. This isn't exposed directly from the
GraphicsNode and doesn't work for subtree's like getOutline does (So
you would have to do work to build it up).


   Of course neither takes into account clipping (so implementing
getSensitiveArea may cost you almost nothing extra).

I will try it and see :-) Is there any in-depth documentation that describes the functional relations inside Batik and its rendering process?

Nothing in depth. The best you get is JavaDocs, the primary classes you will be intersted in are GraphicsNode, CompositeGraphicsNode, ShapeNode (perhaps ImageNode).






---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to