[kaffe] CVS kaffe (robilad): Resynced with GNU Classpath: swing, awt, corba, and various other fixes

Kaffe CVS cvs-commits at kaffe.org
Sat Aug 13 15:09:56 PDT 2005


PatchSet 6822 
Date: 2005/08/13 21:45:38
Author: robilad
Branch: HEAD
Tag: (none) 
Log:
Resynced with GNU Classpath: swing, awt, corba, and various other fixes

Members: 
	ChangeLog:1.4346->1.4347 
	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c:1.11->1.12 
	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c:1.7->1.8 
	libraries/javalib/Makefile.am:1.381->1.382 
	libraries/javalib/Makefile.in:1.471->1.472 
	libraries/javalib/all.files:1.151->1.152 
	libraries/javalib/gnu/java/awt/peer/gtk/GtkButtonPeer.java:1.8->1.9 
	libraries/javalib/gnu/java/awt/peer/gtk/GtkComponentPeer.java:1.19->1.20 
	libraries/javalib/gnu/java/awt/peer/gtk/GtkLabelPeer.java:1.6->1.7 
	libraries/javalib/gnu/java/awt/peer/gtk/GtkMenuBarPeer.java:1.4->1.5 
	libraries/javalib/gnu/java/awt/peer/gtk/GtkMenuPeer.java:1.4->1.5 
	libraries/javalib/gnu/java/nio/charset/UTF_16Decoder.java:1.6->1.7 
	libraries/javalib/gnu/java/security/PolicyFile.java:1.8->1.9 
	libraries/javalib/java/awt/Component.java:1.57->1.58 
	libraries/javalib/java/awt/Container.java:1.38->1.39 
	libraries/javalib/java/awt/image/ConvolveOp.java:1.5->1.6 
	libraries/javalib/java/awt/peer/MenuBarPeer.java:1.4->1.5 
	libraries/javalib/java/awt/peer/MenuPeer.java:1.4->1.5 
	libraries/javalib/java/net/URLClassLoader.java:1.28->1.29 
	libraries/javalib/java/util/Observable.java:1.6->1.7 
	libraries/javalib/java/util/logging/Logger.java:1.10->1.11 
	libraries/javalib/javax/swing/JTable.java:1.27->1.28 
	libraries/javalib/javax/swing/plaf/basic/BasicLookAndFeel.java:1.21->1.22 
	libraries/javalib/javax/swing/plaf/basic/BasicSplitPaneUI.java:1.10->1.11 
	libraries/javalib/javax/swing/plaf/basic/BasicTableUI.java:1.12->1.13 
	libraries/javalib/javax/swing/plaf/basic/BasicViewportUI.java:1.9->1.10 
	libraries/javalib/javax/swing/text/GapContent.java:1.9->1.10 
	libraries/javalib/org/omg/PortableInterceptor/IORInfo.java:INITIAL->1.1 
	libraries/javalib/org/omg/PortableInterceptor/IORInfoOperations.java:INITIAL->1.1 
	libraries/javalib/org/omg/PortableInterceptor/IORInterceptor.java:INITIAL->1.1 
	libraries/javalib/org/omg/PortableInterceptor/IORInterceptorOperations.java:INITIAL->1.1 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.4346 kaffe/ChangeLog:1.4347
--- kaffe/ChangeLog:1.4346	Sat Aug 13 20:10:05 2005
+++ kaffe/ChangeLog	Sat Aug 13 21:45:38 2005
@@ -1,5 +1,153 @@
 2005-08-13  Dalibor Topic  <robilad at kaffe.org>
 
+	Resynced with GNU Classpath.
+
+	2005-08-12  Thomas Fitzsimmons  <fitzsim at redhat.com>
+
+        * gnu/java/awt/peer/gtk/GtkMenuBarPeer.java (addMenu(Menu)): New
+        method.
+        * gnu/java/awt/peer/gtk/GtkMenuPeer.java (addSeparator): Likewise.
+        * java/awt/peer/MenuBarPeer.java (addMenu): New method
+        declaration.
+        * java/awt/peer/MenuPeer.java (addSeparator): New method
+        declaration.
+
+	2005-08-12  Thomas Fitzsimmons  <fitzsim at redhat.com>
+
+        * gnu/java/awt/peer/gtk/GtkComponentPeer.java (setBounds): Get
+        frame insets directly from peer rather than from Window.getInsets.
+        (toString): New method.
+
+	2005-08-12  Thomas Fitzsimmons  <fitzsim at redhat.com>
+
+        * gnu/java/awt/peer/gtk/GtkButtonPeer.java,
+        native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c
+        (gtkWidgetGetPreferredDimensions): New method.
+        * gnu/java/awt/peer/gtk/GtkLabelPeer.java,
+        native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c
+        (gtkWidgetGetPreferredDimensions): New method.
+        * include/gnu_java_awt_peer_gtk_GtkLabelPeer.h: Regenerate.
+        * include/gnu_java_awt_peer_gtk_GtkButtonPeer.h: Likewise.
+
+	2005-08-12  Anthony Balkissoon  <abalkiss at redhat.com>
+
+        * javax/swing/JTable.java:
+        (setValueAt): Do nothing if isCellEditable returns false.
+        (editCelLAt): Removed the Key Listener for the JTextField.  Listening
+        for ESCAPE should be handled by the JTable itself.  Note, this is not
+        implemented yet.
+        * javax/swing/plaf/basic/BasicLookAndFeel.java:
+        (initComponentDefaults): Added several keybindings to JTable's
+        ancestorInputMap.  These are all implemented.
+        * javax/swing/plaf/basic/BasicTableUI.java:
+        (KeyHandler): Removed this class.  Note that most of the code from the
+        keyPressed method now resides in the actionPerformed method of the
+        BasicTableUI.TableAction class.
+        (convertModifiers): New private method to convert from new InputEvent
+        modifier masks to the old style.
+        (installKeyboardActions): Implemented.  Gets the key bindings from
+        the UIManager and registers them for the JTable.
+        (TableAction): New class.  This is where the actions corresponding to
+        key presses resides.
+        (installListeners): Removed installation of KeyListener.
+
+	2005-08-12  Lillian Angel  <langel at redhat.com>
+
+        * javax/swing/plaf/basic/BasicTreeUI.java
+        (getCellLocation): Added in a check to make sure the node has children.
+        Fixed loop to use post-increment.
+        (paintRecursive): Fixed loop to use post-increment.
+        (paintControlIcons): Likewise.
+        (getNextNode): Fixed check to make sure that node has children.
+        (getPreviousSibling): Added in check to make sure index is in correct
+        range.
+
+	2005-08-12  Roman Kennke  <roman at kennke.org>
+
+        * javax/swing/text/GapContent.java
+        (insertString): Use replace() to actually insert content.
+        (remove): Use replace() to actually remove content.
+        (shiftGap): Repaired misplaced curly brace in if block of
+        boudary check.
+        (replace): Check for null argument for addItems.
+
+	2005-08-12  Roman Kennke  <roman at kennke.org>
+
+        Reported by: Ingo Proetel  <proetel at aicas.com>
+        * java/net/URLClassLoader.java
+        (findClass): Added null check to avoid NullPointerException.
+
+	2005-08-12  Roman Kennke  <roman at kennke.org>
+
+        Reported by: Ingo Proetel  <proetel at aicas.com>
+        * java/util/logging/Logger.java
+        This applies to a couple of log() methods:
+        (log): Added check if the specified level is actually enabled,
+        otherwise ignore logging request.
+
+	2005-08-12  Lillian Angel  <langel at redhat.com>
+
+        * javax/swing/plaf/basic/BasicSplitPaneUI.java
+        * (getMinimumDividerLocation): Fixed to work similar to
+        getMaximumDividerLocation. Was not able to move divider
+        in both directions before.
+
+	2005-08-12  Roman Kennke  <roman at kennke.org>
+
+        * java/awt/Component.java
+        (reshape): Simplified repainting of parent.
+        (paint): Don't call peer.paint() here. The paint method is
+        exclusivly meant to be overridden by subclasses that wish to
+        perform custom painting and should do nothing by default.
+        (repaint): Use local variable in null pointer checks to avoid
+        NullPointerExceptions.
+        (imageUpdate): Slight formatting adjustments.
+        (dispatchEvent): Don't call peer.handleEvent() here, this must
+        be done in dispatchEventImpl().
+        (dispatchEventImpl): Dispatch PAINT and UPDATE events to the
+        peer.
+        * java/awt/Container.java
+        (paint): Don't call super.paint() here, this method does nothing
+        anyway. Visit only lightweight children.
+        (update): Instead of clearing the background only for top-level
+        containers, clear the background for all heavyweight containers.
+
+	2005-08-11  Tom Tromey  <tromey at redhat.com>
+
+        For PR classpath/23008:
+        * gnu/java/nio/charset/UTF_16Decoder.java (decodeLoop): Correctly
+        mask bytes when constructing characters.
+
+	2005-08-11  Audrius Meskauskas <AudriusA at Bioinformatics.org>
+
+        * org/omg/PortableInterceptor/IORInfoOperations.java,
+        org/omg/PortableInterceptor/IORInterceptor.java,
+        org/omg/PortableInterceptor/IORInterceptorOperations.java,
+        org/omg/PortableInterceptor/IORInfo.java: New files.
+
+	2005-08-11  Lillian Angel  <langel at redhat.com>
+
+        * javax/swing/JTable
+        (rowAtPoint): Added in a check for null. Was getting NPE.
+        (columnAtPoint): Likewise.
+
+	2005-08-11  Lillian Angel <langel at redhat.com>
+
+        * javax/swing/plaf/basic/BasicViewportUI.java
+        (paintSimple): Changed to paint the portBounds from (0,0).
+
+	2005-08-11  Tom Tromey  <tromey at redhat.com>
+
+        * java/awt/image/ConvolveOp.java (filter): Defer numBands check
+        until after null check.  PR classpath/22999.
+
+	2005-08-11  Tom Tromey  <tromey at redhat.com>
+
+        * java/util/Observable.java (addObserver): Throw
+        NullPointerException if necessary.  PR classpath/23279.
+
+2005-08-13  Dalibor Topic  <robilad at kaffe.org>
+
 	* libraries/clib/awt/Makefile.am:
 	Only des end into classpath-qt dir if it is selected for buiding.
 
Index: kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c
diff -u kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c:1.11 kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c:1.12
--- kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c:1.11	Tue Jul 26 16:22:02 2005
+++ kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c	Sat Aug 13 21:45:41 2005
@@ -86,6 +86,56 @@
   gdk_threads_leave ();
 }
 
+JNIEXPORT void JNICALL 
+Java_gnu_java_awt_peer_gtk_GtkButtonPeer_gtkWidgetGetPreferredDimensions
+  (JNIEnv *env, jobject obj, jintArray jdims)
+{
+  void *ptr;
+  jint *dims;
+  GtkWidget *button;
+  GtkWidget *label;
+  GtkRequisition current_req;
+  GtkRequisition current_label_req;
+  GtkRequisition natural_req;
+
+  gdk_threads_enter ();
+
+  ptr = NSA_GET_PTR (env, obj);
+
+  button = gtk_bin_get_child (GTK_BIN (ptr));
+  label = gtk_bin_get_child (GTK_BIN (button));
+
+  dims = (*env)->GetIntArrayElements (env, jdims, 0);
+  dims[0] = dims[1] = 0;
+
+  /* Save the button's current size request. */
+  gtk_widget_size_request (GTK_WIDGET (button), &current_req);
+
+  /* Save the label's current size request. */
+  gtk_widget_size_request (GTK_WIDGET (label), &current_label_req);
+
+  /* Get the widget's "natural" size request. */
+  gtk_widget_set_size_request (GTK_WIDGET (button), -1, -1);
+  gtk_widget_set_size_request (GTK_WIDGET (label), -1, -1);
+
+  gtk_widget_size_request (GTK_WIDGET (button), &natural_req);
+
+  /* Reset the button's size request. */
+  gtk_widget_set_size_request (GTK_WIDGET (button),
+                               current_req.width, current_req.height);
+
+  /* Reset the label's size request. */
+  gtk_widget_set_size_request (GTK_WIDGET (label),
+                               current_label_req.width, current_label_req.height);
+
+  dims[0] = natural_req.width;
+  dims[1] = natural_req.height;
+
+  (*env)->ReleaseIntArrayElements (env, jdims, dims, 0);
+
+  gdk_threads_leave ();
+}
+
 JNIEXPORT void JNICALL
 Java_gnu_java_awt_peer_gtk_GtkButtonPeer_connectSignals
   (JNIEnv *env, jobject obj)
Index: kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c
diff -u kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c:1.7 kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c:1.8
--- kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c:1.7	Tue Jul 26 16:22:03 2005
+++ kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c	Sat Aug 13 21:45:41 2005
@@ -66,6 +66,44 @@
   gdk_threads_leave ();
 }
 
+JNIEXPORT void JNICALL 
+Java_gnu_java_awt_peer_gtk_GtkLabelPeer_gtkWidgetGetPreferredDimensions
+  (JNIEnv *env, jobject obj, jintArray jdims)
+{
+  void *ptr;
+  jint *dims;
+  GtkWidget *label;
+  GtkRequisition current_req;
+  GtkRequisition natural_req;
+
+  gdk_threads_enter ();
+
+  ptr = NSA_GET_PTR (env, obj);
+
+  label = gtk_bin_get_child (GTK_BIN (ptr));
+
+  dims = (*env)->GetIntArrayElements (env, jdims, 0);  
+  dims[0] = dims[1] = 0;
+
+  /* Save the widget's current size request. */
+  gtk_widget_size_request (GTK_WIDGET (label), &current_req);
+
+  /* Get the widget's "natural" size request. */
+  gtk_widget_set_size_request (GTK_WIDGET (label), -1, -1);
+  gtk_widget_size_request (GTK_WIDGET (label), &natural_req);
+
+  /* Reset the widget's size request. */
+  gtk_widget_set_size_request (GTK_WIDGET (label),
+                               current_req.width, current_req.height);
+
+  dims[0] = natural_req.width;
+  dims[1] = natural_req.height;
+
+  (*env)->ReleaseIntArrayElements (env, jdims, dims, 0);
+
+  gdk_threads_leave ();
+}
+
 JNIEXPORT void JNICALL
 Java_gnu_java_awt_peer_gtk_GtkLabelPeer_gtkWidgetModifyFont
   (JNIEnv *env, jobject obj, jstring name, jint style, jint size)
Index: kaffe/libraries/javalib/Makefile.am
diff -u kaffe/libraries/javalib/Makefile.am:1.381 kaffe/libraries/javalib/Makefile.am:1.382
--- kaffe/libraries/javalib/Makefile.am:1.381	Sat Aug 13 15:39:26 2005
+++ kaffe/libraries/javalib/Makefile.am	Sat Aug 13 21:45:41 2005
@@ -4787,6 +4787,10 @@
 	org/omg/Messaging/SYNC_WITH_TRANSPORT.java \
 	org/omg/Messaging/SyncScopeHelper.java
 org_omg_PortableInterceptor_SRCS = \
+	org/omg/PortableInterceptor/IORInfo.java \
+	org/omg/PortableInterceptor/IORInfoOperations.java \
+	org/omg/PortableInterceptor/IORInterceptor.java \
+	org/omg/PortableInterceptor/IORInterceptorOperations.java \
 	org/omg/PortableInterceptor/Interceptor.java \
 	org/omg/PortableInterceptor/InterceptorOperations.java \
 	org/omg/PortableInterceptor/LOCATION_FORWARD.java \
Index: kaffe/libraries/javalib/Makefile.in
diff -u kaffe/libraries/javalib/Makefile.in:1.471 kaffe/libraries/javalib/Makefile.in:1.472
--- kaffe/libraries/javalib/Makefile.in:1.471	Sat Aug 13 15:39:26 2005
+++ kaffe/libraries/javalib/Makefile.in	Sat Aug 13 21:45:42 2005
@@ -5427,6 +5427,10 @@
 	org/omg/Messaging/SyncScopeHelper.java
 
 org_omg_PortableInterceptor_SRCS = \
+	org/omg/PortableInterceptor/IORInfo.java \
+	org/omg/PortableInterceptor/IORInfoOperations.java \
+	org/omg/PortableInterceptor/IORInterceptor.java \
+	org/omg/PortableInterceptor/IORInterceptorOperations.java \
 	org/omg/PortableInterceptor/Interceptor.java \
 	org/omg/PortableInterceptor/InterceptorOperations.java \
 	org/omg/PortableInterceptor/LOCATION_FORWARD.java \
Index: kaffe/libraries/javalib/all.files
diff -u kaffe/libraries/javalib/all.files:1.151 kaffe/libraries/javalib/all.files:1.152
--- kaffe/libraries/javalib/all.files:1.151	Sat Aug 13 15:39:27 2005
+++ kaffe/libraries/javalib/all.files	Sat Aug 13 21:45:46 2005
@@ -4133,6 +4133,10 @@
 org/omg/IOP/TransactionService.java
 org/omg/Messaging/SYNC_WITH_TRANSPORT.java
 org/omg/Messaging/SyncScopeHelper.java
+org/omg/PortableInterceptor/IORInfo.java
+org/omg/PortableInterceptor/IORInfoOperations.java
+org/omg/PortableInterceptor/IORInterceptor.java
+org/omg/PortableInterceptor/IORInterceptorOperations.java
 org/omg/PortableInterceptor/Interceptor.java
 org/omg/PortableInterceptor/InterceptorOperations.java
 org/omg/PortableInterceptor/LOCATION_FORWARD.java
Index: kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GtkButtonPeer.java
diff -u kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GtkButtonPeer.java:1.8 kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GtkButtonPeer.java:1.9
--- kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GtkButtonPeer.java:1.8	Mon Jul  4 00:05:22 2005
+++ kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GtkButtonPeer.java	Sat Aug 13 21:45:47 2005
@@ -46,6 +46,9 @@
 import java.awt.event.MouseEvent;
 import java.awt.peer.ButtonPeer;
 
+// A composite widget.  GtkButtons have transparent backgrounds.  An
+// AWT Button is opaque.  To compensate, a GtkButtonPeer is a
+// GtkButton packed in a GtkEventBox.
 public class GtkButtonPeer extends GtkComponentPeer
     implements ButtonPeer
 {
@@ -60,6 +63,11 @@
   native void gtkActivate ();
   native void gtkWidgetRequestFocus ();
   native void setNativeBounds (int x, int y, int width, int height);
+
+  // Because this is a composite widget, we need to retrieve the
+  // GtkButton's preferred dimensions, not the enclosing
+  // GtkEventBox's.
+  native void gtkWidgetGetPreferredDimensions (int[] dim);
 
   public GtkButtonPeer (Button b)
   {
Index: kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GtkComponentPeer.java
diff -u kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GtkComponentPeer.java:1.19 kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GtkComponentPeer.java:1.20
--- kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GtkComponentPeer.java:1.19	Sat Jul 30 16:39:14 2005
+++ kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GtkComponentPeer.java	Sat Aug 13 21:45:47 2005
@@ -418,6 +418,9 @@
 
   public void setBounds (int x, int y, int width, int height)
   {
+    int new_x = x;
+    int new_y = y;
+
     Component parent = awtComponent.getParent ();
 
     // Heavyweight components that are children of one or more
@@ -438,8 +441,8 @@
 
 	i = ((Container) parent).getInsets ();
 
-	x += parent.getX () + i.left;
-	y += parent.getY () + i.top;
+	new_x += parent.getX () + i.left;
+	new_y += parent.getY () + i.top;
 
 	parent = parent.getParent ();
       }
@@ -448,18 +451,22 @@
     // placing a heavyweight component in a Window.
     if (parent instanceof Window && !lightweightChild)
       {
-	Insets insets = ((Window) parent).getInsets ();
         GtkWindowPeer peer = (GtkWindowPeer) parent.getPeer ();
+        // important: we want the window peer's insets here, not the
+        // window's, since user sub-classes of Window can override
+        // getInset and we only want to correct for the frame borders,
+        // not for any user-defined inset values
+        Insets insets = peer.getInsets ();
+
         int menuBarHeight = 0;
         if (peer instanceof GtkFramePeer)
           menuBarHeight = ((GtkFramePeer) peer).getMenuBarHeight ();
 
-        // Convert from Java coordinates to GTK coordinates.
-        setNativeBounds (x - insets.left, y - insets.top + menuBarHeight,
-                         width, height);
+        new_x = x - insets.left;
+        new_y = y - insets.top + menuBarHeight;
       }
-    else
-      setNativeBounds (x, y, width, height);
+
+    setNativeBounds (new_x, new_y, width, height);
   }
 
   void setCursor ()
@@ -670,5 +677,10 @@
   public void destroyBuffers ()
   {
     backBuffer.flush();
+  }
+  
+  public String toString ()
+  {
+    return "peer of " + awtComponent.toString();
   }
 }
Index: kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GtkLabelPeer.java
diff -u kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GtkLabelPeer.java:1.6 kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GtkLabelPeer.java:1.7
--- kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GtkLabelPeer.java:1.6	Mon Jul  4 00:05:24 2005
+++ kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GtkLabelPeer.java	Sat Aug 13 21:45:47 2005
@@ -41,6 +41,9 @@
 import java.awt.Label;
 import java.awt.peer.LabelPeer;
 
+// A composite widget.  GtkLabels have transparent backgrounds.  An
+// AWT Label is opaque.  To compensate, a GtkLabelPeer is a GtkLabel
+// packed in a GtkEventBox.
 public class GtkLabelPeer extends GtkComponentPeer
     implements LabelPeer
 {
@@ -50,6 +53,10 @@
 
   public native void setText(String text);
   native void setNativeBounds (int x, int y, int width, int height);
+
+  // Because this is a composite widget, we need to retrieve the
+  // GtkLabel's preferred dimensions, not the enclosing GtkEventBox's.
+  native void gtkWidgetGetPreferredDimensions (int[] dim);
 
   void create ()
   {
Index: kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GtkMenuBarPeer.java
diff -u kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GtkMenuBarPeer.java:1.4 kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GtkMenuBarPeer.java:1.5
--- kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GtkMenuBarPeer.java:1.4	Mon Jul  4 00:05:25 2005
+++ kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GtkMenuBarPeer.java	Sat Aug 13 21:45:47 2005
@@ -77,4 +77,9 @@
   }
 
   public native void delMenu(int index);
+
+  public void addMenu (Menu m)
+  {
+    // FIXME: implement
+  }
 }
Index: kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GtkMenuPeer.java
diff -u kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GtkMenuPeer.java:1.4 kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GtkMenuPeer.java:1.5
--- kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GtkMenuPeer.java:1.4	Mon Jul  4 00:05:25 2005
+++ kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GtkMenuPeer.java	Sat Aug 13 21:45:47 2005
@@ -100,4 +100,9 @@
   }
 
   public native void delItem(int index);
+
+  public void addSeparator()
+  {
+    // FIXME: implement
+  }
 }
Index: kaffe/libraries/javalib/gnu/java/nio/charset/UTF_16Decoder.java
diff -u kaffe/libraries/javalib/gnu/java/nio/charset/UTF_16Decoder.java:1.6 kaffe/libraries/javalib/gnu/java/nio/charset/UTF_16Decoder.java:1.7
--- kaffe/libraries/javalib/gnu/java/nio/charset/UTF_16Decoder.java:1.6	Mon Jul  4 00:05:35 2005
+++ kaffe/libraries/javalib/gnu/java/nio/charset/UTF_16Decoder.java	Sat Aug 13 21:45:47 2005
@@ -1,5 +1,5 @@
 /* UTF_16Decoder.java -- 
-   Copyright (C) 2002 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2005 Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -133,8 +133,9 @@
                   return CoderResult.UNDERFLOW;
                 byte b3 = in.get ();
                 byte b4 = in.get ();
-                char d = byteOrder == BIG_ENDIAN ? (char) ((b3 << 8) | b4)
-                                                 : (char) ((b4 << 8) | b3);
+                char d = (byteOrder == BIG_ENDIAN
+			  ? (char) (((b3 & 0xFF) << 8) | (b4 & 0xFF))
+			  : (char) (((b4 & 0xFF) << 8) | (b3 & 0xFF)));
                 // make sure d is a low surrogate
                 if (d < 0xDC00 || d > 0xDFFF)
                   return CoderResult.malformedForLength (2);
Index: kaffe/libraries/javalib/gnu/java/security/PolicyFile.java
diff -u kaffe/libraries/javalib/gnu/java/security/PolicyFile.java:1.8 kaffe/libraries/javalib/gnu/java/security/PolicyFile.java:1.9
--- kaffe/libraries/javalib/gnu/java/security/PolicyFile.java:1.8	Tue Aug  9 22:48:37 2005
+++ kaffe/libraries/javalib/gnu/java/security/PolicyFile.java	Sat Aug 13 21:45:48 2005
@@ -220,8 +220,8 @@
                   logger.log (Component.POLICY, "java.security.policy={0}", s);
                   if (s != null)
                     {
-                      boolean only;
-                      if (only = s.startsWith ("="))
+                      boolean only = s.startsWith ("=");
+                      if (only)
                         s = s.substring (1);
                       policyFiles.clear ();
                       policyFiles.add (new URL (s));
Index: kaffe/libraries/javalib/java/awt/Component.java
diff -u kaffe/libraries/javalib/java/awt/Component.java:1.57 kaffe/libraries/javalib/java/awt/Component.java:1.58
--- kaffe/libraries/javalib/java/awt/Component.java:1.57	Mon Aug  8 02:52:22 2005
+++ kaffe/libraries/javalib/java/awt/Component.java	Sat Aug 13 21:45:49 2005
@@ -1404,9 +1404,6 @@
     // Erase old bounds and repaint new bounds for lightweights.
     if (isLightweight() && isShowing ())
       {
-        boolean shouldRepaintParent = false;
-        boolean shouldRepaintSelf = false;
-
         if (parent != null)
           {
             Rectangle parentBounds = parent.getBounds();
@@ -1416,14 +1413,11 @@
             Rectangle newBounds = new Rectangle(parent.getX() + x,
                                                 parent.getY() + y,
                                                 width, height);
-            shouldRepaintParent = parentBounds.intersects(oldBounds);
-            shouldRepaintSelf = parentBounds.intersects(newBounds);
+            Rectangle destroyed = oldBounds.union(newBounds);
+            if (!destroyed.isEmpty())
+              parent.repaint(0, destroyed.x, destroyed.y, destroyed.width,
+                             destroyed.height);
           }
-
-        if (shouldRepaintParent && parent != null)
-          parent.repaint(oldx, oldy, oldwidth, oldheight);
-        if (shouldRepaintSelf)
-          repaint();
       }
 
     // Only post event if this component is visible and has changed size.
@@ -1830,9 +1824,8 @@
    */
   public void paint(Graphics g)
   {
-    // Paint the heavyweight peer
-    if (!isLightweight() && peer != null)
-      peer.paint(g);
+    // This is a callback method and is meant to be overridden by subclasses
+    // that want to perform custom painting.
   }
 
   /**
@@ -1858,7 +1851,8 @@
   {
     // Tests show that the clearing of the background is only done in
     // two cases:
-    // - If the component is lightwight (yes this is in contrast to the spec).
+    // - If the component is lightweight (yes this is in contrast to the spec).
+    // or
     // - If the component is a toplevel container.
     if (isLightweight() || getParent() == null)
       {
@@ -1943,14 +1937,18 @@
    */
   public void repaint(long tm, int x, int y, int width, int height)
   {
-    // Handle lightweight repainting by forwarding to native parent
-    if (isLightweight() && parent != null)
+    if(!isShowing())
       {
-        if (parent != null)
-          parent.repaint(tm, x + getX(), y + getY(), width, height);
+        Component p = parent;
+        if (p != null)
+          p.repaint(tm, x + getX(), y + getY(), width, height);
+      }
+    else
+      {
+        ComponentPeer p = peer;
+        if (p != null)
+          p.repaint(tm, x, y, width, height);
       }
-    else if (peer != null)
-      peer.repaint(tm, x, y, width, height);
   }
 
   /**
@@ -2011,7 +2009,7 @@
   public boolean imageUpdate(Image img, int flags, int x, int y, int w, int h)
   {
     if ((flags & (FRAMEBITS | ALLBITS)) != 0)
-      repaint ();
+      repaint();
     else if ((flags & SOMEBITS) != 0)
       {
 	if (incrementalDraw)
@@ -2021,10 +2019,10 @@
 		long tm = redrawRate.longValue();
 		if (tm < 0)
 		  tm = 0;
-		repaint (tm);
+                repaint(tm);
 	      }
 	    else
-	      repaint (100);
+              repaint(100);
 	  }
       }
     return (flags & (ALLBITS | ABORT | ERROR)) == 0;
@@ -2322,8 +2320,6 @@
     // Some subclasses in the AWT package need to override this behavior,
     // hence the use of dispatchEventImpl().
     dispatchEventImpl(e);
-    if (peer != null && ! e.consumed)
-      peer.handleEvent(e);
   }
 
   /**
@@ -4786,7 +4782,7 @@
    * @param e the event to dispatch
    */
 
-  void dispatchEventImpl (AWTEvent e)
+  void dispatchEventImpl(AWTEvent e)
   {
     Event oldEvent = translateEvent (e);
 
@@ -4820,7 +4816,10 @@
                 break;
               }
           }
-        processEvent (e);
+        if (e.id == PaintEvent.PAINT || e.id == PaintEvent.UPDATE)
+          peer.handleEvent(e);
+        else
+          processEvent(e);
       }
   }
 
Index: kaffe/libraries/javalib/java/awt/Container.java
diff -u kaffe/libraries/javalib/java/awt/Container.java:1.38 kaffe/libraries/javalib/java/awt/Container.java:1.39
--- kaffe/libraries/javalib/java/awt/Container.java:1.38	Thu Aug 11 01:18:49 2005
+++ kaffe/libraries/javalib/java/awt/Container.java	Sat Aug 13 21:45:49 2005
@@ -42,6 +42,7 @@
 import java.awt.event.ContainerListener;
 import java.awt.event.KeyEvent;
 import java.awt.event.MouseEvent;
+import java.awt.peer.ComponentPeer;
 import java.awt.peer.ContainerPeer;
 import java.awt.peer.LightweightPeer;
 import java.beans.PropertyChangeListener;
@@ -757,11 +758,10 @@
   {
     if (!isShowing())
       return;
-    // Paint self first.
-    super.paint(g);
+
     // Visit heavyweights as well, in case they were
     // erased when we cleared the background for this container.
-    visitChildren(g, GfxPaintVisitor.INSTANCE, true);
+    visitChildren(g, GfxPaintVisitor.INSTANCE, false);
   }
 
   /**
@@ -776,17 +776,26 @@
    * @specnote The specification suggests that this method forwards the
    *           update() call to all its lightweight children. Tests show
    *           that this is not done either in the JDK. The exact behaviour
-   *           seems to be that top-level container call super.update()
-   *           (causing the background to be cleared), and all other containers
+   *           seems to be that the background is cleared in heavyweight
+   *           Containers, and all other containers
    *           directly call paint(), causing the (lightweight) children to
    *           be painted.
    */
   public void update(Graphics g)
   {
-    if (getParent() == null)
-      super.update(g);
-    else
-      paint(g);
+    // It seems that the JDK clears the background of containers like Panel
+    // and Window (within this method) but not of 'plain' Containers or
+    // JComponents. This could
+    // lead to the assumption that it only clears heavyweight containers.
+    // However that is not quite true. In a test with a custom Container
+    // that overrides isLightweight() to return false, the background is
+    // also not cleared. So we do a check on !(peer instanceof LightweightPeer)
+    // instead.
+    ComponentPeer p = peer;
+    if (p != null && !(p instanceof LightweightPeer))
+      g.clearRect(0, 0, getWidth(), getHeight());
+
+    paint(g);
   }
 
   /**
Index: kaffe/libraries/javalib/java/awt/image/ConvolveOp.java
diff -u kaffe/libraries/javalib/java/awt/image/ConvolveOp.java:1.5 kaffe/libraries/javalib/java/awt/image/ConvolveOp.java:1.6
--- kaffe/libraries/javalib/java/awt/image/ConvolveOp.java:1.5	Sat Jul 30 16:39:17 2005
+++ kaffe/libraries/javalib/java/awt/image/ConvolveOp.java	Sat Aug 13 21:45:49 2005
@@ -1,5 +1,5 @@
 /* ConvolveOp.java --
-   Copyright (C) 2004 Free Software Foundation -- ConvolveOp
+   Copyright (C) 2004, 2005 Free Software Foundation -- ConvolveOp
 
 This file is part of GNU Classpath.
 
@@ -191,8 +191,6 @@
    * java.awt.image.WritableRaster)
    */
   public WritableRaster filter(Raster src, WritableRaster dest) {
-    if (src.numBands != dest.numBands)
-      throw new ImagingOpException(null);
     if (src == dest)
       throw new IllegalArgumentException();
     if (src.getWidth() < kernel.getWidth() ||
@@ -201,6 +199,8 @@
     
     if (dest == null)
       dest = createCompatibleDestRaster(src);
+    else if (src.numBands != dest.numBands)
+      throw new ImagingOpException(null);
 
     // Deal with bottom edge
     if (edge == EDGE_ZERO_FILL)
Index: kaffe/libraries/javalib/java/awt/peer/MenuBarPeer.java
diff -u kaffe/libraries/javalib/java/awt/peer/MenuBarPeer.java:1.4 kaffe/libraries/javalib/java/awt/peer/MenuBarPeer.java:1.5
--- kaffe/libraries/javalib/java/awt/peer/MenuBarPeer.java:1.4	Mon Jul  4 00:06:23 2005
+++ kaffe/libraries/javalib/java/awt/peer/MenuBarPeer.java	Sat Aug 13 21:45:50 2005
@@ -42,6 +42,7 @@
 
 public interface MenuBarPeer extends MenuComponentPeer
 {
+  void addMenu(Menu m);
   void addHelpMenu(Menu menu);
   void delMenu(int index);
 } // interface MenuBarPeer 
Index: kaffe/libraries/javalib/java/awt/peer/MenuPeer.java
diff -u kaffe/libraries/javalib/java/awt/peer/MenuPeer.java:1.4 kaffe/libraries/javalib/java/awt/peer/MenuPeer.java:1.5
--- kaffe/libraries/javalib/java/awt/peer/MenuPeer.java:1.4	Mon Jul  4 00:06:23 2005
+++ kaffe/libraries/javalib/java/awt/peer/MenuPeer.java	Sat Aug 13 21:45:50 2005
@@ -43,6 +43,7 @@
 public interface MenuPeer extends MenuItemPeer
 {
   void addItem (MenuItem item);
+  void addSeparator ();
   void delItem (int index);
 }
 
Index: kaffe/libraries/javalib/java/net/URLClassLoader.java
diff -u kaffe/libraries/javalib/java/net/URLClassLoader.java:1.28 kaffe/libraries/javalib/java/net/URLClassLoader.java:1.29
--- kaffe/libraries/javalib/java/net/URLClassLoader.java:1.28	Sat Jul 30 16:39:19 2005
+++ kaffe/libraries/javalib/java/net/URLClassLoader.java	Sat Aug 13 21:45:50 2005
@@ -900,7 +900,11 @@
         else
           result = defineClass(className, classData, 0, classData.length, source);
 
-        super.setSigners(result, resource.getCertificates());
+        // Avoid NullPointerExceptions.
+        Certificate[] resourceCertificates = resource.getCertificates();
+        if(resourceCertificates != null)
+          super.setSigners(result, resourceCertificates);
+        
         return result;
       }
     catch (IOException ioe)
Index: kaffe/libraries/javalib/java/util/Observable.java
diff -u kaffe/libraries/javalib/java/util/Observable.java:1.6 kaffe/libraries/javalib/java/util/Observable.java:1.7
--- kaffe/libraries/javalib/java/util/Observable.java:1.6	Mon Jul  4 00:07:26 2005
+++ kaffe/libraries/javalib/java/util/Observable.java	Sat Aug 13 21:45:50 2005
@@ -77,6 +77,8 @@
    */
   public synchronized void addObserver(Observer observer)
   {
+    if (observer == null)
+      throw new NullPointerException("can't add null observer");
     observers.add(observer);
   }
 
Index: kaffe/libraries/javalib/java/util/logging/Logger.java
diff -u kaffe/libraries/javalib/java/util/logging/Logger.java:1.10 kaffe/libraries/javalib/java/util/logging/Logger.java:1.11
--- kaffe/libraries/javalib/java/util/logging/Logger.java:1.10	Sat Jul 30 16:39:21 2005
+++ kaffe/libraries/javalib/java/util/logging/Logger.java	Sat Aug 13 21:45:51 2005
@@ -577,7 +577,8 @@
 
   public void log(Level level, String message)
   {
-    log(level, message, (Object[]) null);
+    if (isLoggable(level))
+      log(level, message, (Object[]) null);
   }
 
 
@@ -585,12 +586,15 @@
 			       String message,
 			       Object param)
   {
-    StackTraceElement caller = getCallerStackFrame();
-    logp(level,
-	 caller != null ? caller.getClassName() : "<unknown>",
-	 caller != null ? caller.getMethodName() : "<unknown>",
-	 message,
-	 param);
+    if (isLoggable(level))
+      {
+        StackTraceElement caller = getCallerStackFrame();
+        logp(level,
+             caller != null ? caller.getClassName() : "<unknown>",
+             caller != null ? caller.getMethodName() : "<unknown>",
+             message,
+             param);
+      }
   }
 
 
@@ -598,12 +602,15 @@
 			       String message,
 			       Object[] params)
   {
-    StackTraceElement caller = getCallerStackFrame();
-    logp(level,
-	 caller != null ? caller.getClassName() : "<unknown>",
-	 caller != null ? caller.getMethodName() : "<unknown>",
-	 message,
-	 params);
+    if (isLoggable(level))
+      {
+        StackTraceElement caller = getCallerStackFrame();
+        logp(level,
+             caller != null ? caller.getClassName() : "<unknown>",
+             caller != null ? caller.getMethodName() : "<unknown>",
+             message,
+             params);
+      }
   }
 
 
@@ -611,12 +618,15 @@
 			       String message,
 			       Throwable thrown)
   {
-    StackTraceElement caller = getCallerStackFrame();    
-    logp(level,
-	 caller != null ? caller.getClassName() : "<unknown>",
-	 caller != null ? caller.getMethodName() : "<unknown>",
-	 message,
-	 thrown);
+    if (isLoggable(level))
+      {
+        StackTraceElement caller = getCallerStackFrame();    
+        logp(level,
+             caller != null ? caller.getClassName() : "<unknown>",
+             caller != null ? caller.getMethodName() : "<unknown>",
+             message,
+             thrown);
+      }
   }
 
 
Index: kaffe/libraries/javalib/javax/swing/JTable.java
diff -u kaffe/libraries/javalib/javax/swing/JTable.java:1.27 kaffe/libraries/javalib/javax/swing/JTable.java:1.28
--- kaffe/libraries/javalib/javax/swing/JTable.java:1.27	Thu Aug 11 01:18:49 2005
+++ kaffe/libraries/javalib/javax/swing/JTable.java	Sat Aug 13 21:45:51 2005
@@ -910,20 +910,23 @@
    */
   public int columnAtPoint(Point point)
   {
-    int x0 = getLocation().x;
-    int ncols = getColumnCount();
-    Dimension gap = getIntercellSpacing();
-    TableColumnModel cols = getColumnModel();
-    int x = point.x;
-    
-    for (int i = 0; i < ncols; ++i)
+    if (point != null)
       {
-        int width = cols.getColumn(i).getWidth() + (gap == null ? 0 : gap.width);
-        if (0 <= x && x < width)
-          return i;
-        x -= width;  
+        int x0 = getLocation().x;
+        int ncols = getColumnCount();
+        Dimension gap = getIntercellSpacing();
+        TableColumnModel cols = getColumnModel();
+        int x = point.x;
+
+        for (int i = 0; i < ncols; ++i)
+          {
+            int width = cols.getColumn(i).getWidth()
+                        + (gap == null ? 0 : gap.width);
+            if (0 <= x && x < width)
+              return i;
+            x -= width;
+          }
       }
-    
     return -1;
   }
 
@@ -937,19 +940,21 @@
    */
   public int rowAtPoint(Point point)
   {
-    int y0 = getLocation().y;
-    int nrows = getRowCount();
-    Dimension gap = getIntercellSpacing();
-    int height = getRowHeight() + (gap == null ? 0 : gap.height);
-    int y = point.y;
-    
-    for (int i = 0; i < nrows; ++i)
+    if (point != null)
       {
-        if (0 <= y && y < height)
-          return i;
-        y -= height;
+        int y0 = getLocation().y;
+        int nrows = getRowCount();
+        Dimension gap = getIntercellSpacing();
+        int height = getRowHeight() + (gap == null ? 0 : gap.height);
+        int y = point.y;
+
+        for (int i = 0; i < nrows; ++i)
+          {
+            if (0 <= y && y < height)
+              return i;
+            y -= height;
+          }
       }
-      
     return -1;
   }
 
@@ -2217,6 +2222,9 @@
 
   public void setValueAt(Object value, int row, int column)
   {
+    if (!isCellEditable(row, column))
+      return;
+
     if (value instanceof Component)
       add((Component)value);
     dataModel.setValueAt(value, row, convertColumnIndexToModel(column));
@@ -2322,14 +2330,6 @@
     oldCellValue = getValueAt(row, column);
     setCellEditor(getCellEditor(row, column));
     editorComp = prepareEditor(cellEditor, row, column);
-    editorComp.addKeyListener(new KeyAdapter() {
-        public void keyPressed(KeyEvent e) {
-          if (e.getKeyCode() == KeyEvent.VK_ESCAPE) {
-            if (JTable.this.cellEditor != null)
-              JTable.this.cellEditor.cancelCellEditing();
-          }
-        }
-      });
     cellEditor.addCellEditorListener(this);
     rowBeingEdited = row;
     columnBeingEdited = column;
Index: kaffe/libraries/javalib/javax/swing/plaf/basic/BasicLookAndFeel.java
diff -u kaffe/libraries/javalib/javax/swing/plaf/basic/BasicLookAndFeel.java:1.21 kaffe/libraries/javalib/javax/swing/plaf/basic/BasicLookAndFeel.java:1.22
--- kaffe/libraries/javalib/javax/swing/plaf/basic/BasicLookAndFeel.java:1.21	Mon Aug  8 02:52:26 2005
+++ kaffe/libraries/javalib/javax/swing/plaf/basic/BasicLookAndFeel.java	Sat Aug 13 21:45:52 2005
@@ -886,13 +886,24 @@
         "shift KP_DOWN", "selectNextRowExtendSelection",
         "shift KP_LEFT", "selectPreviousColumnExtendSelection",
         "ESCAPE",  "cancel",
-        "ctrl shift PAGE_UP", "scrollRightExtendSelection",
+        "ctrl shift PAGE_UP", "scrollLeftExtendSelection",
         "shift KP_RIGHT", " selectNextColumnExtendSelection",
         "ctrl PAGE_UP",  "scrollLeftChangeSelection",

*** Patch too long, truncated ***




More information about the kaffe mailing list