You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Dmitrij Sakara <dm...@epfl.ch> on 2004/10/19 15:40:33 UTC

Drag event, mouse events beyond elements, transformation of coordinates.

 

Thank you for the fast replay!

 

I am also preferring the second solution. Thank you for the idea about a
huge background element. But in this case I have some other things that
complicates my life. I would like to draw some special symbols (like
selection rectangles etc.) on the screen during the drag. It is very
nice and easy to add them temporary to the document, but in the case of
zoomed image, they looks really ugly (the width of lines is zoomed of
course). I need to protect these elements (at least stroke in the style
attribute) against zoom. I have no idea how to do this. In same time, I
can realize drawing of these symbols in the paintComponent method of the
JCanvas and in this situation the first solution may be a good option.

 

What is your opinion?
 
 

 

___________________________________________
 
Dmitrij SAKARA

STI IPR LICP
Swiss Federal Institute of Technology (EPFL)
Me - Ecublens
CH-1015 Lausanne
Switzerland
 
Tel. : +41 (0)21 / 693 5913
Fax. : +41 (0)21 / 693 3509

e-mail : dmitrij.sakara@epfl.ch

My office at EPFL: http://map.epfl.ch/?room=MEA1382
___________________________________________

 

Re: Drag event, mouse events beyond elements, transformation of coordinates.

Posted by Thomas DeWeese <Th...@Kodak.com>.
Dmitrij Sakara wrote:

> I am also preferring the second solution. Thank you for the idea about a 
> huge background element. But in this case I have some other things that 
> complicates my life. I would like to draw some special symbols (like 
> selection rectangles etc.) on the screen during the drag. It is very 
> nice and easy to add them temporary to the document, but in the case of 
> zoomed image, they looks really ugly (the width of lines is zoomed of 
> course). I need to protect these elements (at least stroke in the style 
> attribute) against zoom. I have no idea how to do this. 

     You can't protect the elements from zoom, you can 'counter' the
effect of zoom by putting the elements in a group and then put an
inverse transform on the group.  Some things from the SVG DOM like
getTransformToElement are very helpful here.

> In same time, I 
> can realize drawing of these symbols in the paintComponent method of the 
> JCanvas and in this situation the first solution may be a good option.

     Tonny makes a good point that for performance reasons there are
significant advantages to doing your drawing in paintComponent because
the SVG content will be repainted from an offscreen bitmap rather than
having to render the entire document under any modified area.


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


Re: Drag event, mouse events beyond elements, transformation of coordinates.

Posted by Tonny Kohar <to...@kiyut.com>.
Hi,

> I am also preferring the second solution. Thank you for the idea about
> a huge background element. But in this case I have some other things
> that complicates my life. I would like to draw some special symbols
> (like selection rectangles etc.) on the screen during the drag. It is
> very nice and easy to add them temporary to the document, but in the
> case of zoomed image, they looks really ugly (the width of lines is
> zoomed of course). I need to protect these elements (at least stroke
> in the style attribute) against zoom. I have no idea how to do this.
> In same time, I can realize drawing of these symbols in the
> paintComponent method of the JCanvas and in this situation the first
> solution may be a good option.

For performance reason, I think you need somekind of overlay when
draging and only need to update dom on mouseRelease (not mouseDrag).
That's what we do on our Sketsa SVG Graphics Editor. For the overlay you
could see the example on batik source.

Regards
Tonny Kohar
-- 
Sketsa 
SVG Graphics Editor
http://www.kiyut.com



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