Alessandro Di Bella wrote:

I think I found what the problem is but I'm not sure if it is a bug, feature or my mistake.

It's a little of all of the above. First I think you are confusing the 'parent' tree with the event dispatch:

When I click on the rectangle with id "EVENT_GENERATOR", the event gets propagated to rect[id="EVENT_GENERATOR"]/g/symbol[id="ASYMBOL"]/defs/svg

This is probably the parent tree, although even that doesn't seem quite right (I would have expected some 'odd' elements in the tree, and perhaps a null parent at some point). How are you generating this list?

rather than rect[id="EVENT_GENERATOR"]/g/symbol[id="ASYMBOL"]/g[id="id="LISTENING_NODE"]/svg so the listener never gets notified.

The only way to know what the dispatch tree is to set an event listener on every element and see who get's called.

Is this the way is supposed to be of is it a bug?

So Batik 'cheats' for use. We should create a 'proxy tree' of elements of type 'ElementInstace'. We don't do this we actually clone the used element and attached the cloned content under the use element.

The SVG looks like:

<svg xmlns="http://www.w3.org/2000/svg"; xmlns:myns="........">
 <defs>
  <symbol id="ASYMBOL">
   <g>
    <rect width="100" height="62.5" ry="5" x="+3" y="+3" />
    <rect id="EVENT_GENERATOR" width="100" height="62.5" ry="5"/>
   </g>
  </symbol>
 </defs>
  <g id="LISTENING_NODE" myns:type="mytype" .....>
  <use xlink:href="#ASYMBOL" x="195" y="702" width="622" height="394"/>
 </g>
 .................
</svg>



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to