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 "Bishop, Michael W. CONTR J9C880" <Mi...@je.jfcom.mil> on 2007/04/12 22:04:09 UTC
Tooltips in elements?
I'm trying to add tooltips and they work for most elements.
Unfortuantely, my primary purpose is for text and I don't seem to be
getting the tooltip to display when I hover the mouse over text:
<g svgx:name="default_layer" svgx:type="layer"
id="SVGWB-723C3643-74A9-995B-FFDF-1DDB033A46B8" style="display:
block"
pointer-events="none">
<rect x="64" y="157"
transform="matrix(1.4128035558031693, 0.0, 0.0,
1.4128035558031693, 0.0, -188.0794677734375)"
fill-opacity="1" fill="gray" width="196" height="141"
id="SVGWB-2EA378C8-70AF-CDFA-2DA7-B5BF4CA16A02"
stroke="black"
stroke-opacity="1" stroke-width="1"
pointer-events="visible">
<desc id="SVGWB-AC020D00-4691-13EB-EA48-EF19CD5E4672">
sdfgdsfgfd
</desc>
</rect>
<text fill-opacity="1" stroke="none"
id="SVGWB-CA0080D5-EBD8-D14E-B5E7-4283A5238185"
style="font-family: sans-serif; font-weight: normal;
font-style: normal; font-size: 24"
svgx:type="text"
transform="matrix(1.4128035558031693, 0.0, 0.0,
1.4128035558031693, 0.0, -188.0794677734375)"
stroke-opacity="1" fill="black" svgx:lang="en"
stroke-width="1"
pointer-events="visible" x="95" y="376">
Hello
<desc id="SVGWB-2C452FC2-C80C-656F-30D7-A9723DF1FFC0">
Bonjour
</desc>
</text>
</g>
The tooltip for the <rect> element shows properly on a mouse-over on the
JSVGCanvas. The tooltip for the <text> element does not. Any reasons
why? Is there a difference between using <desc> and <title> for
tooltips?
Michael Bishop
RE: Tooltips in elements?
Posted by "Bishop, Michael W. CONTR J9C880" <Mi...@je.jfcom.mil>.
I've found the time to write a test case for this. I've attached the source. In short, a document must be reassociated with the JSVGCanvas (via setDocument(...)) before tooltips for <text> elements show up.
Michael Bishop
________________________________
From: Bishop, Michael W. CONTR J9C880 [mailto:Michael.Bishop@je.jfcom.mil]
Sent: Fri 4/13/2007 2:54 PM
To: batik-users@xmlgraphics.apache.org
Subject: RE: Tooltips in <text> elements?
More information on this issue; if I save the SVG to a file, then load it back to the JSVGCanvas, it seems to work. I'll see if I can't draw up a test case to see if there's a possible bug with assigning tooltips to <text> elements in in-memory documents?
Michael Bishop
________________________________
From: Bishop, Michael W. CONTR J9C880 [mailto:Michael.Bishop@je.jfcom.mil]
Sent: Fri 4/13/2007 11:23 AM
To: batik-users@xmlgraphics.apache.org
Subject: RE: Tooltips in <text> elements?
Hi Thomas,
You're right, it does work in Squiggle. I made another SVG with all my possible elements; rect, ellipse, polygon, line, path, polyline, image, and text. In my JSVGCanvas, text is the ONLY one that does not work. I don't know, I initiate my JSVGCanvas with (null, true, false), disabling text selection. I tried enabling text selection, no difference. I'm not sure why it works in Squiggle and not in the canvas.
Michael Bishop
________________________________
From: thomas.deweese@kodak.com [mailto:thomas.deweese@kodak.com]
Sent: Fri 4/13/2007 6:34 AM
To: batik-users@xmlgraphics.apache.org
Cc: batik-users@xmlgraphics.apache.org
Subject: Re: Tooltips in <text> elements?
Hi Michael,
"Bishop, Michael W. CONTR J9C880" <Mi...@je.jfcom.mil> wrote on
04/12/2007 04:04:09 PM:
> I?m trying to add tooltips and they work for most elements.
> Unfortuantely, my primary purpose is for text and I don?t seem to be
> getting the tooltip to display when I hover the mouse over text:
Your example worked for me in Squiggle...
> <g svgx:name="default_layer" svgx:type="layer"
> id="SVGWB-723C3643-74A9-995B-FFDF-1DDB033A46B8" style="display:
block"
> pointer-events="none">
> <rect x="64" y="157"
> transform="matrix(1.4128035558031693, 0.0, 0.0, 1.
> 4128035558031693, 0.0, -188.0794677734375)"
> fill-opacity="1" fill="gray" width="196" height="141"
> id="SVGWB-2EA378C8-70AF-CDFA-2DA7-B5BF4CA16A02"
stroke="black"
> stroke-opacity="1" stroke-width="1"
pointer-events="visible">
> <desc id="SVGWB-AC020D00-4691-13EB-EA48-EF19CD5E4672">
> sdfgdsfgfd
> </desc>
> </rect>
> <text fill-opacity="1" stroke="none"
> id="SVGWB-CA0080D5-EBD8-D14E-B5E7-4283A5238185"
> style="font-family: sans-serif; font-weight: normal;
> font-style: normal; font-size: 24"
> svgx:type="text"
> transform="matrix(1.4128035558031693, 0.0, 0.0, 1.
> 4128035558031693, 0.0, -188.0794677734375)"
> stroke-opacity="1" fill="black" svgx:lang="en"
stroke-width="1"
> pointer-events="visible" x="95" y="376">
> Hello
> <desc id="SVGWB-2C452FC2-C80C-656F-30D7-A9723DF1FFC0">
> Bonjour
> </desc>
> </text>
> </g>
>
> The tooltip for the <rect> element shows properly on a mouse-over on
> the JSVGCanvas. The tooltip for the <text> element does not. Any
> reasons why? Is there a difference between using <desc> and <title>
> for tooltips?
>
> Michael Bishop
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
RE: Tooltips in elements?
Posted by "Bishop, Michael W. CONTR J9C880" <Mi...@je.jfcom.mil>.
More information on this issue; if I save the SVG to a file, then load it back to the JSVGCanvas, it seems to work. I'll see if I can't draw up a test case to see if there's a possible bug with assigning tooltips to <text> elements in in-memory documents?
Michael Bishop
________________________________
From: Bishop, Michael W. CONTR J9C880 [mailto:Michael.Bishop@je.jfcom.mil]
Sent: Fri 4/13/2007 11:23 AM
To: batik-users@xmlgraphics.apache.org
Subject: RE: Tooltips in <text> elements?
Hi Thomas,
You're right, it does work in Squiggle. I made another SVG with all my possible elements; rect, ellipse, polygon, line, path, polyline, image, and text. In my JSVGCanvas, text is the ONLY one that does not work. I don't know, I initiate my JSVGCanvas with (null, true, false), disabling text selection. I tried enabling text selection, no difference. I'm not sure why it works in Squiggle and not in the canvas.
Michael Bishop
________________________________
From: thomas.deweese@kodak.com [mailto:thomas.deweese@kodak.com]
Sent: Fri 4/13/2007 6:34 AM
To: batik-users@xmlgraphics.apache.org
Cc: batik-users@xmlgraphics.apache.org
Subject: Re: Tooltips in <text> elements?
Hi Michael,
"Bishop, Michael W. CONTR J9C880" <Mi...@je.jfcom.mil> wrote on
04/12/2007 04:04:09 PM:
> I?m trying to add tooltips and they work for most elements.
> Unfortuantely, my primary purpose is for text and I don?t seem to be
> getting the tooltip to display when I hover the mouse over text:
Your example worked for me in Squiggle...
> <g svgx:name="default_layer" svgx:type="layer"
> id="SVGWB-723C3643-74A9-995B-FFDF-1DDB033A46B8" style="display:
block"
> pointer-events="none">
> <rect x="64" y="157"
> transform="matrix(1.4128035558031693, 0.0, 0.0, 1.
> 4128035558031693, 0.0, -188.0794677734375)"
> fill-opacity="1" fill="gray" width="196" height="141"
> id="SVGWB-2EA378C8-70AF-CDFA-2DA7-B5BF4CA16A02"
stroke="black"
> stroke-opacity="1" stroke-width="1"
pointer-events="visible">
> <desc id="SVGWB-AC020D00-4691-13EB-EA48-EF19CD5E4672">
> sdfgdsfgfd
> </desc>
> </rect>
> <text fill-opacity="1" stroke="none"
> id="SVGWB-CA0080D5-EBD8-D14E-B5E7-4283A5238185"
> style="font-family: sans-serif; font-weight: normal;
> font-style: normal; font-size: 24"
> svgx:type="text"
> transform="matrix(1.4128035558031693, 0.0, 0.0, 1.
> 4128035558031693, 0.0, -188.0794677734375)"
> stroke-opacity="1" fill="black" svgx:lang="en"
stroke-width="1"
> pointer-events="visible" x="95" y="376">
> Hello
> <desc id="SVGWB-2C452FC2-C80C-656F-30D7-A9723DF1FFC0">
> Bonjour
> </desc>
> </text>
> </g>
>
> The tooltip for the <rect> element shows properly on a mouse-over on
> the JSVGCanvas. The tooltip for the <text> element does not. Any
> reasons why? Is there a difference between using <desc> and <title>
> for tooltips?
>
> Michael Bishop
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
RE: Tooltips in elements?
Posted by "Bishop, Michael W. CONTR J9C880" <Mi...@je.jfcom.mil>.
Hi Thomas,
You're right, it does work in Squiggle. I made another SVG with all my possible elements; rect, ellipse, polygon, line, path, polyline, image, and text. In my JSVGCanvas, text is the ONLY one that does not work. I don't know, I initiate my JSVGCanvas with (null, true, false), disabling text selection. I tried enabling text selection, no difference. I'm not sure why it works in Squiggle and not in the canvas.
Michael Bishop
________________________________
From: thomas.deweese@kodak.com [mailto:thomas.deweese@kodak.com]
Sent: Fri 4/13/2007 6:34 AM
To: batik-users@xmlgraphics.apache.org
Cc: batik-users@xmlgraphics.apache.org
Subject: Re: Tooltips in <text> elements?
Hi Michael,
"Bishop, Michael W. CONTR J9C880" <Mi...@je.jfcom.mil> wrote on
04/12/2007 04:04:09 PM:
> I?m trying to add tooltips and they work for most elements.
> Unfortuantely, my primary purpose is for text and I don?t seem to be
> getting the tooltip to display when I hover the mouse over text:
Your example worked for me in Squiggle...
> <g svgx:name="default_layer" svgx:type="layer"
> id="SVGWB-723C3643-74A9-995B-FFDF-1DDB033A46B8" style="display:
block"
> pointer-events="none">
> <rect x="64" y="157"
> transform="matrix(1.4128035558031693, 0.0, 0.0, 1.
> 4128035558031693, 0.0, -188.0794677734375)"
> fill-opacity="1" fill="gray" width="196" height="141"
> id="SVGWB-2EA378C8-70AF-CDFA-2DA7-B5BF4CA16A02"
stroke="black"
> stroke-opacity="1" stroke-width="1"
pointer-events="visible">
> <desc id="SVGWB-AC020D00-4691-13EB-EA48-EF19CD5E4672">
> sdfgdsfgfd
> </desc>
> </rect>
> <text fill-opacity="1" stroke="none"
> id="SVGWB-CA0080D5-EBD8-D14E-B5E7-4283A5238185"
> style="font-family: sans-serif; font-weight: normal;
> font-style: normal; font-size: 24"
> svgx:type="text"
> transform="matrix(1.4128035558031693, 0.0, 0.0, 1.
> 4128035558031693, 0.0, -188.0794677734375)"
> stroke-opacity="1" fill="black" svgx:lang="en"
stroke-width="1"
> pointer-events="visible" x="95" y="376">
> Hello
> <desc id="SVGWB-2C452FC2-C80C-656F-30D7-A9723DF1FFC0">
> Bonjour
> </desc>
> </text>
> </g>
>
> The tooltip for the <rect> element shows properly on a mouse-over on
> the JSVGCanvas. The tooltip for the <text> element does not. Any
> reasons why? Is there a difference between using <desc> and <title>
> for tooltips?
>
> Michael Bishop
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
Re: Tooltips in elements?
Posted by th...@kodak.com.
Hi Michael,
"Bishop, Michael W. CONTR J9C880" <Mi...@je.jfcom.mil> wrote on
04/12/2007 04:04:09 PM:
> I?m trying to add tooltips and they work for most elements.
> Unfortuantely, my primary purpose is for text and I don?t seem to be
> getting the tooltip to display when I hover the mouse over text:
Your example worked for me in Squiggle...
> <g svgx:name="default_layer" svgx:type="layer"
> id="SVGWB-723C3643-74A9-995B-FFDF-1DDB033A46B8" style="display:
block"
> pointer-events="none">
> <rect x="64" y="157"
> transform="matrix(1.4128035558031693, 0.0, 0.0, 1.
> 4128035558031693, 0.0, -188.0794677734375)"
> fill-opacity="1" fill="gray" width="196" height="141"
> id="SVGWB-2EA378C8-70AF-CDFA-2DA7-B5BF4CA16A02"
stroke="black"
> stroke-opacity="1" stroke-width="1"
pointer-events="visible">
> <desc id="SVGWB-AC020D00-4691-13EB-EA48-EF19CD5E4672">
> sdfgdsfgfd
> </desc>
> </rect>
> <text fill-opacity="1" stroke="none"
> id="SVGWB-CA0080D5-EBD8-D14E-B5E7-4283A5238185"
> style="font-family: sans-serif; font-weight: normal;
> font-style: normal; font-size: 24"
> svgx:type="text"
> transform="matrix(1.4128035558031693, 0.0, 0.0, 1.
> 4128035558031693, 0.0, -188.0794677734375)"
> stroke-opacity="1" fill="black" svgx:lang="en"
stroke-width="1"
> pointer-events="visible" x="95" y="376">
> Hello
> <desc id="SVGWB-2C452FC2-C80C-656F-30D7-A9723DF1FFC0">
> Bonjour
> </desc>
> </text>
> </g>
>
> The tooltip for the <rect> element shows properly on a mouse-over on
> the JSVGCanvas. The tooltip for the <text> element does not. Any
> reasons why? Is there a difference between using <desc> and <title>
> for tooltips?
>
> Michael Bishop
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org