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.