classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cp-patches] FYI: javax.swing.SwingUtilities fixlet


From: Robert Schuster
Subject: Re: [cp-patches] FYI: javax.swing.SwingUtilities fixlet
Date: Fri, 20 May 2005 16:25:37 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; de-AT; rv:1.7.8) Gecko/20050514

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Roman,
from your writings it seems to me that this is an undocumented feature
in J2blah.
Could you please add documentation of such special behavior to GNU
Classpath' doc?

In the code I would like to see a comment like this, too: "Doing foo is
what the JDK1.x does".

Sorry, for being so pedantic about this but I think that being more
verbose about such features will help Classpath developers in the long run.

cu
Robert

Roman Kennke wrote:
> I committed the attached patch that fixes
> javax.swing.SwingUtilities.convertPoint(). This method must check the
> showing property of the source and destination components before calling
> convertPointTo/FromScreen(). Otherwise an IllegalComponentStateException
> is thrown. Since that method is called extensivly from the EventQueue,
> such a failure would kill the EventQueue, effectivly leading to a
> not-responding application. This has for example been the case when
> frames have been hidden.
> 
> I have checked the behaviour of Sun's implementation when source and
> destination are not showing. They do exactly what we do now: if one of
> the components is not showing, it simply returns the input coordinates
> as return value.
> 
> 2005-05-20  Roman Kennke  <address@hidden>
> 
>        * javax/swing/SwingUtilities.java
>        (convertPoint): Check for visibility of source and destination
>        before calling convertPointToScreen or convertPointFromScreen.
> 
> /Roman
> 
> 
> ------------------------------------------------------------------------
> 
> Index: javax/swing/SwingUtilities.java
> ===================================================================
> RCS file: /cvsroot/classpath/classpath/javax/swing/SwingUtilities.java,v
> retrieving revision 1.25
> diff -u -r1.25 SwingUtilities.java
> --- javax/swing/SwingUtilities.java   19 May 2005 12:37:20 -0000      1.25
> +++ javax/swing/SwingUtilities.java   20 May 2005 12:08:17 -0000
> @@ -515,8 +515,11 @@
>      if (destination == null)
>        destination = getRoot(source);
>  
> -    convertPointToScreen(pt, source);
> -    convertPointFromScreen(pt, destination);
> +    if (source.isShowing() && destination.isShowing())
> +      {
> +        convertPointToScreen(pt, source);
> +        convertPointFromScreen(pt, destination);
> +      }
>  
>      return pt;
>    }
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Classpath-patches mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/classpath-patches
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFCjfNhG9cfwmwwEtoRAoUyAJ9JUbxApJLJ4HtACyXhYl/GQbjWpwCcD+8p
ROINxaGP+4q1F3MwolABjd8=
=fQDV
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]