Hi Philipp,
I add tooltip as following: (tagName can be title or desc)
public static void addTooltip(Element shape, String tagName, String text) {
// remove the old <desc> tooltip, if any
NodeList nodelist = shape.getElementsByTagNameNS( svgNS , tagName);
for ( int i = 0; i < nodelist.getLength(); i++)
shape.removeChild(nodelist.item(i));
// now add the new <desc> tooltip, if any
if (text != null ) {
// create a <desc> element and its text node which contains the tip text.
Element textEl = shape.getOwnerDocument().createElementNS( svgNS , tagName);
Text text_node = shape.getOwnerDocument().createTextNode(text);
textEl.appendChild(text_node);
// append the tooltip <desc> to the ID'd element
shape.appendChild(textEl);
}
}
I hope this helps.
Dominik Steiner
Dipl-Ing. Informationstechnik (BA)
GIGATRONIK
Gesellschaft für Automobil-
elektronikentwicklung mbH
Taunusstr. 21
80807 München
Telefon +49 (0) 89 / 353 96 80-70
Telefax +49 (0) 89 / 353 96 80-99
Von: philip zuniga [mailto: [EMAIL PROTECTED]]
Gesendet: Donnerstag, 18. Mai 2006 17:24
An: [email protected]
Betreff: Tooltips with Batik
Hello there,
I am trying to show some tooltips in the SVG elements that are loaded in my batik canvas. I am using the <title> attribute for this, but it seems that it does not work. Do you have any idea how to put tooltips in SVG elements tthat are loaded in the Batik Canvas?
Thanks
Philip
Hello sir,
thanks for your reply. But is it not possible for me to add the tooltip in the file itself? and not using java?
PhilipZ
On 5/19/06, Steiner, Dominik <[EMAIL PROTECTED]> wrote:
- AW: Tooltips with Batik Steiner, Dominik
- Re: Tooltips with Batik philip zuniga
- AW: Tooltips with Batik Steiner, Dominik
- Re: Tooltips with Batik philip zuniga
- Re: Tooltips with Batik Cameron McCormack
- AW: Tooltips with Batik Steiner, Dominik
