Hi Philipp,

 

you have to add following to your document:

 

<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"

 "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">

 

So in total like this it should work

 

<?xml version="1.0" standalone="no"?>

<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"

 "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">

  <svg xmlns="http://www.w3.org/2000/svg"

        viewBox="0 0 100 100" >

   <circle cx="30" cy="30" r="10" fill = "red">

   <title>This makes the game go.</title>

  </circle>

  </svg>

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

mailto:[EMAIL PROTECTED]

www.gigatronik.com

 


Von: philip zuniga [mailto:[EMAIL PROTECTED]
Gesendet: Freitag, 19. Mai 2006 18:22
An: [email protected]
Betreff: Re: Tooltips with Batik

 

Sir, I have here a pretty simple SVG file,

 

<?xml version="1.0"?>
  <svg xmlns="http://www.w3.org/2000/svg"
        viewBox="0 0 100 100" >
   <circle cx="30" cy="30" r="10" fill = "red">
   <title>This makes the game go.</title>
  </circle>
  </svg>

 

This should produce a tooltip in a circle , but I could not seem to make the tooltip appear, is there something wrong?

 

Philip


 

On 5/19/06, Steiner, Dominik <[EMAIL PROTECTED]> wrote:

Hi philip,

 

of course it is possible… just add a <title> or <desc> tag into the element you want to add the tooltip… but you can't add it to an element which is referenced by a use tag… so this could have been your issue from the morning… else I have no idea why batik shouldn't display it…

 

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

mailto:[EMAIL PROTECTED]

www.gigatronik.com

 


Von: philip zuniga [mailto: [EMAIL PROTECTED]]
Gesendet: Freitag, 19. Mai 2006 16:34

Betreff: Re: Tooltips with Batik

 

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:

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

mailto:[EMAIL PROTECTED]

www.gigatronik.com

 


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

 

 

Reply via email to