xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Maik Schürer proveo GmbH <Maik.Schue...@proveo.de>
Subject tooltips / Re: MouseEvents do not occur...
Date Mon, 25 Oct 2004 11:18:49 GMT
interesting to read about tooltips via <title> and <desc> ...

is it possible to customize the tooltip box ?

changing the font size works using UIManager, but font name (SansSerif e.g.)
and background color seems to be not changeable ...
   Font font = new Font("SansSerif", Font.PLAIN, 24); // only size shows an
   FontUIResource fontRes = new FontUIResource(font);
   UIManager.put("ToolTip.font", fontRes);
   UIManager.put("Tooltip.background", new ColorUIResource(Color.CYAN)); //
shows no effect


----- Original Message ----- 
From: "Thomas DeWeese" <Thomas.DeWeese@Kodak.com>
To: "Batik Users" <batik-users@xml.apache.org>
Sent: Monday, October 25, 2004 12:20 PM
Subject: Re: MouseEvents do not occur if <desc> section is missing in SVG
docu ment

Stoeckle, Yvonne wrote:

> I have a simple SVG document and want to receive MouseEvents in my Java
> code when a mouse click occurs on an element of the document. This
> works, as long as I have either a <desc> section or an <animateMotion
> ..> section in the document.

   Do let the JSVGCanvas know that you want the document
built as a 'dynamic' document?  If you don't then without
the 'desc' this will appear to be a totally static document[*],


[*] You may wonder why 'desc' makes it not 'totally static' the
answer is because we support using 'desc' and 'title' elements as
tool-tips when you hover over the associated content.  In this case
we disable desc and title for the root since they would always pop
up and would be fairly annoying (although we still turn on the
desc/title handling - always room for improvement).

> I tried this even with the following sample from the W3C SVG sites,
> because I first thought that my document has been wrong.
> <?xml version="1.0" standalone="no"?>
> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
>   " http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd
> <http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd> ">
> <svg width="5cm" height="5cm" version="1.1"
>      xmlns="http://www.w3.org/2000/svg">
>   <desc>Two groups, each of two rectangles
>   </desc>
>   <g id="group1" fill="red" >
>     <rect x="1cm" y="1cm" width="1cm" height="1cm" />
>     <rect x="3cm" y="1cm" width="1cm" height="1cm" />
>   </g>
>   <g id="group2" fill="blue" >
>     <rect x="1cm" y="3cm" width="1cm" height="1cm" />
>     <rect x="3cm" y="3cm" width="1cm" height="1cm" />
>   </g>
>   <!-- Show outline of canvas using 'rect' element -->
>   <rect x=".01cm" y=".01cm" width="4.98cm" height="4.98cm"
>         fill="none" stroke="blue" stroke-width=".02cm" />
> </svg>
> I have added a mouse listener to the group1 with:
>                 SVGGElement group1 =
> (SVGGElement)svgDocument.getElementById("group1");
>                 group1.addEventListener("click", new
> MouseClickListener(), false);
> If I remove <desc> section in the document, the mouse events do no
> longer arrive in my code.
> Does anyone have an idea about that ?
> */ Yvonne Stöckle /*
> * ___________________________________ *

To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org

To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org

View raw message