This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: [PATCH] Small fixes to AWT
On Tue, 2004-02-10 at 12:16, David Jee wrote:
> Actually, I finally understand what you mean by invalidating in show or
> hide. D'oh. I'll make that change.
Here's a repost with the change mentioned above.
-David Jee
2004-02-10 David Jee <djee@redhat.com>
* java/awt/BorderLayout.java
(calcCompSize): Invisible components get zero dimensions.
* java/awt/Button.java
(setLabel): Set actionCommand.
* java/awt/Component.java
(show): Invalidate component and parent container.
(hide): Likewise.
Index: java/awt/BorderLayout.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/awt/BorderLayout.java,v
retrieving revision 1.11
diff -u -r1.11 BorderLayout.java
--- java/awt/BorderLayout.java 3 Feb 2004 17:10:50 -0000 1.11
+++ java/awt/BorderLayout.java 10 Feb 2004 17:17:20 -0000
@@ -637,7 +637,7 @@
private Dimension
calcCompSize(Component comp, int what)
{
- if (comp == null)
+ if (comp == null || !comp.isVisible())
return new Dimension(0, 0);
if (what == MIN)
return comp.getMinimumSize();
Index: java/awt/Button.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/awt/Button.java,v
retrieving revision 1.11
diff -u -r1.11 Button.java
--- java/awt/Button.java 5 Jun 2003 19:58:39 -0000 1.11
+++ java/awt/Button.java 10 Feb 2004 17:17:20 -0000
@@ -148,6 +148,7 @@
setLabel(String label)
{
this.label = label;
+ actionCommand = label;
if (peer != null)
{
ButtonPeer bp = (ButtonPeer) peer;
Index: java/awt/Component.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/awt/Component.java,v
retrieving revision 1.36
diff -u -r1.36 Component.java
--- java/awt/Component.java 5 Feb 2004 23:21:40 -0000 1.36
+++ java/awt/Component.java 10 Feb 2004 17:17:20 -0000
@@ -879,6 +879,7 @@
this.visible = true;
if (peer != null)
peer.setVisible(true);
+ invalidate();
}
/**
@@ -905,6 +906,7 @@
if (peer != null)
peer.setVisible(false);
this.visible = false;
+ invalidate();
}
/**