xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From poozle <jd...@bath.ac.uk>
Subject On Click actions
Date Tue, 13 Nov 2007 08:50:35 GMT

Hi

I currently have an SVGDocument set up as follows:

<GROUP id = x> (x is a number)
    <RECT>
    <TEXT>
        <TSPAN>
        <TSPAN>
        ...
    <TEXT>
        <TSPAN>
        ...
    ...
    <PATH>
</GROUP>

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, I have a work
around where I add an animateMotion element attached to the group (after
path) and then it picks up the click and ignores the animateMotion set on it
(which is what I want) to do the on click event.

I was wondering if there is a more elegant solution to this or if the way I
am currently doing it is the best I can hope for.

Jon Bradford
-- 
View this message in context: http://www.nabble.com/On-Click-actions-tf4796512.html#a13721981
Sent from the Batik - Users mailing list archive at Nabble.com.


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


Mime
View raw message