Hi Maik,

  Well, I'm really not familiar with the UIManager stuff, so
this is from quickly looking at the JavaDocs.  the FontUIResource
is a derived class from Font, similarly for ColorUIResource.
Looking at the UIManager it treats the value differently if it
is a 'UIResource' vs if it is the baseclass (Font, Color).

  On first reading it appears that when the value is a UIResource
it checks the parent component for the value.  But I could easily
be missing something.

Maik Schürer proveo GmbH wrote:

Are you sure you want to use the 'UIResource' versions of these?
I would suspect that you would want to just use Color/Font (since you
want to override the parent).


what do you mean with 'UIResource versions' ? there are other versions too ?
is there something wrong with my code ?

Font font = new Font("SansSerif", Font.PLAIN, 24); // only size shows an
effect
FontUIResource fontRes = new FontUIResource(font);
UIManager.put("ToolTip.font", fontRes);
UIManager.put("Tooltip.background", new ColorUIResource(Color.CYAN)); //
shows no effect

Maik


----- Original Message ----- From: "Thomas DeWeese" <[EMAIL PROTECTED]>
To: "Batik Users" <[EMAIL PROTECTED]>
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[*],
try:

canvas.setDocumentState(JSVGCanvas.ALWAYS_DYNAMIC);

[*] 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
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]



---------------------------------------------------------------------
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]



Reply via email to