[kaffe] CVS kaffe (riccardo): added deriveFont() stubs

Kaffe CVS cvs-commits at kaffe.org
Tue May 2 13:52:25 PDT 2006


PatchSet 7279 
Date: 2006/05/02 20:38:47
Author: riccardo
Branch: HEAD
Tag: (none) 
Log:
added deriveFont() stubs

Members: 
	ChangeLog:1.4783->1.4784 
	libraries/javalib/awt-implementations/kaffe/java/awt/Font.java:1.3->1.4 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.4783 kaffe/ChangeLog:1.4784
--- kaffe/ChangeLog:1.4783	Tue May  2 14:32:28 2006
+++ kaffe/ChangeLog	Tue May  2 20:38:47 2006
@@ -1,5 +1,10 @@
 2006-05-02  Riccardo Mottola <riccardo at kaffe.org>
 
+	* libraries/javalib/awt-implementations/kaffe/java/awt/Font.java:
+	added deriveFont() stubs
+
+2006-05-02  Riccardo Mottola <riccardo at kaffe.org>
+
 	* libraries/javalib/awt-implementations/kaffe/java/awt/Component.java,
 	libraries/javalib/awt-implementations/kaffe/java/awt/Container.java:
 	fixed Containder add() methods.
Index: kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/Font.java
diff -u kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/Font.java:1.3 kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/Font.java:1.4
--- kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/Font.java:1.3	Tue Aug  9 14:03:39 2005
+++ kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/Font.java	Tue May  2 20:38:51 2006
@@ -2,11 +2,13 @@
 
 import gnu.classpath.Pointer;
 
+import java.awt.geom.AffineTransform;
 import java.awt.font.FontRenderContext;
 import java.awt.font.GlyphVector;
 import java.awt.peer.FontPeer;
 import java.io.Serializable;
 import java.text.CharacterIterator;
+import java.util.Map;
 
 /**
  * XXX: implement serial form! 
@@ -176,13 +178,21 @@
 	return getFont( key, null);
 }
 
-public static Font getFont ( String key, Font defFont ) {
-	String fSpec;
-
-	if ( (fSpec = System.getProperty( key)) != null )
-		return decode( fSpec);
-
-	return defFont;	
+/**
+* Returns a <code>Font</code> object from the passed property name.
+ *
+ * @param propname The name of the system property.
+ * @param defval Value to use if the property is not found.
+ *
+ * @return The requested font, or <code>default</code> if the property
+ * not exist or is malformed.
+ */
+public static Font getFont(String propname, Font defval)
+{
+    String propval = System.getProperty(propname);
+    if (propval != null)
+        return decode(propval);
+    return defval;
 }
 
 public String getName() {
@@ -226,6 +236,40 @@
 	return getClass().getName() + "[family=" +getFamily() + ",name=" + name
 	    + ",style=" + s + ",size=" + size + ']';
 }
+
+// TODO all these derive font methods should actually derive a font!
+public Font deriveFont(int style, float size)
+{
+    return this;
+}
+public Font deriveFont(float size)
+{
+    return this;
+}
+public Font deriveFont(int style)
+{
+    return this;
+}
+public Font deriveFont(int style, AffineTransform a)
+{
+    if (a == null)
+        throw new IllegalArgumentException("Affine transformation is null");
+
+    return this;
+}
+public Font deriveFont(AffineTransform a)
+{
+    if (a == null)
+        throw new IllegalArgumentException("Affine transformation is null");
+
+    return this;
+}
+
+public Font deriveFont(Map attributes)
+{
+    return this;
+}
+
 
 /* taken from GNU Classpath */
 public GlyphVector




More information about the kaffe mailing list