This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[gui] [PATCH] Fix GtkComponentPeer.getGraphics()


Hello,

I committed the following patch to the java-gui-branch.  It fixes
GtkComponentPeer.getGraphics() method, so that it returns a new
GdkGraphics instance rather than simply returning null. 
GtkContainerPeer.getGraphics() now simply calls super.getGraphics().

-David Jee

2004-05-27  David Jee  <djee@redhat.com>

        * gnu/java/awt/peer/gtk/GtkComponentPeer.java
        (getGraphics): Return a new GdkGraphics instance.
        * gnu/java/awt/peer/gtk/GtkContainerPeer.java
        (getGraphics): Call super.getGraphics().


Index: gnu/java/awt/peer/gtk/GtkComponentPeer.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/gnu/java/awt/peer/gtk/GtkComponentPeer.java,v
retrieving revision 1.16.2.10
diff -u -r1.16.2.10 GtkComponentPeer.java
--- gnu/java/awt/peer/gtk/GtkComponentPeer.java	25 May 2004 15:21:20 -0000	1.16.2.10
+++ gnu/java/awt/peer/gtk/GtkComponentPeer.java	27 May 2004 17:57:11 -0000
@@ -199,7 +199,10 @@
 
   public Graphics getGraphics ()
   {
-    return null;
+    if (GtkToolkit.useGraphics2D ())
+        return new GdkGraphics2D (this);
+    else
+        return new GdkGraphics (this);
   }
 
   public Point getLocationOnScreen () 
Index: gnu/java/awt/peer/gtk/GtkContainerPeer.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/gnu/java/awt/peer/gtk/GtkContainerPeer.java,v
retrieving revision 1.8.2.2
diff -u -r1.8.2.2 GtkContainerPeer.java
--- gnu/java/awt/peer/gtk/GtkContainerPeer.java	4 Mar 2004 21:29:24 -0000	1.8.2.2
+++ gnu/java/awt/peer/gtk/GtkContainerPeer.java	27 May 2004 17:57:11 -0000
@@ -107,10 +107,7 @@
 
   public Graphics getGraphics ()
   {
-    if (GtkToolkit.useGraphics2D ())
-        return new GdkGraphics2D (this);
-    else
-    return new GdkGraphics (this);
+    return super.getGraphics();
   }
 
   public void beginLayout () { }

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]