Hi Mahesh,
mahesh karanth wrote:
Thank you for the reply.
The 'SVGSVGElement.getIntersectionList' method takes
'SVGRect' as a parameter.
If I want to get the svg elements of some
'complex-region'(Say a free-hand drawn shape)
how can I do that?
I would suggest using the getIntersectionList method first
(with the bounding box of your complex shape) which should
reduce the number of elements you need to consider. Then
you will have to do the final intersection tests yourself.
You can use the BridgeContext methods I mentioned earlier
to get the GraphicsNode for each Element that intersected.
Then you can use the Java2D Area class to insersect the
geometry of the node with the complex shape. This tends to
be a slow processes.
Thanks and Regards
Mahesh Karanth
----------------------
Hi Mahesh,
mahesh.karanth wrote:
I need to implement the following using batik
librery.
I need to display some svg image on a frame and if
something
is selected by drawing a closed shape corresponding
xml-elements should
be taken.
Well the SVG DOM has methods to get the list of
elements that
intersect a rectangle
(SVGSVGElement.getIntersectionList). It
sounds like this is more or less what you want (I am
unsure if
you need to support intersection with a 'complex
shape'). In
any case you would want to use something like
getIntersectionList
to do an initial cull of the elements in the document.
I created JSVGCanvas object and override the
'paintComponent' method.So
that when ever something is drawn I captured mouse
event and called the
repaint method to draw some closed area on svg
image.
After this I am not getting how to get the
corresponding xml-elements of
selected enclosed region.
If you want to go from GVT (the drawing tree) to
DOM (the
SVG Document) you can use the BridgeContext methods:
GraphicsNode getGraphicsNode(Element)
Element getElement(GraphicsNode)
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]