2004-01-13�� David Jee�� <djee@redhat.com>
authorDavid Jee <djee@redhat.com>
Tue, 13 Jan 2004 17:55:20 +0000 (17:55 +0000)
committerDavid Jee <djee@gcc.gnu.org>
Tue, 13 Jan 2004 17:55:20 +0000 (17:55 +0000)
        * gnu/java/awt/peer/gtk/GtkContainerPeer.java
        (setBackground): New method. Children with no explicitly-set
        background will be repainted with the parent container's new
        background color.

From-SVN: r75809

libjava/ChangeLog
libjava/gnu/java/awt/peer/gtk/GtkContainerPeer.java

index eb423b3..1e32bc4 100644 (file)
@@ -1,3 +1,18 @@
+2004-01-13  David Jee  <djee@redhat.com>
+
+       * gnu/java/awt/peer/gtk/GtkContainerPeer.java
+       (setBackground): New method. Children with no explicitly-set
+       background will be repainted with the parent container's new
+       background color.
+
+2004-01-13  David Jee  <djee@redhat.com>
+
+       * Makefile.am: Add BitwiseXORComposite.java.
+       * Makefile.in: Regenerated.
+       * gcj/Makefile.in: Regenerated.
+       * include/Makefile.in: Regenerated.
+       * testsuite/Makefile.in: Regenerated.
+
 2004-01-12  Fernando Nasser  <fnasser@redhat.com>
 
        * gnu/java/awt/peer/gtk/TestAWT.java: Fix test program so that it does
index e51b7f0..e888172 100644 (file)
@@ -39,6 +39,8 @@ exception statement from your version. */
 package gnu.java.awt.peer.gtk;
 
 import java.awt.AWTEvent;
+import java.awt.Color;
+import java.awt.Component;
 import java.awt.Container;
 import java.awt.Graphics;
 import java.awt.Insets;
@@ -136,4 +138,23 @@ public class GtkContainerPeer extends GtkComponentPeer
   public void beginLayout () { }
   public void endLayout () { }
   public boolean isPaintPending () { return false; }
+
+  public void setBackground (Color c)
+  {
+    super.setBackground(c);
+  
+    Object components[] = ((Container) awtComponent).getComponents();
+    for (int i = 0; i < components.length; i++)
+      {
+        Component comp = (Component) components[i];
+
+        // If the child's background has not been explicitly set yet,
+        // it should inherit this container's background. This makes the
+        // child component appear as if it has a transparent background.
+        // Note that we do not alter the background property of the child,
+        // but only repaint the child with the parent's background color.
+        if (!comp.isBackgroundSet() && comp.getPeer() != null)
+          comp.getPeer().setBackground(c);
+      }
+  }
 }