xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steiner, Dominik" <Dominik.Stei...@gigatronik.com>
Subject EventListener on Polygon?
Date Tue, 16 Aug 2005 07:38:44 GMT
Hi,

 

why does my PolygonElement not receive any MouseEvents?

 

1) First I create the Element using the SVGGenerator (this works fine,
the element, in my case a GeneralPath, gets displayed)

    svgGenerator.draw(s);

 

2) Second I get the PolygonElement from the generated <g>-Tree (I wonder
if there is a better solution and how I can tell the SVGGenerator not to
create the additional <g>-Tags?)

    Node root =
svgGenerator.getRoot().getLastChild().getLastChild().getLastChild();

 

3) Third I add the EventListener which should print out the message when
I click on the polygon, but this doesn't work??

    ((EventTarget)root).addEventListener("click",new EventListener(){

 

      public void handleEvent(Event arg0) {

        System.out.println("clickeeeeeeeeeeeeeeeeed");

      }

      

    }, false);

 

 

Any ideas?? Thanks in advance for any suggestion.

 

Dominik


Mime
View raw message