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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to