Robert Casties wrote:
First of all, thanks to the Batik people and Torsten Knodt for Batik in general and the experimental image map transcoder in special! I had already been wracking my mind about how to get HTML image maps out of Batik when I found Torstens patch in his mail from 2 September 2002. (http://koala.ilog.fr/batik/mlists/batik-dev/archives/msg03068.html)
I didn't even realize someone had gotten this far (wonder what I was doing in September of 2002? :).
You did answer Torsten on his first attempt on 15. August 2002 :-)
Yah, it looks like the basic approach would have significant problems doing this. The biggest issue is the 'piecemeal' building of the tree:
class PathGenerator: for (PathIterator path = builder.build (ctx,e).getOutline()[...]
If the code built the rendering tree all up front as if it were doing dynamic rendering and then walked the document (see what the other transcoders do when 'onload' events are active):
I'm sorry but I don't understand the Batik code sufficiently (yet ;-)
I compared the code of Torstens Transcoder with the ImageTranscoder class that uses an ImageRenderer. Should I rather implement a Renderer? The conrete Renderer classes all seem to use Raster and Graphics2D so I didn't try to start there.
Is the current construction OK otherwise?
Where would be the best place to hook into to get a tree, preferrably with only the visible elements and a transform to the global CS?
GraphicsNode gn = BridgeContext.getGraphicsNode(e); gn.getOutline();
You could then use gn.getGlobalTransform() to transform the outline to the global coordinate system instead of the local coordinate system.
Shape gShape = gn.getGlobalTransform().createTransformedShape(gn.getOutline());
Thanks Robert
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
