[jboss-cvs] jboss-seam/src/pdf/org/jboss/seam/pdf/ui ...
Norman Richards
norman.richards at jboss.com
Mon Jan 8 13:11:41 EST 2007
User: nrichards
Date: 07/01/08 13:11:41
Modified: src/pdf/org/jboss/seam/pdf/ui UIAnchor.java
UIChapter.java UIImage.java UIList.java
UIListItem.java
Log:
more list support, etc...
Revision Changes Path
1.6 +0 -6 jboss-seam/src/pdf/org/jboss/seam/pdf/ui/UIAnchor.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: UIAnchor.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/pdf/org/jboss/seam/pdf/ui/UIAnchor.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- UIAnchor.java 3 Jan 2007 19:45:34 -0000 1.5
+++ UIAnchor.java 8 Jan 2007 18:11:41 -0000 1.6
@@ -1,13 +1,7 @@
package org.jboss.seam.pdf.ui;
-import javax.faces.event.*;
import javax.faces.context.*;
-import javax.faces.component.*;
-import javax.servlet.http.*;
-import java.io.*;
-
import com.lowagie.text.*;
-import com.lowagie.text.pdf.*;
public class UIAnchor
extends ITextComponent
1.4 +0 -6 jboss-seam/src/pdf/org/jboss/seam/pdf/ui/UIChapter.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: UIChapter.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/pdf/org/jboss/seam/pdf/ui/UIChapter.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- UIChapter.java 2 Jan 2007 03:40:32 -0000 1.3
+++ UIChapter.java 8 Jan 2007 18:11:41 -0000 1.4
@@ -1,13 +1,7 @@
package org.jboss.seam.pdf.ui;
-import javax.faces.event.*;
import javax.faces.context.*;
-import javax.faces.component.*;
-import javax.servlet.http.*;
-import java.io.*;
-
import com.lowagie.text.*;
-import com.lowagie.text.pdf.*;
public class UIChapter
extends ITextComponent
1.7 +71 -2 jboss-seam/src/pdf/org/jboss/seam/pdf/ui/UIImage.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: UIImage.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/pdf/org/jboss/seam/pdf/ui/UIImage.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- UIImage.java 3 Jan 2007 19:45:36 -0000 1.6
+++ UIImage.java 8 Jan 2007 18:11:41 -0000 1.7
@@ -5,8 +5,6 @@
import javax.faces.context.*;
import java.net.URL;
-import EDU.oswego.cs.dl.util.concurrent.Rendezvous.Rotator;
-
import com.lowagie.text.*;
public class UIImage
@@ -23,6 +21,14 @@
String alignment;
String alt;
+ Float indentationLeft;
+ Float indentationRight;
+ Float spacingBefore;
+ Float spacingAfter;
+ Float widthPercentage;
+ Float initialRotation;
+ String dpi;
+
Boolean wrap;
Boolean underlying;
@@ -59,6 +65,34 @@
}
+ public void setDpi(String dpi) {
+ this.dpi = dpi;
+ }
+
+ public void setIndentationLeft(Float indentationLeft) {
+ this.indentationLeft = indentationLeft;
+ }
+
+ public void setIndentationRight(Float indentationRight) {
+ this.indentationRight = indentationRight;
+ }
+
+ public void setInitialRotation(Float initialRotation) {
+ this.initialRotation = initialRotation;
+ }
+
+ public void setSpacingAfter(Float spacingAfter) {
+ this.spacingAfter = spacingAfter;
+ }
+
+ public void setSpacingBefore(Float spacingBefore) {
+ this.spacingBefore = spacingBefore;
+ }
+
+ public void setWidthPercentage(Float widthPercentage) {
+ this.widthPercentage = widthPercentage;
+ }
+
public Object getITextObject() {
return image;
}
@@ -113,6 +147,41 @@
if (alt != null) {
image.setAlt(alt);
}
+
+ indentationLeft = (Float) valueBinding(context, "indentationLeft", indentationLeft);
+ if (indentationLeft != null) {
+ image.setIndentationLeft(indentationLeft);
+ }
+
+ indentationRight = (Float) valueBinding(context, "indentationRight", indentationRight);
+ if (indentationRight != null) {
+ image.setIndentationRight(indentationRight);
+ }
+
+ spacingBefore = (Float) valueBinding(context, "spacingBefore", spacingBefore);
+ if (spacingBefore != null) {
+ image.setSpacingBefore(spacingBefore);
+ }
+
+ spacingAfter = (Float) valueBinding(context, "spacingAfter", spacingAfter);
+ if (spacingAfter != null) {
+ image.setSpacingAfter(spacingAfter);
+ }
+ widthPercentage = (Float) valueBinding(context, "widthPercentage", widthPercentage);
+ if (widthPercentage != null) {
+ image.setWidthPercentage(widthPercentage);
+ }
+
+ initialRotation = (Float) valueBinding(context, "initialRotation", initialRotation);
+ if (initialRotation != null) {
+ image.setInitialRotation(initialRotation);
+ }
+
+ dpi = (String) valueBinding(context, "dpi", dpi);
+ if (dpi != null) {
+ int[] dpiValues = ITextUtils.stringToIntArray(dpi);
+ image.setDpi(dpiValues[0], dpiValues[1]);
+ }
}
public void handleAdd(Object o) {
1.7 +24 -2 jboss-seam/src/pdf/org/jboss/seam/pdf/ui/UIList.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: UIList.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/pdf/org/jboss/seam/pdf/ui/UIList.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- UIList.java 3 Jan 2007 19:45:36 -0000 1.6
+++ UIList.java 8 Jan 2007 18:11:41 -0000 1.7
@@ -12,6 +12,8 @@
public static final String STYLE_LETTERED = "LETTERED";
public static final String STYLE_GREEK = "GREEK";
public static final String STYLE_ROMAN = "ROMAN";
+ public static final String STYLE_DINGBATS = "ZAPFDINGBATS";
+ public static final String STYLE_DINGBATS_NUMBER = "ZAPFDINGBATS_NUMBER";
List list;
@@ -19,6 +21,8 @@
String listSymbol;
float indent = 20;;
Boolean lowerCase = false;
+ Integer charNumber;
+ Integer numberType = 0;
public void setStyle(String style) {
this.style = style;
@@ -32,6 +36,16 @@
this.listSymbol = listSymbol;
}
+ /* for dingbats symbol list */
+ public void setCharNumber(Integer charNumber) {
+ this.charNumber = charNumber;
+ }
+
+ /* for dingbats number list */
+ public void setNumberType(Integer numberType) {
+ this.numberType = numberType;
+ }
+
/* for ROMAN,GREEK */
public void setLowerCase(Boolean lowerCase) {
this.lowerCase = lowerCase;
@@ -63,6 +77,14 @@
if (lowerCase != null) {
((GreekList) list).setGreekLower(lowerCase);
}
+ } else if (style.equalsIgnoreCase(STYLE_DINGBATS)) {
+ charNumber = (Integer) valueBinding(context, "charNumber", charNumber);
+ System.out.println("charNumber is " + charNumber);
+ list = new ZapfDingbatsList(charNumber, (int) indent);
+ } else if (style.equalsIgnoreCase(STYLE_DINGBATS_NUMBER)) {
+ numberType = (Integer) valueBinding(context, "numberType", numberType);
+ list = new ZapfDingbatsNumberList(numberType, (int) indent);
+
} else if (style.equalsIgnoreCase(STYLE_NUMBERED)) {
list = new List(true, indent);
//setFirst(int)
1.6 +51 -0 jboss-seam/src/pdf/org/jboss/seam/pdf/ui/UIListItem.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: UIListItem.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/pdf/org/jboss/seam/pdf/ui/UIListItem.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- UIListItem.java 3 Jan 2007 19:45:36 -0000 1.5
+++ UIListItem.java 8 Jan 2007 18:11:41 -0000 1.6
@@ -1,6 +1,9 @@
package org.jboss.seam.pdf.ui;
import javax.faces.context.*;
+
+import org.jboss.seam.pdf.ITextUtils;
+
import com.lowagie.text.*;
public class UIListItem
@@ -10,12 +13,60 @@
ListItem listItem;
+ String alignment;
+ Float indentationLeft;
+ Float indentationRight;
+ Integer listSymbol;
+
+ public void setListSymbol(Integer listSymbol) {
+ this.listSymbol = listSymbol;
+ }
+
+ public void setAlignment(String alignment) {
+ this.alignment = alignment;
+ }
+
+ public void setIndentationLeft(Float indentationLeft) {
+ this.indentationLeft = indentationLeft;
+ }
+
+ public void setIndentationRight(Float indentationRight) {
+ this.indentationRight = indentationRight;
+ }
+
public Object getITextObject() {
return listItem;
}
public void createITextObject(FacesContext context) {
listItem = new ListItem();
+
+ // should listSymbol be a facet?
+ listSymbol = (Integer) valueBinding(context, "listSymbol", listSymbol);
+ if (listSymbol != null) {
+ int symbol = (int) listSymbol;
+ Font font = getFont();
+ if (font == null) {
+ listItem.setListSymbol(new Chunk((char)symbol));
+ } else {
+ listItem.setListSymbol(new Chunk((char)symbol, font));
+ }
+ }
+
+ alignment = (String) valueBinding(context, "alignment", alignment);
+ if (alignment != null) {
+ listItem.setAlignment(ITextUtils.alignmentValue(alignment));
+ }
+
+ indentationLeft = (Float) valueBinding(context, "indentationLeft", indentationLeft);
+ if (indentationLeft != null) {
+ listItem.setIndentationLeft(indentationLeft);
+ }
+
+ indentationRight = (Float) valueBinding(context, "indentationRight", indentationRight);
+ if (indentationRight != null) {
+ listItem.setIndentationRight(indentationRight);
+ }
}
public void removeITextObject() {
More information about the jboss-cvs-commits
mailing list