Thanks very much Thomas, I thought I'd already set the canvas to dynamic at
some point in my code but looking back apparently not, works perfectly
without the animateMotion element now.
Jon
thomas.deweese wrote:
>
> Hi Jon,
>
> poozle <[EMAIL PROTECTED]> wrote on 11/13/2007 03:50:35 AM:
>
>> And I have my program set up to add on event click listeners to each
>> individual group:
>>
>> for(int i = 0; i < Shape.shapes.size(); i++){
>> Element elt = Shape.doc.getElementById("shape" + i);
>> EventTarget t = (EventTarget)elt;
>> t.addEventListener("click", new OnClickAction(i), false);
>> }
>>
>> With this setup my code doesn't actually detect the clicks,
>
> This is most likely because Batik can't tell that this
> is supposed to be a dynamic document so it builds it as
> a static document (which saves some time and memory).
> This is easily fixed by calling:
>
> canvas.setDocumentState(ALWAYS_DYNAMIC);
>
> Before you associate the document with the canvas.
>
>> I have a work around where I add an animateMotion element attached
>> to the group (after path)
>
> The addition of the animateMotion element(s) let's Batik know
> that this is a dynamic document, so then your event listeners
> work correctly.
>
>
>
--
View this message in context:
http://www.nabble.com/On-Click-actions-tf4796512.html#a13724583
Sent from the Batik - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]