Hi,
Does anyone have an example of code that results in a tooltip for a
<use> element in a JSVGCanvas? This is unfortunately a long-standing
unresolved problem I have [1]. That past example shows that, for a Web
page, it would work like so:
<a xlink:href="http://www.gnote.org/" cursor="help"
xlink:title="thinking about communication">
<title>Thought bubbles</title>
<use xlink:href="#communicate" x="90" y="-150" />
</a>
Indeed, "thinking about communication" pops up on mouseover.
But I am developing for JSVGCanvas (Batik v1.6), not the Web. When I
use this code:
SVGElement elt = (SVGElement)doc.createElementNS(Intersection.svgNS,
"use");
elt.setAttributeNS("http://www.w3.org/1999/xlink", "xlink:href",
"#receptor");
xlink.setXLinkTitle(elt, "test");
nothing pops up on hover. Nor when I wrap the <use> in an <a> and put
xlink:title in the <a>. Nor when I explicitly set "xlink:title" instead
of using the XLinkSupport class, which just produces 'title="xyz"'....
Element d = doc.createElementNS(Intersection.svgNS, "desc");
Text t = doc.createTextNode(id);
Element a = doc.createElementNS(Intersection.svgNS, "a");
a.setAttributeNS("http://www.w3.org/1999/xlink", "xlink:title", "test");
//xlink.setXLinkTitle(a, "test");
d.appendChild(t);
elt.appendChild(d);
a.appendChild(elt);
parElt.appendChild(a);
Any hints would be extremely welcome.
Dan Slater
[1]
http://www.nabble.com/How-do-people-show-tooltips-over-reused-symbols-on-a-JSVGCanvas--Is-this-related-to-xlink:title--td17785257.html
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]