This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
[gui][PATCH] override getPreferredSize and getMinimumSize injava.applet.Applet
- From: Thomas Fitzsimmons <fitzsim at redhat dot com>
- To: libgcj patches <java-patches at gcc dot gnu dot org>
- Date: Sat, 13 Mar 2004 14:43:19 -0500
- Subject: [gui][PATCH] override getPreferredSize and getMinimumSize injava.applet.Applet
Hello,
This patch overrides getPreferredSize and getMinimumSize in
java.applet.Applet to return the width and height values given in the
applet tag.
I'm committing this patch to java-gui-branch.
Tom
2004-03-13 Thomas Fitzsimmons <fitzsim@redhat.com>
* java/applet/Applet.java (getPreferredSize): New method.
(getMinimumSize): New method.
Index: java/applet/Applet.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/applet/Applet.java,v
retrieving revision 1.3
diff -u -r1.3 Applet.java
--- java/applet/Applet.java 10 Nov 2002 00:16:42 -0000 1.3
+++ java/applet/Applet.java 13 Mar 2004 19:25:49 -0000
@@ -458,6 +458,34 @@
}
/**
+ * Returns an instance of {@link Dimension} representing the
+ * applet's width and height parameters.
+ *
+ * @return the applet's preferred size
+ */
+ public Dimension getPreferredSize()
+ {
+ int width = Integer.parseInt(stub.getParameter("width"));
+ int height = Integer.parseInt(stub.getParameter("height"));
+
+ return new Dimension(width, height);
+ }
+
+ /**
+ * Returns an instance of {@link Dimension} representing the
+ * applet's width and height parameters.
+ *
+ * @return the applet's minimum size
+ */
+ public Dimension getMinimumSize()
+ {
+ int width = Integer.parseInt(stub.getParameter("width"));
+ int height = Integer.parseInt(stub.getParameter("height"));
+
+ return new Dimension(width, height);
+ }
+
+ /**
* This class provides accessibility support for Applets, and is the
* runtime type returned by {@link #getAccessibleContext()}.
*