On Thu, 2005-09-15 at 14:53 -0400, Thomas Fitzsimmons wrote: > On Thu, 2005-09-15 at 20:48 +0200, Roman Kennke wrote: > > Also, wouldn't it be sufficent to check if a component has a peer? The > > API docs are a little bit confusing, but that is what it sounds to me. > > You mean rather than climbing the parent ladder? Whether or not a > Component is displayable depends on the displayability of its parents. > Whether or not a Window is displayable doesn't. >
The docs actually say that a Component is displayable when it is attached to a native screen resource. It is _made_ displayable when it is added to a displayable hierarchy or when it's hierarchy is made displayable. These actions (adding to displayable hierarchy or making hierarchy displayable) attach a native resource to the Component. So I believe Component should simply return (peer != null). I tested this and it passes the Mauve tests. So Window.java has no isDisplayable method and Component.java's isDisplayable method returns (peer != null). OK to check in? --Tony
Index: java/awt/Component.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/awt/Component.java,v retrieving revision 1.73 diff -u -r1.73 Component.java --- java/awt/Component.java 15 Sep 2005 16:49:02 -0000 1.73 +++ java/awt/Component.java 15 Sep 2005 20:12:39 -0000 @@ -733,8 +733,6 @@ */ public boolean isDisplayable() { - if (parent != null) - return parent.isDisplayable(); return peer != null; }
_______________________________________________ Classpath-patches mailing list Classpath-patches@gnu.org http://lists.gnu.org/mailman/listinfo/classpath-patches