Hi Dan,
Dan Slater <[email protected]> wrote on 02/09/2009 06:05:20 PM:
> I looked at the addDescOnClick.svg file (dated 4/10/2005 in my
> distribution)...is that a test that you would run via loading the file
> with a browser? When I load the file with Firefox 3 or IE6 I get no
> tooltips, even over the rectangles that have predefined titles/descs,
> and no onClick action when I click on top row of rectangles. I checked
> options on Firefox to make sure Java and JavaScript are both enabled,
> and my firewall is not blocking anything.
Sorry perhaps I misunderstood your question. All of my comments were
about Batik's SVG browser 'Squiggle'. If you want to know how to display
a toolTip with FireFox or IE6 I suggest you ask those developers.
> Am I missing something basic, or using these tests incorrectly? I don't
> understand how to implement these tests on the JSVGCanvas.
I was testing using (on linux, mac use build.sh):
build.bat squiggle samples/tests/spec/structure/toolTips.svg
Squiggle simply wraps the JSVGCanvas.
> Is it possible the JSVGCanvas might not mimic browser behavior despite a
> 'correct' internal DOM representation? Or it's time to try updating to
> Batik 1.7?
Batik/JSVGCanvas doesn't try to mimic any browser behavior, it tries
to properly implement the SVG standard.
> >> [email protected] wrote:
> >>
> >>> Hi Dan,
> >>>
> >>> Dan Slater <[email protected]> wrote on 02/04/2009 02:26:28 PM:
> >>>
> >>>
> >>>
> >>>> 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.
> >>>>
> >>>>
> >>> This should work for Batik, you will get a tool tip with
> >>> 'Thought bubbles' and not 'thinking about communication'.
> >>>
> >>>
> >>>
> >>>> 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");
> >>>>
> >>>>
> >>> You need to create an SVG 'title' element as your example shows
and
> >>> put your tool-tip text in that.
> >>>
> >>>
> >>>
> >>>> 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"'....
> >
> >>> So we use the SVG native 'title' and 'desc' elements rather than
> >>> the xlink attributes.
> >>>
> >>>
> >>>
> >>>> 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.
> >>>>
> >>>>
> >>> This example should work and does work in my testing.
> >>> I'm not sure why it isn't working for you. You can drop all
> >>> of the 'xlink:title' stuff if you want for now.
> >>>
> >>>
> >>>
> >>>
> >> ---------------------------------------------------------------------
> >> 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]
>