xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tonny Kohar <to...@kiyut.com>
Subject Re: "Drag" selection box...how to?
Date Tue, 07 Feb 2006 01:22:16 GMT

On Fri, 2006-02-03 at 12:41 -0500, Bishop, Michael W. CONTR J9C880
>      I’ve worked with listeners to drag and drop elements around a
> JSVGCanvas.  This method works primarily by registering which elements
> receive the mouse up/down events.  What I want to do is implement a
> selection “box” where you drag a box around a number of elements and
> it will select all the elements that fall within that box.  I need
> some way to translate screen coordinates to document coordinates which
> is a known problem.  What I don’t know how to do is ask the document
> “Which elements fall inside this box?”

We have similar problem for our Sketsa SVG Graphics Editor.
We solve the problem by
1) Traverse or Iterate the DOM tree
2) compare each element bbox with the selection box

The draw back of this methods, is that the bigger the dom tree, the
longer it will take to traverse/iterate the whole DOM tree

Tonny Kohar
SVG Graphics Editor

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

View raw message