xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andres <and...@onemileup.com>
Subject Re: SVG into Java Image
Date Fri, 25 Jun 2004 16:24:47 GMT
HI:

The way i do it is I assign an EXTRA attribute to the SVG element, 
which i call UID (unique ID) with a specific value identifying each 
element. So when the user clicks on a SVG Dynamic element on the 
canvas, you can get its ID, and thus you can identify the item.

Andres.



On Thursday, June 24, 2004, at 09:10  AM, Arek Stryjski wrote:

> Cytowanie Andres Toussaint <andres@onemileup.com>:
>
>>
>> My suggestion is to read the Java Graphics 2D information you need 
>> from
>> the GVT tree.
>> ...
>>                      // Walk through the tree to locate and extract 
>> the
>> ...
>
> Thank you for your help. Code you post work perfectly in situation I 
> describe
> last time (then user clicks on Canvas). Then I call:
>
> GVTTreeWalker tw = new GVTTreeWalker(e.getGVTRoot());
> GraphicsNode root = tw.firstChild();
> GraphicsNode node = root.nodeHitAt(point);
> ...
>
> But that in situation if I don't know position of elements on the 
> canvas. Is it
> possible to easy found SVG element with some id on GVTTree?
>
> Best regards
> Arek
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org
>
>



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


Mime
View raw message