diff options
author | mark <mark@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-07-25 12:50:44 +0000 |
---|---|---|
committer | mark <mark@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-07-25 12:50:44 +0000 |
commit | d44d0799904d814dee2079869e3be7a643b9334c (patch) | |
tree | 8d66ae82e4f61f694871339ba9479724ddce0bea /libjava/java/awt/Component.java | |
parent | 77b4c797e5fefffbb7e78051d6cb1d4b4f7634cc (diff) | |
download | gcc-d44d0799904d814dee2079869e3be7a643b9334c.tar.gz |
2003-07-25 Mark Wielaard <mark@klomp.org>
* Makefile.am (awt_java_source_files): java/awt/GridBagLayoutInfo.java
added.
* Makefile.in: Likewise.
2003-07-25 Jeroen Frijters <jeroen@frijters.net>
* java/awt/Component.java
(getPreferredSize): Call preferredSize.
(preferredSize): Moved body of getPreferredSize here.
(getMinimumSize): Call minimumSize.
(minimumSize): Moved body of getMinimumSize here.
(prepareImage): Fall back on Toolkit.prepareImage if there is no peer
(checkImage(Image,ImageObserver)): Don't call getWidth/getHeight, but
pass -1
* java/awt/Container.java
(validate): Don't validate if there is no peer.
(update): Clear background before calling paint.
* java/awt/GridBagLayout.java
Completed the implementation and fixed several bugs.
* java/awt/MediaTracker.java
(MediaEntry.imageUpdate): Fixed typo. & instead of | was used to
combine flags.
* java/awt/Window.java
(Window): Don't call setVisible(false). Windows are invisible by
default and calling virtual methods from constructor causes
compatibility problems (e.g. subclasses may assume that the peer
already exists).
2003-07-25 Michael Koch <konqueror@gmx.de>
* java/awt/GridBagLayout.java:
Totally reworked and partly implemented.
* java/awt/GridBagLayoutInfo.java:
New file.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@69785 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/java/awt/Component.java')
-rw-r--r-- | libjava/java/awt/Component.java | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/libjava/java/awt/Component.java b/libjava/java/awt/Component.java index cc723b480f2..9a38919f1c5 100644 --- a/libjava/java/awt/Component.java +++ b/libjava/java/awt/Component.java @@ -1452,12 +1452,7 @@ public abstract class Component */ public Dimension getPreferredSize() { - if (prefSize == null) - if (peer == null) - return new Dimension(width, height); - else - prefSize = peer.getPreferredSize(); - return prefSize; + return preferredSize(); } /** @@ -1468,7 +1463,12 @@ public abstract class Component */ public Dimension preferredSize() { - return getPreferredSize(); + if (prefSize == null) + if (peer == null) + return new Dimension(width, height); + else + prefSize = peer.getPreferredSize(); + return prefSize; } /** @@ -1480,10 +1480,7 @@ public abstract class Component */ public Dimension getMinimumSize() { - if (minSize == null) - minSize = (peer != null ? peer.getMinimumSize() - : new Dimension(width, height)); - return minSize; + return minimumSize(); } /** @@ -1494,7 +1491,10 @@ public abstract class Component */ public Dimension minimumSize() { - return getMinimumSize(); + if (minSize == null) + minSize = (peer != null ? peer.getMinimumSize() + : new Dimension(width, height)); + return minSize; } /** @@ -1941,7 +1941,10 @@ public abstract class Component public boolean prepareImage(Image image, int width, int height, ImageObserver observer) { - return peer.prepareImage(image, width, height, observer); + if (peer != null) + return peer.prepareImage(image, width, height, observer); + else + return getToolkit().prepareImage(image, width, height, observer); } /** @@ -1957,8 +1960,7 @@ public abstract class Component */ public int checkImage(Image image, ImageObserver observer) { - return checkImage(image, image.getWidth(observer), - image.getHeight(observer), observer); + return checkImage(image, -1, -1, observer); } /** |