Dear Thomas,
I've added some test elements and code to see if the "normal" elements work
and your right. The mouse-out and mouse-over work with the rect and circle
elements without problem. However, I did the same with the use-element and
only the mousemove and click events work correct. The mouseover and mouseout
still don't want to do anything.
The testcode:
Element elm = svgDoc.getElementById("test1");
if (elm != null){
((EventTarget)elm).addEventListener("mousemove",
XGCSVGCanvas.this, false);
((EventTarget)elm).addEventListener("mouseover",
XGCSVGCanvas.this, false);
((EventTarget)elm).addEventListener("mouseout",
XGCSVGCanvas.this, false);
((EventTarget)elm).addEventListener("click",
XGCSVGCanvas.this, false);
log4j.info("Event handlers attached to
circle-element
test1");
}
elm = svgDoc.getElementById("test2");
if (elm != null){
((EventTarget)elm).addEventListener("mousemove",
XGCSVGCanvas.this, false);
((EventTarget)elm).addEventListener("mouseover",
XGCSVGCanvas.this, false);
((EventTarget)elm).addEventListener("mouseout",
XGCSVGCanvas.this, false);
((EventTarget)elm).addEventListener("click",
XGCSVGCanvas.this, false);
log4j.info("Event handlers attached to rect-element
test2");
}
elm = svgDoc.getElementById("test3");
if (elm != null){
((EventTarget)elm).addEventListener("mousemove",
XGCSVGCanvas.this, false);
((EventTarget)elm).addEventListener("mouseover",
XGCSVGCanvas.this, false);
((EventTarget)elm).addEventListener("mouseout",
XGCSVGCanvas.this, false);
((EventTarget)elm).addEventListener("click",
XGCSVGCanvas.this, false);
log4j.info("Event handlers attached to use-element
test3");
}
elm = svgDoc.getElementById("test4");
if (elm != null){
((EventTarget)elm).addEventListener("mousemove",
XGCSVGCanvas.this, false);
((EventTarget)elm).addEventListener("mouseover",
XGCSVGCanvas.this, false);
((EventTarget)elm).addEventListener("mouseout",
XGCSVGCanvas.this, false);
((EventTarget)elm).addEventListener("click",
XGCSVGCanvas.this, false);
log4j.info("Event handlers attached to use-element
test4");
}
The SVG:
<circle cx="80000" cy="-443000" r="1000" style="fill:red" id="test1" />
<rect x="75000" y="-442000" width="2000" height="2000" style="fill:blue"
id="test2" />
<use xlink:href= "#matrixbak" x="91000" y="-444000" id="test3" />
<use xlink:href= "MTMSymbols.svg#matrixbak" x="90500" y="-444000"
id="test4"
/>
I will use the mouse-move event for now.
Leo
P.S. The application is already looking great. Just had some demo-days and
the audience was surprised about the speed of the SVG-rendering. Thanks to
all Batik-developers and the great help in this user group.
>-- Mensaje original --
>Reply-To: [email protected]
>To: [email protected]
>Cc: [email protected]
>Subject: Re: Headache use-element
>From: [EMAIL PROTECTED]
>Date: Mon, 17 Jul 2006 18:13:27 -0400
>
>
>Hi Leo,
>
>[EMAIL PROTECTED] wrote on 07/17/2006 08:57:33 AM:
>
>> My main question is why a specific event works while
>> the other won't. Due to specific requirements I am using the latest
>build
>> ( I am using multiImage/subImage elements etc.)
>
> Unfortunately, I can't think of anything that would be likely to
>cause this behavior in Batik. A couple of questions/possibilities:
>
> 1) Does mouse-over work for other element types? Try
> creating a simple rect and adding your listener to that.
> 2) Is it possible that you have a high level listener
> that would be canceling mouseover events?
>
>> The following piece of java code shows how I create the element and add
>
>the
>> eventlistener:
>
> This looks fine.
>
>> Under all circumstances the "click" event works, but under no
>circumstances
>> can I get an event from the "mouseover". I have the application working
>
>with
>> the "click" event, but the user would like to have the mouseover....
>>
>> Is there something wrong with my approach, or has something changed
>substantially
>> in svg1.2?
>
> I don't think there is anything wrong with your approach...
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]