[jboss-cvs] jboss-seam/src/pdf/org/jboss/seam/pdf ...
Norman Richards
norman.richards at jboss.com
Sun Dec 31 01:50:05 EST 2006
User: nrichards
Date: 06/12/31 01:50:05
Modified: src/pdf/org/jboss/seam/pdf ITextUtils.java
Log:
improved tables
Revision Changes Path
1.3 +33 -0 jboss-seam/src/pdf/org/jboss/seam/pdf/ITextUtils.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: ITextUtils.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/pdf/org/jboss/seam/pdf/ITextUtils.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- ITextUtils.java 26 Dec 2006 06:12:56 -0000 1.2
+++ ITextUtils.java 31 Dec 2006 06:50:05 -0000 1.3
@@ -3,7 +3,29 @@
import com.lowagie.text.*;
import com.lowagie.text.pdf.*;
+import java.awt.Color;
+import java.util.HashMap;
+import java.util.Map;
+
public class ITextUtils {
+ static Map<String,Color> colorMap = new HashMap<String,Color>();
+
+ static {
+ colorMap.put("white", Color.white);
+ colorMap.put("gray", Color.gray);
+ colorMap.put("lightgray", Color.lightGray);
+ colorMap.put("darkgray", Color.darkGray);
+ colorMap.put("black", Color.black);
+ colorMap.put("red", Color.red);
+ colorMap.put("pink", Color.pink);
+ colorMap.put("yellow", Color.yellow);
+ colorMap.put("green", Color.green);
+ colorMap.put("magenta", Color.magenta);
+ colorMap.put("cyan", Color.cyan);
+ colorMap.put("blue", Color.blue);
+ }
+
+
/**
* not all itext objects accept a string value as input,
* so we'll copy that logic here.
@@ -36,4 +58,15 @@
return Element.ALIGN_UNDEFINED;
}
+
+ /**
+ * return a color value from a string specification.
+ */
+ public static Color colorValue(String colorName) {
+ Color color = colorMap.get(colorName.toLowerCase());
+ if (color == null) {
+ color = Color.decode(colorName);
+ }
+ return color;
+ }
}
More information about the jboss-cvs-commits
mailing list