classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] [generics] Patch: FYI: java.awt.Font generics


From: Tom Tromey
Subject: [cp-patches] [generics] Patch: FYI: java.awt.Font generics
Date: Fri, 25 Nov 2005 15:27:47 -0700

I'm checking this in on the generics branch.

This genericizes java.awt.Font.

Tom

2005-11-25  Tom Tromey  <address@hidden>

        * java/awt/Font.java (Font): Genericized.
        (deriveFont): Likewise.
        (getAttributes): Likewise.
        (getFont): Likewise.

Index: java/awt/Font.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/awt/Font.java,v
retrieving revision 1.18.2.8
diff -u -r1.18.2.8 Font.java
--- java/awt/Font.java  2 Nov 2005 00:43:30 -0000       1.18.2.8
+++ java/awt/Font.java  25 Nov 2005 22:38:19 -0000
@@ -44,6 +44,7 @@
 import java.awt.font.FontRenderContext;
 import java.awt.font.GlyphVector;
 import java.awt.font.LineMetrics;
+import java.awt.font.TextAttribute;
 import java.awt.font.TextLayout;
 import java.awt.geom.AffineTransform;
 import java.awt.geom.Rectangle2D;
@@ -342,7 +343,7 @@
       this.name = peer.getName(this);
   }
 
-  public Font(Map attrs)
+  public Font(Map<? extends AttributedCharacterIterator.Attribute, ?> attrs)
   {
     this(null, attrs);
   }
@@ -760,7 +761,7 @@
    *
    * @since 1.2
    */
-  public Font deriveFont(Map attributes)
+  public Font deriveFont(Map<? extends AttributedCharacterIterator.Attribute, 
?> attributes)
   {
     return peer.deriveFont(this, attributes);
   }
@@ -774,7 +775,7 @@
    * @see java.text.AttributedCharacterIterator.Attribute
    * @see java.awt.font.TextAttribute
    */
-  public Map getAttributes()
+  public Map<TextAttribute, ?> getAttributes()
   {
     return peer.getAttributes(this);
   }
@@ -853,7 +854,7 @@
    *
    * @see java.awt.font.TextAttribute  
    */
-  public static Font getFont(Map attributes)
+  public static Font getFont(Map<? extends 
AttributedCharacterIterator.Attribute, ?> attributes)
   {
     return getFontFromToolkit(null, attributes);
   }





reply via email to

[Prev in Thread] Current Thread [Next in Thread]