xmlgraphics-batik-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas DeWeese <Thomas.DeWe...@Kodak.com>
Subject Re: Drawing on JSVGCanvas
Date Sun, 12 Sep 2004 14:03:14 GMT
Hi Dmitrij,

Dmitrij Sakara wrote:

> I am developing a simple SVG based graph editor. To do this I use 
> JSVGCanvas and some DOM document. I need to draw the grid in the 
> background of graph. How can I do this? 

> I suppose that it is not good to add all grid-related lines to the 
> DOM document. 

    This might not be soo bad.  There will be a bit more overhead,
especially if you do all the grid lines.  Some system where you
manage the grid lines that are part of the document would help keep
the overhead down.  The real problem with not doing it this
way is that you will have to take care to match the rendering as the
user zooms and pans (and perhaps rotates) the view.

> I am tried to overwrite paint method of JSVGCanvas, but founded 
> that it doesn’t work. Can some body help me?

    We implement our drawing in 'paintComponent' in the
batik.swing.gvt.JGVTComponent.  In particular we fill our visable
region with the background color which is usually opaque white - hence
your grid doesn't show.  You have sort of two options.

    1) override paintComponent yourself and do all the stuff the
baseclass does but insert drawing your grid before the SVG content.

    2) set the background color to fully transparent (opacity=0) and
then you can draw the 'real' background and your grid and just call
super.paintComponent.

    Good luck!



---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-dev-help@xml.apache.org


Mime
View raw message