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

Kaffe CVS cvs-commits at kaffe.org
Sun Jul 3 08:16:56 PDT 2005


PatchSet 6687 
Date: 2005/07/03 15:10:25
Author: robilad
Branch: HEAD
Tag: (none) 
Log:
Resynced with GNU Classpath: awt, swing fixes

Members: 
	ChangeLog:1.4212->1.4213 
	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c:1.9->1.10 
	libraries/javalib/gnu/java/awt/peer/gtk/GdkPixbufDecoder.java:1.8->1.9 
	libraries/javalib/gnu/java/awt/peer/gtk/GtkImage.java:1.6->1.7 
	libraries/javalib/gnu/xml/aelfred2/XmlParser.java:1.16->1.17 
	libraries/javalib/java/util/logging/Logger.java:1.6->1.7 
	libraries/javalib/javax/swing/GrayFilter.java:1.3->1.4 
	libraries/javalib/javax/swing/JDialog.java:1.5->1.6 
	libraries/javalib/javax/swing/JFrame.java:1.8->1.9 
	libraries/javalib/javax/swing/JInternalFrame.java:1.11->1.12 
	libraries/javalib/javax/swing/JScrollPane.java:1.12->1.13 
	libraries/javalib/javax/swing/SwingUtilities.java:1.16->1.17 
	libraries/javalib/javax/swing/plaf/basic/BasicInternalFrameUI.java:1.5->1.6 
	libraries/javalib/javax/swing/plaf/basic/BasicLabelUI.java:1.2->1.3 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.4212 kaffe/ChangeLog:1.4213
--- kaffe/ChangeLog:1.4212	Sun Jul  3 15:00:38 2005
+++ kaffe/ChangeLog	Sun Jul  3 15:10:25 2005
@@ -2,6 +2,97 @@
 
 	Resynced with GNU Classpath.
 
+	2005-06-23  Sven de Marothy  <sven at physto.se>
+
+        * gnu/java/awt/peer/gtk/GtkImage.java: Don't draw 0 size images.
+
+	2005-06-23  Sven de Marothy  <sven at physto.se>
+
+        * gnu/java/awt/peer/gtk/GtkImage.java: Add case source size > size.
+
+	2005-06-22  Mark Wielaard  <mark at klomp.org>
+
+        * gnu/java/awt/peer/gtk/GdkPixbufDecoder.java
+        (pumpBytes): Throws IOException.
+        (pumpDone): New native method.
+        (produce): Call pumpDone().
+        * include/gnu_java_awt_peer_gtk_GdkPixbufDecoder.h: Regenerated.
+        * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c
+        (Java_gnu_java_awt_peer_gtk_GdkPixbufDecoder_pumpDone): New method.
+        (Java_gnu_java_awt_peer_gtk_GdkPixbufDecoder_pumpBytes): Check for
+        errors on gdk_pixbuf_loader_write.
+
+	2005-06-22  Anthony Balkissoon  <abalkiss at redhat.com>
+
+        * javax/swing/plaf/basic/BasicInternalFrameUI.java:
+        (InternalFramePropertyChangeListener.vetoableChange):
+        Repaint the JDesktopPane when JInternalFrame is closed.
+        Also veto the close request, because hiding is not
+        closing.
+
+	2005-06-22  Anthony Balkissoon  <abalkiss at redhat.com>
+
+        * javax/swing/SwingUtilities.java:
+        (layoutCompoundLabel): Added check for multi-line text.
+
+	2005-06-22  Anthony Balkissoon  <abalkiss at redhat.com>
+
+        * javax/swing/JDialog.java:
+        (setDefaultCloseOperation): Removed validity check for
+        operation code.  Validity is handled in processWindowEvent.
+        * javax/swing/JFrame.java:
+        (setDefaultCloseOperation): Changed error message to be more
+        descriptive and similar to reference implementation.
+        * javax/swing/JInternalFrame.java:
+        (setDefaultCloseOperation): Removed validity check for
+        operation code.
+        * javax/swing/plaf/basic/BasicInternalFrameUI.java:
+        (InternalFramePropertyListener): Added implementation of
+        VetoableChangeListener.
+        (InternalFramePropertyListener.vetoableChange): New method.
+        (InternalFramePropertyListener.propertyChange): Removed
+        check for JInternalFrame.IS_CLOSED_PROPERTY.  This is now
+        handled in vetoableChange.
+        (getDesktopManager): Added a check for null pointer from
+        JInternalFrame.getDesktopPane().
+
+	2005-06-22  Roman Kennke  <roman at kennke.org>
+
+        * javax/swing/plaf/basic/BasicLabelUI.java
+        (installDefaults): JLabels are not opaque by default.
+
+	2005-06-22  Roman Kennke  <roman at kennke.org>
+
+        * javax/swing/GrayFilter.java
+        (constructor): Compute factor at initialization time.
+        (createDisabledImage): Initialize GrayFilter with correct arguments.
+        (filterRGB): Reworked filter method. This is now compliant with
+        the JDK behaviour.
+
+	2005-06-22  Mark Wielaard  <mark at klomp.org>
+
+        Fixes bug #13439
+        * javax/swing/JScrollPane.java (JScrollPane(Component,int,int)):
+        Set viewport, view and scrollLostener manually.
+
+	2005-06-21  Lillian Angel  <langel at redhat.com>
+
+        * java/util/logging/Logger.java
+        (setParent): No lines after throwing an exception are executed
+        and there is no point to check if the parent is null, because a
+        NullPointerException would have been thrown earlier. Fixes Bug
+        #13460.
+
+	2005-06-21  Lillian Angel  <langel at redhat.com>
+
+        * gnu/xml/aelfred2/XmlParser
+        (parseAttribute): if (type.equals("CDATA") || type == null)
+        this would always throw a NullPointerException if type is null.
+
+2005-07-03  Dalibor Topic  <robilad at kaffe.org>
+
+	Resynced with GNU Classpath.
+
 	2005-06-20  Mark Wielaard  <mark at klomp.org>
 
         * javax/swing/DefaultDesktopManager.java (getBoundsForIconOf):
Index: kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c
diff -u kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c:1.9 kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c:1.10
--- kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c:1.9	Sat May 21 19:03:11 2005
+++ kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c	Sun Jul  3 15:10:28 2005
@@ -1,5 +1,5 @@
 /* gdkpixbufdecoder.c
-   Copyright (C) 1999, 2003, 2004 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2003, 2004, 2005 Free Software Foundation, Inc.
 
    This file is part of GNU Classpath.
    
@@ -41,6 +41,7 @@
 #include <gdk-pixbuf/gdk-pixbuf-loader.h>
 
 #include <jni.h>
+#include <jcl.h>
 #include "native_state.h"
 #include "gnu_java_awt_peer_gtk_GdkPixbufDecoder.h"
 
@@ -72,8 +73,7 @@
   jint width, height;
 
   GdkPixbuf *pixbuf = gdk_pixbuf_loader_get_pixbuf (loader);
-  if (pixbuf == NULL)
-    return;
+  g_assert (pixbuf != NULL);
 
   width = gdk_pixbuf_get_width (pixbuf); 
   height = gdk_pixbuf_get_height (pixbuf);
@@ -311,6 +311,26 @@
   gdk_pixbuf_loader_close (loader, NULL);
   g_object_unref (loader);
   gdk_threads_leave (); 
+
+}
+
+JNIEXPORT void JNICALL
+Java_gnu_java_awt_peer_gtk_GdkPixbufDecoder_pumpDone
+(JNIEnv *env, jobject obj)
+{
+  GError *err = NULL;
+  GdkPixbufLoader *loader = (GdkPixbufLoader *)NSA_GET_PB_PTR (env, obj);
+  g_assert (loader != NULL);
+
+  gdk_threads_enter ();
+  gdk_pixbuf_loader_close (loader, &err);
+  gdk_threads_leave ();
+
+  if (err != NULL)
+    {
+      JCL_ThrowException (env, "java/io/IOException", err->message);
+      g_error_free (err);
+    }
 }
 
 struct stream_save_request
@@ -423,15 +443,17 @@
   (*env)->ReleaseIntArrayElements (env, jarr, ints, 0);
 }
 
+
 JNIEXPORT void JNICALL
 Java_gnu_java_awt_peer_gtk_GdkPixbufDecoder_pumpBytes
   (JNIEnv *env, jobject obj, jbyteArray jarr, jint len)
 {
   GdkPixbufLoader *loader = NULL;
   jbyte *bytes = NULL;
+  GError *err = NULL;
 
-  if (len < 1)
-    return;
+  g_assert (len >= 1);
+  g_assert (jarr != NULL);
 
   bytes = (*env)->GetByteArrayElements (env, jarr, NULL);
   g_assert (bytes != NULL);
@@ -439,8 +461,14 @@
   g_assert (loader != NULL);
 
   gdk_threads_enter ();
-  gdk_pixbuf_loader_write (loader, (const guchar *) bytes, len, NULL);
+  gdk_pixbuf_loader_write (loader, (const guchar *) bytes, len, &err);
   gdk_threads_leave ();
 
   (*env)->ReleaseByteArrayElements (env, jarr, bytes, 0);
+
+  if (err != NULL)
+    {
+      JCL_ThrowException (env, "java/io/IOException", err->message);
+      g_error_free (err);
+    }
 }
Index: kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GdkPixbufDecoder.java
diff -u kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GdkPixbufDecoder.java:1.8 kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GdkPixbufDecoder.java:1.9
--- kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GdkPixbufDecoder.java:1.8	Sat Feb 19 15:30:25 2005
+++ kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GdkPixbufDecoder.java	Sun Jul  3 15:10:29 2005
@@ -90,7 +90,8 @@
 
   // interface to GdkPixbuf
   native void initState ();
-  native void pumpBytes (byte[] bytes, int len);
+  native void pumpBytes (byte[] bytes, int len) throws IOException;
+  native void pumpDone () throws IOException;
   native void finish ();
   static native void streamImage(int[] bytes, String format, int width, int height, boolean hasAlpha, DataOutput sink);
   
@@ -165,6 +166,7 @@
     initState();
     while ((len = is.read (bytes)) != -1)
       pumpBytes (bytes, len);
+    pumpDone();
     
     for (int i = 0; i < curr.size (); i++)
       {
Index: kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GtkImage.java
diff -u kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GtkImage.java:1.6 kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GtkImage.java:1.7
--- kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GtkImage.java:1.6	Sat Jun 11 21:09:32 2005
+++ kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GtkImage.java	Sun Jul  3 15:10:29 2005
@@ -375,18 +375,33 @@
     int dstY = (dy1 < dy2) ? dy1 : dy2;
 
     // Clipping. This requires the dst to be scaled as well, 
+    if (srcWidth > width)
+      {
+	dstWidth = (int)((double)dstWidth*((double)width/(double)srcWidth));
+	srcWidth = width - srcX;
+      }
+
+    if (srcHeight > height) 
+      {
+	dstHeight = (int)((double)dstHeight*((double)height/(double)srcHeight));
+	srcHeight = height - srcY;
+      }
+
     if (srcWidth + srcX > width)
       {
 	dstWidth = (int)((double)dstWidth * (double)(width - srcX)/(double)srcWidth);
 	srcWidth = width - srcX;
-    }
+      }
 
     if (srcHeight + srcY > height)
       {
 	dstHeight = (int)((double)dstHeight * (double)(width - srcY)/(double)srcHeight);
 	srcHeight = height - srcY;
       }
-    
+
+    if ( srcWidth <= 0 || srcHeight <= 0 || dstWidth <= 0 || dstHeight <= 0)
+      return true;
+
     if(bgcolor != null)
       drawPixelsScaledFlipped (g, bgcolor.getRed (), bgcolor.getGreen (), 
 			       bgcolor.getBlue (), 
Index: kaffe/libraries/javalib/gnu/xml/aelfred2/XmlParser.java
diff -u kaffe/libraries/javalib/gnu/xml/aelfred2/XmlParser.java:1.16 kaffe/libraries/javalib/gnu/xml/aelfred2/XmlParser.java:1.17
--- kaffe/libraries/javalib/gnu/xml/aelfred2/XmlParser.java:1.16	Mon Apr 18 17:56:59 2005
+++ kaffe/libraries/javalib/gnu/xml/aelfred2/XmlParser.java	Sun Jul  3 15:10:29 2005
@@ -1437,7 +1437,7 @@
       }
     else
       {
-        if (type.equals("CDATA") || type == null)
+        if (type == null || type.equals("CDATA"))
           {
             value = readLiteral(flags);
           }
Index: kaffe/libraries/javalib/java/util/logging/Logger.java
diff -u kaffe/libraries/javalib/java/util/logging/Logger.java:1.6 kaffe/libraries/javalib/java/util/logging/Logger.java:1.7
--- kaffe/libraries/javalib/java/util/logging/Logger.java:1.6	Thu Apr 28 23:45:17 2005
+++ kaffe/libraries/javalib/java/util/logging/Logger.java	Sun Jul  3 15:10:30 2005
@@ -1150,13 +1150,8 @@
     lm = LogManager.getLogManager();
 
     if (this == lm.rootLogger)
-    {
-      if (parent != null)
         throw new IllegalArgumentException(
           "only the root logger can have a null parent");
-      this.parent = null;
-      return;
-    }
 
     /* An application is allowed to control an anonymous logger
      * without having the permission to control the logging
Index: kaffe/libraries/javalib/javax/swing/GrayFilter.java
diff -u kaffe/libraries/javalib/javax/swing/GrayFilter.java:1.3 kaffe/libraries/javalib/javax/swing/GrayFilter.java:1.4
--- kaffe/libraries/javalib/javax/swing/GrayFilter.java:1.3	Sun Jul  3 15:00:43 2005
+++ kaffe/libraries/javalib/javax/swing/GrayFilter.java	Sun Jul  3 15:10:30 2005
@@ -46,7 +46,7 @@
 public class GrayFilter extends RGBImageFilter
 {
   private boolean b;
-  private int p;
+  private double p;
 
   /**
    * Create a GrayFilter. If b is true then brighten. Also, indicate how much
@@ -58,7 +58,7 @@
   public GrayFilter(boolean b, int p)
   {
     this.b = b; //FIXME - HANDLE THIS
-    this.p = p;
+    this.p = (1. - (p / 100.)) / 3.;
   }
 
   /**
@@ -72,7 +72,7 @@
   {
     return (Toolkit.getDefaultToolkit().
 	    createImage(new FilteredImageSource(src.getSource(),
-						new GrayFilter(false, 100))));
+						new GrayFilter(true, 0))));
   }
   
   /**
@@ -80,7 +80,13 @@
    */
   public int filterRGB(int x, int y, int rgb)
   {
-    return (int) (p * (0.299 * ((0xff0000 & rgb) >> 16)
-		       + 0.587 * ((0xff00 & rgb) >> 8) + 0.114 * (0xff & rgb)));
+    int alpha = 0xff000000 & rgb;
+    int red = (0xff0000 & rgb) >> 16;
+    int green = (0xff00 & rgb) >> 8;
+    int blue = (0xff & rgb);
+    int gray = (int) ((0.299 * red + 0.587 * green + 0.114 * blue) * p);
+    if (b)
+      gray = Math.min(gray + 128, 255);
+    return gray | gray << 8 | gray << 16 | alpha ;
   }
 }
Index: kaffe/libraries/javalib/javax/swing/JDialog.java
diff -u kaffe/libraries/javalib/javax/swing/JDialog.java:1.5 kaffe/libraries/javalib/javax/swing/JDialog.java:1.6
--- kaffe/libraries/javalib/javax/swing/JDialog.java:1.5	Sun Jul  3 14:37:56 2005
+++ kaffe/libraries/javalib/javax/swing/JDialog.java	Sun Jul  3 15:10:30 2005
@@ -547,14 +547,12 @@
    */
   public void setDefaultCloseOperation(int operation)
   {
-    if (operation == DO_NOTHING_ON_CLOSE ||
-    	operation == HIDE_ON_CLOSE ||
-	operation == DISPOSE_ON_CLOSE)
-      close_action = operation;
-    else
-      // accept illegal value and set the property to the default value,
-      // that's what the reference implementation does
-      close_action = DO_NOTHING_ON_CLOSE;
+    /* Reference implementation allows invalid operations
+       to be specified.  If so, getDefaultCloseOperation
+       must return the invalid code, and the behaviour
+       defaults to DO_NOTHING_ON_CLOSE.  processWindowEvent
+       above handles this */
+    close_action = operation;
   }
 
   /**
Index: kaffe/libraries/javalib/javax/swing/JFrame.java
diff -u kaffe/libraries/javalib/javax/swing/JFrame.java:1.8 kaffe/libraries/javalib/javax/swing/JFrame.java:1.9
--- kaffe/libraries/javalib/javax/swing/JFrame.java:1.8	Sun Jul  3 14:37:56 2005
+++ kaffe/libraries/javalib/javax/swing/JFrame.java	Sun Jul  3 15:10:30 2005
@@ -342,7 +342,7 @@
 
     if (operation != EXIT_ON_CLOSE && operation != DISPOSE_ON_CLOSE
         && operation != HIDE_ON_CLOSE && operation != DO_NOTHING_ON_CLOSE)
-      throw new IllegalArgumentException("operation = " + operation);
+      throw new IllegalArgumentException("defaultCloseOperation must be EXIT_ON_CLOSE, HIDE_ON_CLOSE, DISPOSE_ON_CLOSE, or DO_NOTHING_ON_CLOSE");
 
     close_action = operation;
   }
Index: kaffe/libraries/javalib/javax/swing/JInternalFrame.java
diff -u kaffe/libraries/javalib/javax/swing/JInternalFrame.java:1.11 kaffe/libraries/javalib/javax/swing/JInternalFrame.java:1.12
--- kaffe/libraries/javalib/javax/swing/JInternalFrame.java:1.11	Sun Jul  3 14:37:56 2005
+++ kaffe/libraries/javalib/javax/swing/JInternalFrame.java	Sun Jul  3 15:10:30 2005
@@ -1305,10 +1305,10 @@
    */
   public void setDefaultCloseOperation(int operation)
   {
-    if (operation != DO_NOTHING_ON_CLOSE
-	&& operation != HIDE_ON_CLOSE
-        && operation != DISPOSE_ON_CLOSE)
-      throw new Error("Close operation must be one of DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE, or DISPOSE_ON_CLOSE");
+    /* Reference implementation allows invalid operations to be specified.
+       In that case, behaviour defaults to DO_NOTHING_ON_CLOSE.
+       processWindowEvent handles the behaviour. getDefaultCloseOperation
+       must return the invalid operator code. */
     defaultCloseOperation = operation;
   }
 
Index: kaffe/libraries/javalib/javax/swing/JScrollPane.java
diff -u kaffe/libraries/javalib/javax/swing/JScrollPane.java:1.12 kaffe/libraries/javalib/javax/swing/JScrollPane.java:1.13
--- kaffe/libraries/javalib/javax/swing/JScrollPane.java:1.12	Sun Jul  3 15:00:44 2005
+++ kaffe/libraries/javalib/javax/swing/JScrollPane.java	Sun Jul  3 15:10:30 2005
@@ -588,7 +588,11 @@
     setVerticalScrollBar(createVerticalScrollBar());
     setHorizontalScrollBarPolicy(hsbPolicy);
     setHorizontalScrollBar(createHorizontalScrollBar());
-    setViewportView(view);
+    viewport = createViewport();
+    if (view != null)
+      getViewport().setView(view);
+    viewport.addChangeListener(scrollListener);
+    add(viewport);
     setLayout(new ScrollPaneLayout());
     setOpaque(false);
     updateUI();
Index: kaffe/libraries/javalib/javax/swing/SwingUtilities.java
diff -u kaffe/libraries/javalib/javax/swing/SwingUtilities.java:1.16 kaffe/libraries/javalib/javax/swing/SwingUtilities.java:1.17
--- kaffe/libraries/javalib/javax/swing/SwingUtilities.java:1.16	Sat Jun 11 20:59:48 2005
+++ kaffe/libraries/javalib/javax/swing/SwingUtilities.java	Sun Jul  3 15:10:30 2005
@@ -848,8 +848,14 @@
       }
     else
       {
+        int fromIndex = 0;
         textR.width = fm.stringWidth(text);
         textR.height = fm.getHeight(); 
+        while (text.indexOf('\n', fromIndex) != -1)
+          {
+            textR.height += fm.getHeight();
+            fromIndex = text.indexOf('\n', fromIndex) + 1;
+          }
       }
 
     // Work out the position of text and icon, assuming the top-left coord
Index: kaffe/libraries/javalib/javax/swing/plaf/basic/BasicInternalFrameUI.java
diff -u kaffe/libraries/javalib/javax/swing/plaf/basic/BasicInternalFrameUI.java:1.5 kaffe/libraries/javalib/javax/swing/plaf/basic/BasicInternalFrameUI.java:1.6
--- kaffe/libraries/javalib/javax/swing/plaf/basic/BasicInternalFrameUI.java:1.5	Sat Jun 11 21:09:33 2005
+++ kaffe/libraries/javalib/javax/swing/plaf/basic/BasicInternalFrameUI.java	Sun Jul  3 15:10:30 2005
@@ -53,6 +53,8 @@
 import java.awt.event.MouseEvent;
 import java.beans.PropertyChangeEvent;
 import java.beans.PropertyChangeListener;
+import java.beans.PropertyVetoException;
+import java.beans.VetoableChangeListener;
 
 import javax.swing.DefaultDesktopManager;
 import javax.swing.DesktopManager;
@@ -864,8 +866,32 @@
    * JInternalFrame.
    */
   public class InternalFramePropertyChangeListener
-    implements PropertyChangeListener
+    implements PropertyChangeListener, VetoableChangeListener
   {
+
+    /**
+     * This method is called when one of the JInternalFrame's properties
+     * change.  This method is to allow JInternalFrame to veto an attempt
+     * to close the internal frame.  This allows JInternalFrame to honour
+     * its defaultCloseOperation if that is DO_NOTHING_ON_CLOSE.
+     */
+    public void vetoableChange(PropertyChangeEvent e) throws PropertyVetoException
+    {
+      if (e.getPropertyName().equals(JInternalFrame.IS_CLOSED_PROPERTY))
+        {
+          if (frame.getDefaultCloseOperation() == JInternalFrame.HIDE_ON_CLOSE)
+            {
+              frame.setVisible(false);
+              frame.getDesktopPane().repaint();
+              throw new PropertyVetoException ("close operation is HIDE_ON_CLOSE\n", e);
+            }
+          else if (frame.getDefaultCloseOperation() == JInternalFrame.DISPOSE_ON_CLOSE)
+            closeFrame(frame);
+          else
+            throw new PropertyVetoException ("close operation is DO_NOTHING_ON_CLOSE\n", e);
+        }
+    }
+    
     /**
      * This method is called when one of the JInternalFrame's properties
      * change.
@@ -881,8 +907,6 @@
 	  else
 	    minimizeFrame(frame);
         }
-      else if (evt.getPropertyName().equals(JInternalFrame.IS_CLOSED_PROPERTY))
-	closeFrame(frame);
       else if (evt.getPropertyName().equals(JInternalFrame.IS_ICON_PROPERTY))
         {
 	  if (frame.isIcon())
@@ -1031,6 +1055,13 @@
    */
   protected PropertyChangeListener propertyChangeListener;
 
+  /**
+   * The VetoableChangeListener.  Listens to PropertyChangeEvents
+   * from the JInternalFrame and allows the JInternalFrame to 
+   * veto attempts to close it.
+   */
+  private VetoableChangeListener internalFrameVetoableChangeListener;
+
   /** The InternalFrameListener that listens to the JInternalFrame. */
   private transient BasicInternalFrameListener internalFrameListener;
 
@@ -1171,12 +1202,13 @@
     borderListener = createBorderListener(frame);
     componentListener = createComponentListener();
     propertyChangeListener = createPropertyChangeListener();
+    internalFrameVetoableChangeListener = new InternalFramePropertyChangeListener();
 
     frame.addMouseListener(borderListener);
     frame.addMouseMotionListener(borderListener);
     frame.addInternalFrameListener(internalFrameListener);
     frame.addPropertyChangeListener(propertyChangeListener);
-
+    frame.addVetoableChangeListener(internalFrameVetoableChangeListener);
     frame.getRootPane().getGlassPane().addMouseListener(glassPaneDispatcher);
     frame.getRootPane().getGlassPane().addMouseMotionListener(glassPaneDispatcher);
   }
@@ -1552,7 +1584,10 @@
    */
   protected DesktopManager getDesktopManager()
   {
-    DesktopManager value = frame.getDesktopPane().getDesktopManager();
+    DesktopManager value = null;
+    JDesktopPane pane = frame.getDesktopPane();
+    if (pane != null)
+      value = frame.getDesktopPane().getDesktopManager();
     if (value == null)
       value = createDesktopManager();
     return value;
Index: kaffe/libraries/javalib/javax/swing/plaf/basic/BasicLabelUI.java
diff -u kaffe/libraries/javalib/javax/swing/plaf/basic/BasicLabelUI.java:1.2 kaffe/libraries/javalib/javax/swing/plaf/basic/BasicLabelUI.java:1.3
--- kaffe/libraries/javalib/javax/swing/plaf/basic/BasicLabelUI.java:1.2	Sun Aug  8 19:46:06 2004
+++ kaffe/libraries/javalib/javax/swing/plaf/basic/BasicLabelUI.java	Sun Jul  3 15:10:31 2005
@@ -351,7 +351,6 @@
     c.setBackground(defaults.getColor("Label.background"));
     c.setFont(defaults.getFont("Label.font"));
     c.setBorder(defaults.getBorder("Label.border"));
-    c.setOpaque(true);
     //XXX: There are properties we don't use called disabledForeground
     //and disabledShadow.
   }




More information about the kaffe mailing list