Container.java (addImpl): Enable paint events if adding a lightweight to a heavyweight.
authorScott Gilbertson <scottg@mantatest.com>
Sun, 20 Apr 2003 23:21:06 +0000 (23:21 +0000)
committerTom Tromey <tromey@gcc.gnu.org>
Sun, 20 Apr 2003 23:21:06 +0000 (23:21 +0000)
2003-04-20  Scott Gilbertson  <scottg@mantatest.com>

* java/awt/Container.java (addImpl): Enable paint events if adding
a lightweight to a heavyweight.
(addNotify): Ensure that peer is created before
addNotifyContainerChildren.
(addNotifyContainerChildren): Enable paint events if a heavyweight
container contains a lightweight.

From-SVN: r65870

libjava/ChangeLog
libjava/java/awt/Container.java

index 319e3fbf48e585f46f1110c88a85102e7781a49d..956a317a7fbc4f1181f8c06a9e4d7b327dc1471b 100644 (file)
@@ -1,3 +1,12 @@
+2003-04-20  Scott Gilbertson  <scottg@mantatest.com>
+
+       * java/awt/Container.java (addImpl): Enable paint events if adding
+       a lightweight to a heavyweight.
+       (addNotify): Ensure that peer is created before
+       addNotifyContainerChildren.
+       (addNotifyContainerChildren): Enable paint events if a heavyweight
+       container contains a lightweight.
+
 2003-04-20  Tom Tromey  <tromey@redhat.com>
 
        * java/io/BufferedReader.java, java/io/BufferedWriter.java,
index 9ef6add71dbf698ce505ac3061e2294dfc9c9112..9bad369e53f82b9e75df043874b35901e480d6d1 100644 (file)
@@ -297,9 +297,13 @@ public class Container extends Component
         if (peer != null)
           {
             comp.addNotify();
-
-            if (comp.isLightweight())
-              enableEvents(comp.eventMask);
+            
+            if (comp.isLightweight ())
+             {
+               enableEvents (comp.eventMask);
+               if (!isLightweight ())
+                 enableEvents (AWTEvent.PAINT_EVENT_MASK);
+             }
           }
 
         invalidate();
@@ -907,8 +911,8 @@ public class Container extends Component
    */
   public void addNotify()
   {
-    addNotifyContainerChildren();
     super.addNotify();
+    addNotifyContainerChildren();
   }
 
   /**
@@ -1288,8 +1292,12 @@ public class Container extends Component
         for (int i = ncomponents;  --i >= 0; )
           {
             component[i].addNotify();
-            if (component[i].isLightweight())
-              enableEvents(component[i].eventMask);
+            if (component[i].isLightweight ())
+             {
+               enableEvents(component[i].eventMask);
+               if (peer != null && !isLightweight ())
+                 enableEvents (AWTEvent.PAINT_EVENT_MASK);
+             }
           }
       }
   }