xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thierry Kormann <tkorm...@ilog.fr>
Subject Re: Mouse hit detectors
Date Thu, 25 Oct 2001 07:59:55 GMT
On Wednesday 24 October 2001 10:35, Micha? Piotrowski wrote:
> Thierry Kormann wrote:
>  >>How can I write own mouse hit detector for my extension without
>  >>rewriting org.apache.batik.gvt.ShapeNode?
>  >
>  > You have a setGraphicsNodeHitDetector method on GraphicsNode.
> Though this
>  > part of the API has not been really tested (we don't support the
>  > pointer-event property yet) - you should be able to do things by
> setting your
>  > own GraphicsNodeHitDetector implementation.
> Thanks. That works fine. But I still don't know how to set my hit
> detector only for one type of node (my extension). For now I'm using
> construction like this:
> GVTTreeWalker gvtwalker=new GVTTreeWalker(jsvgcanv.getGraphicsNode());
> GraphicsNode gnode;
> while ((gnode=gvtwalker.nextGraphicsNode())!=null) {
> 	gnode.setGraphicsNodeHitDetector(hit_detect);
> }
> This allows me to set my hit detector for all nodes. Is there a way to
> check what is GraphicsNode's source (is it my extension or standard
> SVG tag)?

To me, the better place where to add your own hit detector is the Bridge 
responsible on creating your GraphicsNode from your custom DOM Element. To 
take into account your own graphical element, you probably already have 
written your own Bridge class. In the createGraphicsNode method or the 
buildGraphicsNode method (it should work in both cases) - you can add your 
hit detector on the created graphics node.


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

View raw message