Hi Michael,
"Bishop, Michael W. CONTR J9C880" <[EMAIL PROTECTED]> wrote on
12/13/2006 09:37:17 AM:
> Much earlier on this mailing list, I asked how to do a multiple
> select on the JSVGCanvas. You draw a rectangle and every element
> that intersects the rectangle is selected. Using SVGDocument.
> getRootElement().getIntersectionList(?) works well, but I do have
> one bug I?m trying to solve.
>
> Imagine the case where you have a box that?s 20x20. On top of that
> box (Z order), you have another 10x10 box. If you drag the
> selection box inside the 10x10 box, the 20x20 box is also selected.
> In other words, the Z order is not taken into account. Using
> strictly X and Y, the selection box does intersect both boxes.
>
> The case below illustrates the problem; drawing a selection box in
> the blue box also selects the red box. Is there a way to avoid
> this? I don?t want the selection to automatically ?drill down?, I
> just want to grab what I see the selection box touch.
This is extremely difficult to do. To implement this you
would have to use the Java2D java.awt.geom.Area class and
test intersection with the current area, and then subtract the
objects returned from getIntersectionlist in reverse order
(top->bottom).
There is no standard interface in SVG to do this so you
would have to use the GVT to get the paths, transform them
to the screen, etc.
BTW I don't consider this a bug, I am unaware of any
UI that behaves this way. Almost all graphics apps I have
used select all objects that intersect a selection rectangle
not just those 'on top'.