Thomas DeWeese wrote:
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.
No!
Essentially you want to do everything in batik.transcoder.SVGAbstractTranscoder.transcode method (you may want to subclass from it) The important thing is that 'isDynamic' must be true otherwise the 'getGraphicsNode' call will fail (you may not want to run onload scripts!)
Is the current construction OK otherwise?
It isn't what I would do, but it looks like it should basically work :)
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]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]