[jboss-cvs] jboss-seam/src/pdf/org/jboss/seam/pdf/ui ...
Norman Richards
norman.richards at jboss.com
Wed Jan 3 14:45:36 EST 2007
User: nrichards
Date: 07/01/03 14:45:36
Modified: src/pdf/org/jboss/seam/pdf/ui UIAnchor.java
UICell.java UIFont.java UIImage.java UIList.java
UIListItem.java UIPage.java UIParagraph.java
UISection.java UITable.java
Log:
bindings
Revision Changes Path
1.5 +2 -0 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.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- UIAnchor.java 2 Jan 2007 03:40:32 -0000 1.4
+++ UIAnchor.java 3 Jan 2007 19:45:34 -0000 1.5
@@ -37,10 +37,12 @@
public void createITextObject(FacesContext context) {
anchor = new Anchor();
+ name = (String) valueBinding(context, "name", name);
if (name != null) {
anchor.setName(name);
}
+ reference = (String) valueBinding(context, "reference", reference);
if (reference != null) {
anchor.setReference(reference);
}
1.6 +76 -13 jboss-seam/src/pdf/org/jboss/seam/pdf/ui/UICell.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: UICell.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/pdf/org/jboss/seam/pdf/ui/UICell.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- UICell.java 2 Jan 2007 03:40:32 -0000 1.5
+++ UICell.java 3 Jan 2007 19:45:34 -0000 1.6
@@ -206,107 +206,170 @@
} else {
cell = new PdfPCell();
}
+
+ horizontalAlignment = (String) valueBinding(context, "horizontalAlignment", horizontalAlignment);
if (horizontalAlignment != null) {
cell.setHorizontalAlignment(ITextUtils.alignmentValue(horizontalAlignment));
}
+
+ verticalAlignment = (String) valueBinding(context, "verticalAlignment", verticalAlignment);
if (verticalAlignment != null) {
cell.setVerticalAlignment(ITextUtils.alignmentValue(verticalAlignment));
}
+
+ padding = (Float) valueBinding(context, "padding", padding);
if (padding != null) {
cell.setPadding(padding);
}
+
+ paddingLeft = (Float) valueBinding(context, "paddingLeft", paddingLeft);
if (paddingLeft != null) {
cell.setPaddingLeft(paddingLeft);
}
+
+ paddingRight = (Float) valueBinding(context, "paddingRight", paddingRight);
if (paddingRight != null) {
cell.setPaddingRight(paddingRight);
}
+
+ paddingTop = (Float) valueBinding(context, "paddingTop", paddingTop);
if (paddingTop != null) {
cell.setPaddingTop(paddingTop);
}
+
+ paddingBottom = (Float) valueBinding(context, "paddingBottom", paddingBottom);
if (paddingBottom != null) {
cell.setPaddingBottom(paddingBottom);
}
+
+ useBorderPadding = (Boolean) valueBinding(context, "userBorderPadding", useBorderPadding);
if (useBorderPadding != null) {
cell.setUseBorderPadding(useBorderPadding);
}
+
+ leading = (Float) valueBinding(context, "leading", leading);
+ multipliedLeading = (Float) valueBinding(context, "multipliedLeading", multipliedLeading);
if (leading != null || multipliedLeading != null) {
cell.setLeading(leading == null ? 0 : leading.floatValue(),
multipliedLeading==null ? 0 : multipliedLeading.floatValue());
}
+
+ indent = (Float) valueBinding(context, "indent", indent);
if (indent != null) {
cell.setIndent(indent);
}
+
+ extraParagraphSpace = (Float) valueBinding(context, "extraParagraphSpace", extraParagraphSpace);
if (extraParagraphSpace != null) {
cell.setExtraParagraphSpace(extraParagraphSpace);
}
+
+ fixedHeight = (Float) valueBinding(context, "fixedHeight", fixedHeight);
if (fixedHeight != null) {
cell.setFixedHeight(fixedHeight);
}
+
+ noWrap = (Boolean) valueBinding(context, "noWrap", noWrap);
if (noWrap != null) {
cell.setNoWrap(noWrap);
}
+
+ minimumHeight = (Float) valueBinding(context, "minimumHeight", minimumHeight);
if (minimumHeight != null) {
cell.setMinimumHeight(minimumHeight);
}
+
+ colspan = (Integer) valueBinding(context, "colspan", colspan);
if (colspan != null) {
cell.setColspan(colspan);
}
+
+ followingIndent = (Float) valueBinding(context, "followingIndent", followingIndent);
if (followingIndent != null) {
cell.setFollowingIndent(followingIndent);
}
+ rightIndent = (Float) valueBinding(context, "rightIndent", rightIndent);
if (rightIndent != null) {
cell.setRightIndent(rightIndent);
}
+ spaceCharRatio = (Integer) valueBinding(context, "spaceCharRatio", spaceCharRatio);
if (spaceCharRatio != null) {
cell.setSpaceCharRatio(spaceCharRatio);
}
+ runDirection = (Integer) valueBinding(context, "runDirection", runDirection);
if (runDirection != null) {
cell.setRunDirection(runDirection);
}
+ arabicOptions = (Integer) valueBinding(context, "arabicOptions", arabicOptions);
if (arabicOptions != null) {
cell.setArabicOptions(arabicOptions);
}
+ useAscender = (Boolean) valueBinding(context, "useAscender", useAscender);
if (useAscender != null) {
cell.setUseAscender(useAscender);
}
+ rotation = (Integer) valueBinding(context, "rotation", rotation);
if (rotation != null) {
cell.setRotation(rotation);
}
- if (backgroundColor!=null) {
+
+ backgroundColor = (Color) valueBinding(context, "backgroundColor", backgroundColor);
+ if (backgroundColor != null) {
cell.setBackgroundColor(backgroundColor);
}
- if (borderColor!=null) {
+
+ borderColor = (Color) valueBinding(context, "borderColor", borderColor);
+ if (borderColor != null) {
cell.setBorderColor(borderColor);
}
- if (borderColorLeft!=null) {
+
+ borderColorLeft = (Color) valueBinding(context, "borderColorLeft", borderColorLeft);
+ if (borderColorLeft != null) {
cell.setBorderColorLeft(borderColorLeft);
}
- if (borderColorRight!=null) {
+
+ borderColorRight = (Color) valueBinding(context, "borderColorRight", borderColorRight);
+ if (borderColorRight != null) {
cell.setBorderColorRight(borderColorRight);
}
- if (borderColorTop!=null) {
+
+ borderColorTop = (Color) valueBinding(context, "borderColorTop", borderColorTop);
+ if (borderColorTop != null) {
cell.setBorderColorTop(borderColorTop);
}
- if (borderColorBottom!=null) {
+
+ borderColorBottom = (Color) valueBinding(context, "borderColorBottom", borderColorBottom);
+ if (borderColorBottom != null) {
cell.setBorderColorBottom(borderColorBottom);
}
- if (borderWidth!=null) {
+
+ borderWidth = (Float) valueBinding(context, "borderWidth", borderWidth);
+ if (borderWidth != null) {
cell.setBorderWidth(borderWidth);
}
- if (borderWidthLeft!=null) {
+
+ borderWidthLeft = (Float) valueBinding(context, "borderWidthLeft", borderWidthLeft);
+ if (borderWidthLeft != null) {
cell.setBorderWidthLeft(borderWidthLeft);
}
- if (borderWidthRight!=null) {
+
+ borderWidthRight = (Float) valueBinding(context, "borderWidthRight", borderWidthRight);
+ if (borderWidthRight != null) {
cell.setBorderWidthRight(borderWidthRight);
}
- if (borderWidthTop!=null) {
+
+ borderWidthTop = (Float) valueBinding(context, "borderWidthTop", borderWidthTop);
+ if (borderWidthTop != null) {
cell.setBorderWidthTop(borderWidthTop);
}
- if (borderWidthBottom!=null) {
+
+ borderWidthBottom = (Float) valueBinding(context, "borderWidthBottom", borderWidthBottom);
+ if (borderWidthBottom != null) {
cell.setBorderWidthBottom(borderWidthBottom);
}
- if (grayFill!=null) {
+
+ grayFill = (Float) valueBinding(context, "grayFill", grayFill);
+ if (grayFill != null) {
cell.setGrayFill(grayFill);
}
}
1.5 +11 -11 jboss-seam/src/pdf/org/jboss/seam/pdf/ui/UIFont.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: UIFont.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/pdf/org/jboss/seam/pdf/ui/UIFont.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- UIFont.java 2 Jan 2007 03:40:32 -0000 1.4
+++ UIFont.java 3 Jan 2007 19:45:35 -0000 1.5
@@ -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 UIFont
extends ITextComponent
@@ -16,12 +10,13 @@
Font font;
- int family = Font.UNDEFINED;
+
+ String familyName;
int size = Font.UNDEFINED;
String style;
- public void setFamily(String name) {
- family = Font.getFamilyIndex(name);
+ public void setFamily(String familyName) {
+ this.familyName = familyName;
}
public void setSize(int size) {
@@ -36,7 +31,6 @@
return font;
}
-
public Object getITextObject() {
return null; // we don't add to this component, so skip
}
@@ -46,7 +40,13 @@
}
public void createITextObject(FacesContext context) {
+ familyName = (String) valueBinding(context, "familyName", familyName);
+ int family = (familyName==null) ? Font.UNDEFINED : Font.getFamilyIndex(familyName);
+ size = (Integer) valueBinding(context, "size", size);
+
font = new Font(family, size);
+
+ style = (String) valueBinding(context, "style", style);
if (style != null) {
font.setStyle(style);
}
1.6 +14 -8 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.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- UIImage.java 2 Jan 2007 03:40:32 -0000 1.5
+++ UIImage.java 3 Jan 2007 19:45:36 -0000 1.6
@@ -2,16 +2,12 @@
import org.jboss.seam.pdf.ITextUtils;
-import javax.faces.event.*;
import javax.faces.context.*;
-import javax.faces.component.*;
-import javax.servlet.http.*;
-
-import java.io.*;
import java.net.URL;
+import EDU.oswego.cs.dl.util.concurrent.Rendezvous.Rotator;
+
import com.lowagie.text.*;
-import com.lowagie.text.pdf.*;
public class UIImage
extends ITextComponent
@@ -72,7 +68,7 @@
}
public void createITextObject(FacesContext context) {
-
+ resource = (String) valueBinding(context, "resource", resource);
URL url = Thread.currentThread().getContextClassLoader().getResource(resource);
if (url == null) {
throw new RuntimeException("cannot locate image resource " + resource);
@@ -83,27 +79,37 @@
throw new RuntimeException(e);
}
+ rotation = (Float) valueBinding(context, "rotation", rotation);
if (rotation != 0) {
image.setRotationDegrees(rotation);
}
+ height = (Float) valueBinding(context, "height", height);
+ width = (Float) valueBinding(context, "width", width);
if (height>0 || width > 0) {
image.scaleAbsolute(width, height);
}
- int alignmentValue =0;
+ int alignmentValue = 0;
+
+ alignment = (String) valueBinding(context, "alignment", alignment);
if (alignment != null) {
alignmentValue = (ITextUtils.alignmentValue(alignment));
}
+
+ wrap = (Boolean) valueBinding(context, "wrap", wrap);
if (wrap!=null && wrap.booleanValue()) {
alignmentValue |= Image.TEXTWRAP;
}
+
+ underlying = (Boolean) valueBinding(context, "underlying", underlying);
if (underlying!= null && underlying.booleanValue()) {
alignmentValue |= Image.UNDERLYING;
}
image.setAlignment(alignmentValue);
+ alt = (String) valueBinding(context, "alt", alt);
if (alt != null) {
image.setAlt(alt);
}
1.6 +5 -6 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.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- UIList.java 2 Jan 2007 03:40:32 -0000 1.5
+++ UIList.java 3 Jan 2007 19:45:36 -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 UIList
extends ITextComponent
@@ -52,6 +46,11 @@
}
public void createITextObject(FacesContext context) {
+ style = (String) valueBinding(context, "style", style);
+ lowerCase = (Boolean) valueBinding(context, "lowerCase", lowerCase);
+ indent = (Float) valueBinding(context, "indent", indent);
+ listSymbol = (String) valueBinding(context, "listSymbol", listSymbol);
+
if (style != null) {
if (style.equalsIgnoreCase(STYLE_ROMAN)) {
list = new RomanList((int) indent); // int? bug in text?
1.5 +0 -6 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.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- UIListItem.java 2 Jan 2007 03:40:32 -0000 1.4
+++ UIListItem.java 3 Jan 2007 19:45:36 -0000 1.5
@@ -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 UIListItem
extends ITextComponent
1.5 +2 -2 jboss-seam/src/pdf/org/jboss/seam/pdf/ui/UIPage.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: UIPage.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/pdf/org/jboss/seam/pdf/ui/UIPage.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- UIPage.java 2 Jan 2007 03:40:32 -0000 1.4
+++ UIPage.java 3 Jan 2007 19:45:36 -0000 1.5
@@ -16,11 +16,11 @@
}
public void removeITextObject() {
-
+ // nothing to do
}
public void createITextObject(FacesContext context) {
-
+ // nothing to do
}
public void handleAdd(Object o) {
1.6 +17 -6 jboss-seam/src/pdf/org/jboss/seam/pdf/ui/UIParagraph.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: UIParagraph.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/pdf/org/jboss/seam/pdf/ui/UIParagraph.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- UIParagraph.java 2 Jan 2007 03:40:32 -0000 1.5
+++ UIParagraph.java 3 Jan 2007 19:45:36 -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 UIParagraph
extends ITextComponent
@@ -78,17 +72,23 @@
paragraph = new Paragraph("", font);
}
+ alignment = (String) valueBinding(context, "alignment", alignment);
if (alignment != null) {
paragraph.setAlignment(alignment);
}
+ firstLineIndent = (Float) valueBinding(context, "firstLineIndent", firstLineIndent);
if (firstLineIndent != null) {
paragraph.setFirstLineIndent(firstLineIndent);
}
+ extraParagraphSpace = (Float) valueBinding(context, "extraParagraphSpace", extraParagraphSpace);
if (extraParagraphSpace != null) {
paragraph.setExtraParagraphSpace(extraParagraphSpace);
}
+
+ leading = (Float) valueBinding(context, "leading", leading);
+ multipliedLeading = (Float) valueBinding(context, "multipliedLeading", multipliedLeading);
if (leading != null) {
if (multipliedLeading != null) {
paragraph.setLeading(leading, multipliedLeading);
@@ -96,18 +96,29 @@
paragraph.setLeading(leading);
}
}
+
+
+ spacingBefore = (Float) valueBinding(context, "spacingBefore", spacingBefore);
if (spacingBefore != null) {
paragraph.setSpacingBefore(spacingBefore);
}
+
+ spacingAfter = (Float) valueBinding(context, "spacingAfter", spacingAfter);
if (spacingAfter != null) {
paragraph.setSpacingAfter(spacingAfter);
}
+
+ indentationLeft = (Float) valueBinding(context, "indentationLeft", indentationLeft);
if (indentationLeft != null) {
paragraph.setIndentationLeft(indentationLeft);
}
+
+ indentationRight = (Float) valueBinding(context, "indentationRight", indentationRight);
if (indentationRight != null) {
paragraph.setIndentationRight(indentationRight);
}
+
+ keepTogether = (Boolean) valueBinding(context, "keepTogether", keepTogether);
if (keepTogether != null) {
paragraph.setKeepTogether(keepTogether);
}
1.4 +0 -6 jboss-seam/src/pdf/org/jboss/seam/pdf/ui/UISection.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: UISection.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/pdf/org/jboss/seam/pdf/ui/UISection.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- UISection.java 2 Jan 2007 03:40:32 -0000 1.3
+++ UISection.java 3 Jan 2007 19:45:36 -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 UISection
extends ITextComponent
1.5 +27 -5 jboss-seam/src/pdf/org/jboss/seam/pdf/ui/UITable.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: UITable.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/pdf/org/jboss/seam/pdf/ui/UITable.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- UITable.java 2 Jan 2007 03:40:32 -0000 1.4
+++ UITable.java 3 Jan 2007 19:45:36 -0000 1.5
@@ -31,8 +31,8 @@
Boolean keepTogether;
- public void setWidths(String Widths) {
- this.widths = Widths;
+ public void setWidths(String widths) {
+ this.widths = widths;
}
public void setColumns(int columns) {
@@ -120,45 +120,67 @@
}
}
+ headerRows = (Integer) valueBinding(context, "headerRows", headerRows);
if (headerRows != null) {
table.setHeaderRows(headerRows);
}
+
+ footerRows = (Integer) valueBinding(context, "footerRows", footerRows);
if (footerRows != null) {
table.setFooterRows(footerRows);
}
+
+ widthPercentage = (Float) valueBinding(context, "widthPercentage", widthPercentage);
if (widthPercentage!=null) {
table.setWidthPercentage(widthPercentage);
}
+
+ horizontalAlignment = (Integer) valueBinding(context, "horizontalAlignment", horizontalAlignment);
if (horizontalAlignment!=null) {
table.setHorizontalAlignment(horizontalAlignment);
}
- if (skipFirstHeader!=null) {
- table.setSkipFirstHeader(skipFirstHeader);
- }
+
+ runDirection = (Integer) valueBinding(context, "runDirection", runDirection);
if (runDirection!=null) {
table.setRunDirection(runDirection);
}
+
+ lockedWidth = (Boolean) valueBinding(context, "lockedWidth", lockedWidth);
if (lockedWidth!=null) {
table.setLockedWidth(lockedWidth);
}
+
+ splitRows = (Boolean) valueBinding(context, "splitRows", splitRows);
if (splitRows!=null) {
table.setSplitRows(splitRows);
}
+
+ spacingBefore = (Float) valueBinding(context, "spacingBefore", spacingBefore);
if (spacingBefore!=null) {
table.setSpacingBefore(spacingBefore);
}
+
+ spacingAfter = (Float) valueBinding(context, "spacingAfter", spacingAfter);
if (spacingAfter!=null) {
table.setSpacingAfter(spacingAfter);
}
+
+ extendLastRow = (Boolean) valueBinding(context, "extendLastRow", extendLastRow);
if (extendLastRow!=null) {
table.setExtendLastRow(extendLastRow);
}
+
+ headersInEvent = (Boolean) valueBinding(context, "headersInEvent", headersInEvent);
if (headersInEvent!=null) {
table.setHeadersInEvent(headersInEvent);
}
+
+ splitLate = (Boolean) valueBinding(context, "splitLate", splitLate);
if (splitLate!=null) {
table.setSplitLate(splitLate);
}
+
+ keepTogether = (Boolean) valueBinding(context, "keepTogether", keepTogether);
if (keepTogether!=null) {
table.setKeepTogether(keepTogether);
}
More information about the jboss-cvs-commits
mailing list