You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Archie Cobbs <ar...@dellroad.org> on 2006/04/28 23:17:39 UTC
Trouble with EventListeners
This is with Batik 1.6...
I was having trouble getting an EventListener registered on
a node in the DOM to receive any mouse events. The node was
a <g> node, and events would be generated by some of the
contained nodes but not others.
So I wrote a small test case (attached), but now I can't
get ANY events to be emitted!
Maybe I'm doing something stupid? Or is this a real bug?
In the attached test case, clicking on the black square should
cause something to be printed to System.out, but nothing happens.
Any help appreciated...
Thanks,
-Archie
__________________________________________________________________________
Archie Cobbs * CTO, Awarix * http://www.awarix.com
Re: Trouble with EventListeners
Posted by Archie Cobbs <ar...@dellroad.org>.
thomas.deweese@kodak.com wrote:
> The problem is the use in the second 'group' (walls.1). Since this is
> drawn over the
> 'theNode' it recieves the pointer-events. If you don't want this to be
> sensitive to pointer-events
> you can set: 'pointer-events="none"' on that group.
Ah, of course.. I didn't realize that I was drawing the same thing twice.
Looks very obvious now that you've pointed it out.
Adding pointer-events="none" on the second drawing works great.
Thanks!
-Archie
__________________________________________________________________________
Archie Cobbs * CTO, Awarix * http://www.awarix.com
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
Re: Trouble with EventListeners
Posted by th...@kodak.com.
Hi Archie,
The problem is the use in the second 'group' (walls.1). Since this is
drawn over the
'theNode' it recieves the pointer-events. If you don't want this to be
sensitive to pointer-events
you can set: 'pointer-events="none"' on that group.
Archie Cobbs <ar...@dellroad.org> wrote on 04/29/2006 01:48:03 PM:
> thomas.deweese@kodak.com wrote:
> > Archie Cobbs <ar...@dellroad.org> wrote on 04/28/2006 05:17:39 PM:
> >> So I wrote a small test case (attached), but now I can't
> >> get ANY events to be emitted!
> >
> > canvas = new JSVGCanvas(null, false, false);
> >
> > The second argument is called 'eventsEnabled'
> > you passed false so _all_ events are disabled in the canvas...
>
> D'OH! Sorry for the stupidity.
>
> But this is great because now I can include the REAL test case.
>
> Change the "false" to "true" and try it on the attached SVG file.
>
> I get pointer events from the body of the person, but not from the
> big plus sign. Also, if you click on the outline of the person
> (i.e., not within but on it) no events are generated either.
> Only the pink fill seems to generate events.
>
> This is what I'm trying to understand (and fix or workaround).
>
> Thanks!
> -Archie
>
>
__________________________________________________________________________
> Archie Cobbs * CTO, Awarix * http://www.awarix.com
> [attachment "clickbug.svg" deleted by Thomas E. DeWeese/449433/EKC]
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
Re: Trouble with EventListeners
Posted by Archie Cobbs <ar...@dellroad.org>.
thomas.deweese@kodak.com wrote:
> Archie Cobbs <ar...@dellroad.org> wrote on 04/28/2006 05:17:39 PM:
>> So I wrote a small test case (attached), but now I can't
>> get ANY events to be emitted!
>
> canvas = new JSVGCanvas(null, false, false);
>
> The second argument is called 'eventsEnabled'
> you passed false so _all_ events are disabled in the canvas...
D'OH! Sorry for the stupidity.
But this is great because now I can include the REAL test case.
Change the "false" to "true" and try it on the attached SVG file.
I get pointer events from the body of the person, but not from the
big plus sign. Also, if you click on the outline of the person
(i.e., not within but on it) no events are generated either.
Only the pink fill seems to generate events.
This is what I'm trying to understand (and fix or workaround).
Thanks!
-Archie
__________________________________________________________________________
Archie Cobbs * CTO, Awarix * http://www.awarix.com
Re: Trouble with EventListeners
Posted by th...@kodak.com.
Hi Archie,
Archie Cobbs <ar...@dellroad.org> wrote on 04/28/2006 05:17:39 PM:
> So I wrote a small test case (attached), but now I can't
> get ANY events to be emitted!
canvas = new JSVGCanvas(null, false, false);
The second argument is called 'eventsEnabled'
you passed false so _all_ events are disabled in the canvas...
> Maybe I'm doing something stupid? Or is this a real bug?
Don't think so...
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org