[kaffe] CVS kaffe (robilad): Resynced with GNU Classpath: metal plaf and awt fixes

Kaffe CVS cvs-commits at kaffe.org
Wed Jan 5 16:20:44 PST 2005


PatchSet 5780 
Date: 2005/01/06 00:15:31
Author: robilad
Branch: HEAD
Tag: (none) 
Log:
Resynced with GNU Classpath: metal plaf and awt fixes

Members: 
	ChangeLog:1.3324->1.3325 
	libraries/javalib/gnu/java/awt/peer/gtk/GtkToolkit.java:1.7->1.8 
	libraries/javalib/java/awt/Window.java:1.26->1.27 
	libraries/javalib/javax/swing/plaf/metal/DefaultMetalTheme.java:1.1->1.2 
	libraries/javalib/javax/swing/plaf/metal/MetalTheme.java:1.2->1.3 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.3324 kaffe/ChangeLog:1.3325
--- kaffe/ChangeLog:1.3324	Thu Jan  6 00:09:03 2005
+++ kaffe/ChangeLog	Thu Jan  6 00:15:31 2005
@@ -4,6 +4,49 @@
 
 	2004-12-30  Michael Koch  <konqueror at gmx.de>
 
+	* gnu/java/awt/peer/gtk/GtkToolkit.java:
+	Explicitely import used classes.
+	(getLocalGraphicsEnvironment): Simplify.
+	* java/awt/Window.java (Window):
+	Enable code to get the default GraphicsConfiguration.
+	
+2005-01-06  Dalibor Topic  <robilad at kaffe.org>
+
+	Resynced with GNU Classpath.
+
+	2004-12-30  Michael Koch  <konqueror at gmx.de>
+
+	* javax/swing/plaf/metal/DefaultMetalTheme.java
+	(CONTROL_TEXT_FONT): New static field.
+	(MENU_TEXT_FONT): Likewise.
+	(SUB_TEXT_FONT): Likewise.
+	(SYSTEM_TEXT_FONT): Likewise.
+	(USER_TEXT_FONT): Likewise.
+	(WINDOW_TITLE_FONT): Likewise.
+	(getControlTextFont): New method.
+	(getMenuTextFont): Likewise.
+	(getSubTextFont): Likewise.
+	(getSystemTextFont): Likewise.
+	(getUserTextFont): Likewise.
+	(getWindowTitleFont): Likewise.
+	* javax/swing/plaf/metal/MetalTheme.java
+	(BLACK): Initialize with Color.BLACK.
+	(WHITE): Initialize with Color.WHITE.
+	(getInactiveControlTextColor): Return getControlDisabled().
+	(getMenuDisabledForeground): Return getSecondary3().
+	(getControlTextFont): New abstract method.
+	(getMenuTextFont): Likewise.
+	(getSubTextFont): Likewise.
+	(getSystemTextFont): Likewise.
+	(getUserTextFont): Likewise.
+	(getWindowTitleFont): Likewise.
+	
+2005-01-06  Dalibor Topic  <robilad at kaffe.org>
+
+	Resynced with GNU Classpath.
+
+	2004-12-30  Michael Koch  <konqueror at gmx.de>
+
 	* java/text/DateFormat.java
 	(getAvailableLocales): Implemented.
 	* java/util/Locale.java
Index: kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GtkToolkit.java
diff -u kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GtkToolkit.java:1.7 kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GtkToolkit.java:1.8
--- kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GtkToolkit.java:1.7	Sun Nov 14 22:14:41 2004
+++ kaffe/libraries/javalib/gnu/java/awt/peer/gtk/GtkToolkit.java	Thu Jan  6 00:15:32 2005
@@ -59,12 +59,14 @@
 import java.awt.image.ImageObserver;
 import java.awt.image.ImageProducer;
 import java.awt.peer.*;
+import java.io.InputStream;
 import java.net.URL;
 import java.text.AttributedString;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Hashtable;
 import java.util.Iterator;
+import java.util.LinkedHashMap;
 import java.util.Map;
 import java.util.MissingResourceException;
 import java.util.Properties;
@@ -313,7 +315,7 @@
 			   "SansSerif" });
   }
 
-  private class LRUCache extends java.util.LinkedHashMap
+  private class LRUCache extends LinkedHashMap
   {    
     int max_entries;
     public LRUCache(int max)
@@ -613,15 +615,11 @@
 
   public GraphicsEnvironment getLocalGraphicsEnvironment()
   {
-    GraphicsEnvironment ge;
-    ge = new GdkGraphicsEnvironment ();  
-    return ge;
+    return new GdkGraphicsEnvironment();
   }
 
-  public Font createFont(int format, java.io.InputStream stream)
+  public Font createFont(int format, InputStream stream)
   {
-    throw new java.lang.UnsupportedOperationException ();
+    throw new UnsupportedOperationException();
   }
-
-
-} // class GtkToolkit
+}
Index: kaffe/libraries/javalib/java/awt/Window.java
diff -u kaffe/libraries/javalib/java/awt/Window.java:1.26 kaffe/libraries/javalib/java/awt/Window.java:1.27
--- kaffe/libraries/javalib/java/awt/Window.java:1.26	Wed Jan  5 20:16:27 2005
+++ kaffe/libraries/javalib/java/awt/Window.java	Thu Jan  6 00:15:32 2005
@@ -218,12 +218,11 @@
         && gc.getDevice().getType() != GraphicsDevice.TYPE_RASTER_SCREEN)
       throw new IllegalArgumentException ("gc must be from a screen device");
 
-    // FIXME: until we implement this, it just causes AWT to crash.
-//     if (gc == null)
-//       graphicsConfiguration = GraphicsEnvironment.getLocalGraphicsEnvironment()
-//         .getDefaultScreenDevice()
-//         .getDefaultConfiguration();
-//     else
+    if (gc == null)
+      graphicsConfiguration = GraphicsEnvironment.getLocalGraphicsEnvironment()
+                                                 .getDefaultScreenDevice()
+                                                 .getDefaultConfiguration();
+    else
       graphicsConfiguration = gc;
   }
 
Index: kaffe/libraries/javalib/javax/swing/plaf/metal/DefaultMetalTheme.java
diff -u kaffe/libraries/javalib/javax/swing/plaf/metal/DefaultMetalTheme.java:1.1 kaffe/libraries/javalib/javax/swing/plaf/metal/DefaultMetalTheme.java:1.2
--- kaffe/libraries/javalib/javax/swing/plaf/metal/DefaultMetalTheme.java:1.1	Thu Dec 23 02:43:14 2004
+++ kaffe/libraries/javalib/javax/swing/plaf/metal/DefaultMetalTheme.java	Thu Jan  6 00:15:33 2005
@@ -38,16 +38,38 @@
 
 package javax.swing.plaf.metal;
 
+import java.awt.Font;
+
 import javax.swing.plaf.ColorUIResource;
+import javax.swing.plaf.FontUIResource;
 
 public class DefaultMetalTheme extends MetalTheme
 {
-  private static final ColorUIResource PRIMARY1 = new ColorUIResource(102, 102, 153);
-  private static final ColorUIResource PRIMARY2 = new ColorUIResource(153, 153, 204);
-  private static final ColorUIResource PRIMARY3 = new ColorUIResource(204, 204, 255);
-  private static final ColorUIResource SECONDARY1 = new ColorUIResource(102, 102, 102);
-  private static final ColorUIResource SECONDARY2 = new ColorUIResource(153, 153, 153);
-  private static final ColorUIResource SECONDARY3 = new ColorUIResource(204, 204, 204);
+  private static final ColorUIResource PRIMARY1 =
+    new ColorUIResource(102, 102, 153);
+  private static final ColorUIResource PRIMARY2 =
+    new ColorUIResource(153, 153, 204);
+  private static final ColorUIResource PRIMARY3 = 
+    new ColorUIResource(204, 204, 255);
+  private static final ColorUIResource SECONDARY1 = 
+    new ColorUIResource(102, 102, 102);
+  private static final ColorUIResource SECONDARY2 = 
+    new ColorUIResource(153, 153, 153);
+  private static final ColorUIResource SECONDARY3 = 
+    new ColorUIResource(204, 204, 204);
+  
+  private static final FontUIResource CONTROL_TEXT_FONT =
+    new FontUIResource("Dialog", Font.BOLD, 12);
+  private static final FontUIResource MENU_TEXT_FONT =
+    new FontUIResource("Dialog", Font.BOLD, 12);
+  private static final FontUIResource SUB_TEXT_FONT =
+    new FontUIResource("Dialog", Font.PLAIN, 10);
+  private static final FontUIResource SYSTEM_TEXT_FONT =
+    new FontUIResource("Dialog", Font.PLAIN, 12);
+  private static final FontUIResource USER_TEXT_FONT =
+    new FontUIResource("Dialog", Font.PLAIN, 12);
+  private static final FontUIResource WINDOW_TITLE_FONT =
+    new FontUIResource("Dialog", Font.BOLD, 12);
   
   public DefaultMetalTheme()
   {
@@ -87,5 +109,35 @@
   protected ColorUIResource getSecondary3()
   {
     return SECONDARY3;
+  }
+
+  public FontUIResource getControlTextFont()
+  {
+    return CONTROL_TEXT_FONT;
+  }
+
+  public FontUIResource getMenuTextFont()
+  {
+    return MENU_TEXT_FONT;
+  }
+  
+  public FontUIResource getSubTextFont()
+  {
+    return SUB_TEXT_FONT;
+  }
+  
+  public FontUIResource getSystemTextFont()
+  {
+    return SYSTEM_TEXT_FONT;
+  }
+  
+  public FontUIResource getUserTextFont()
+  {
+    return USER_TEXT_FONT;
+  }
+  
+  public FontUIResource getWindowTitleFont()
+  {
+    return WINDOW_TITLE_FONT;
   }
 }
Index: kaffe/libraries/javalib/javax/swing/plaf/metal/MetalTheme.java
diff -u kaffe/libraries/javalib/javax/swing/plaf/metal/MetalTheme.java:1.2 kaffe/libraries/javalib/javax/swing/plaf/metal/MetalTheme.java:1.3
--- kaffe/libraries/javalib/javax/swing/plaf/metal/MetalTheme.java:1.2	Thu Dec 23 21:58:13 2004
+++ kaffe/libraries/javalib/javax/swing/plaf/metal/MetalTheme.java	Thu Jan  6 00:15:33 2005
@@ -39,13 +39,16 @@
 
 package javax.swing.plaf.metal;
 
+import java.awt.Color;
+
 import javax.swing.UIDefaults;
 import javax.swing.plaf.ColorUIResource;
+import javax.swing.plaf.FontUIResource;
 
 public abstract class MetalTheme
 {
-  private ColorUIResource BLACK = new ColorUIResource(0, 0, 0);
-  private ColorUIResource WHITE = new ColorUIResource(255, 255, 255);
+  private ColorUIResource BLACK = new ColorUIResource(Color.BLACK);
+  private ColorUIResource WHITE = new ColorUIResource(Color.WHITE);
 
   public MetalTheme()
   {
@@ -122,7 +125,7 @@
 
   public ColorUIResource getInactiveControlTextColor()
   {
-    return getSecondary2();
+    return getControlDisabled();
   }
 
   public ColorUIResource getInactiveSystemTextColor()
@@ -137,7 +140,7 @@
 
   public ColorUIResource getMenuDisabledForeground()
   {
-    return getSecondary2();
+    return getSecondary3();
   }
 
   public ColorUIResource getMenuForeground()
@@ -246,4 +249,11 @@
   protected abstract ColorUIResource getSecondary1();
   protected abstract ColorUIResource getSecondary2();
   protected abstract ColorUIResource getSecondary3();
+
+  public abstract FontUIResource getControlTextFont();
+  public abstract FontUIResource getMenuTextFont();
+  public abstract FontUIResource getSubTextFont();
+  public abstract FontUIResource getSystemTextFont();
+  public abstract FontUIResource getUserTextFont();
+  public abstract FontUIResource getWindowTitleFont();
 }




More information about the kaffe mailing list