I don't think you need to override the paint() method in your class,
public void gvtBuildCompleted(GVTTreeBuilderEvent e) { gvtTreeWalker = new GVTTreeWalker(svgCanvas.getGraphicsNode()); gvtTreeWalker.getRoot().paint(this.g); }
instead, change the last line to:
gvtTreeWalker.getRoot().paint(this.getGraphics());
to get access to this components Graphics object.
Thanks, that worked! :D I now have this code which draws on a Graphics2D I can export with FreeHEP:
public void gvtBuildCompleted(GVTTreeBuilderEvent e) { gvtTreeWalker = new GVTTreeWalker(svgCanvas.getGraphicsNode()); svgCanvas.getSVGDocumentSize()); super.repaint(); }
public void paint(Graphics g) { this.g = (Graphics2D) g; if (gvtTreeWalker != null) { gvtTreeWalker.getRoot().paint((Graphics2D) this.g); } }
The reason I have to override the paint() method is to get hold of the Graphics variable passed to the paint() method. I use that in calls to FreeHEP to be able to export... unless of course you have a more elegant solution :)
There now seems to be only one problem remaining. Batik uses its own custom gradients, but FreeHEP only supports the standard GradientPaint and TexturePaint. Is there any way batik can be forced to use these kinds of gradients instead of user defined paints?
Glenn Thomas Hvidsten
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]