[jboss-cvs] jboss-seam/src/pdf/org/jboss/seam/pdf/ui ...

Norman Richards norman.richards at jboss.com
Sun Jan 14 13:14:41 EST 2007


  User: nrichards
  Date: 07/01/14 13:14:40

  Modified:    src/pdf/org/jboss/seam/pdf/ui       UICell.java
                        UIChapter.java UIImage.java UIRectangle.java
                        UISection.java
  Added:       src/pdf/org/jboss/seam/pdf/ui       UITitle.java
  Log:
  some chapter updates, UIRectangle
  
  Revision  Changes    Path
  1.8       +0 -2      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.7
  retrieving revision 1.8
  diff -u -b -r1.7 -r1.8
  --- UICell.java	11 Jan 2007 05:32:06 -0000	1.7
  +++ UICell.java	14 Jan 2007 18:14:40 -0000	1.8
  @@ -5,8 +5,6 @@
   import com.lowagie.text.*;
   import com.lowagie.text.pdf.*;
   
  -import java.awt.Color;
  -
   import javax.faces.context.FacesContext;
   
   public class UICell
  
  
  
  1.5       +11 -2     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.4
  retrieving revision 1.5
  diff -u -b -r1.4 -r1.5
  --- UIChapter.java	8 Jan 2007 18:11:41 -0000	1.4
  +++ UIChapter.java	14 Jan 2007 18:14:40 -0000	1.5
  @@ -10,9 +10,16 @@
   
       Chapter chapter;
       
  +    Integer number = 1;
  +    
  +    public void setNumber(Integer number) { 
  +        this.number = number;
  +    }
  +    
       public Chapter getChapter() {
           return chapter;
       }
  +    
       public Object getITextObject() {
           return chapter;
       }
  @@ -21,8 +28,10 @@
           chapter = null;
       }
   
  +    
       public void createITextObject(FacesContext context) {
  -        chapter = new Chapter("*chapter title*",1);
  +        number = (Integer) valueBinding(context, "number", number);               
  +        chapter = new Chapter("",number);
       }
   
       public void handleAdd(Object o) {
  
  
  
  1.8       +3 -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.7
  retrieving revision 1.8
  diff -u -b -r1.7 -r1.8
  --- UIImage.java	8 Jan 2007 18:11:41 -0000	1.7
  +++ UIImage.java	14 Jan 2007 18:14:40 -0000	1.8
  @@ -8,7 +8,7 @@
   import com.lowagie.text.*;
   
   public class UIImage
  -    extends ITextComponent
  +    extends UIRectangle
   {
       public static final String COMPONENT_TYPE   = "org.jboss.seam.pdf.ui.UIImage";
   
  @@ -182,10 +182,11 @@
               int[] dpiValues = ITextUtils.stringToIntArray(dpi);
               image.setDpi(dpiValues[0], dpiValues[1]);
            }
  +        
  +        applyRectangleProperties(context, image);
       }
   
       public void handleAdd(Object o) {
           throw new RuntimeException("can't add " + o.getClass().getName() + " to image");
  -        //image.add(o);
       }
   }
  
  
  
  1.2       +23 -11    jboss-seam/src/pdf/org/jboss/seam/pdf/ui/UIRectangle.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: UIRectangle.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/pdf/org/jboss/seam/pdf/ui/UIRectangle.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -b -r1.1 -r1.2
  --- UIRectangle.java	11 Jan 2007 05:32:06 -0000	1.1
  +++ UIRectangle.java	14 Jan 2007 18:14:40 -0000	1.2
  @@ -11,6 +11,7 @@
   public abstract class UIRectangle 
   extends ITextComponent 
   {
  +    protected Integer border;
       protected Color borderColor;
       protected Color borderColorLeft;
       protected Color borderColorRight;
  @@ -27,6 +28,11 @@
           super();
       }
   
  +    // xxx - use string
  +    public void setBorder(Integer border) {
  +        this.border = border;
  +    }
  +    
       public void setBorderWidth(Float borderWidth) {
           this.borderWidth = borderWidth;
       }
  @@ -73,6 +79,12 @@
   
   
       public void applyRectangleProperties(FacesContext context, Rectangle rectangle) {
  +        
  +        border = (Integer) valueBinding(context, "border", border);
  +        if (border != null) {
  +            rectangle.setBorder(border);
  +        }
  +        
           backgroundColor = (Color) valueBinding(context, "backgroundColor", backgroundColor);
           if (backgroundColor != null) {
               rectangle.setBackgroundColor(backgroundColor);
  
  
  
  1.5       +5 -1      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.4
  retrieving revision 1.5
  diff -u -b -r1.4 -r1.5
  --- UISection.java	3 Jan 2007 19:45:36 -0000	1.4
  +++ UISection.java	14 Jan 2007 18:14:40 -0000	1.5
  @@ -11,7 +11,8 @@
       Section section;
       
       public Object getITextObject() {
  -        return section;
  +        return null; // don't add to parent - already added.
  +        //return section;
       }
   
       public void removeITextObject() {
  @@ -20,6 +21,9 @@
   
       public void createITextObject(FacesContext context) {
           Chapter chapter = ((UIChapter)findITextParent(this, UIChapter.class)).getChapter();
  +        if (chapter == null) {
  +            throw new RuntimeException("section must have a parent chapter");
  +        }
           section = chapter.addSection(new Paragraph("*fake title*"), 1);
           section.setTitle(new Paragraph("*section title*"));
       }
  
  
  
  1.1      date: 2007/01/14 18:14:40;  author: nrichards;  state: Exp;jboss-seam/src/pdf/org/jboss/seam/pdf/ui/UITitle.java
  
  Index: UITitle.java
  ===================================================================
  package org.jboss.seam.pdf.ui;
  
  import javax.faces.context.FacesContext;
  
  import com.lowagie.text.Paragraph;
  
  public class UITitle extends ITextComponent {
      @Override
      public void createITextObject(FacesContext context) {
          //
      }
  
      @Override
      public Object getITextObject() {      
          return null;
      }
  
      @Override
      public void handleAdd(Object other) {
          Paragraph paragraph = null;
          
          if (other instanceof Paragraph) {
              paragraph = (Paragraph) other;
          }
          
          if (paragraph == null) {
              throw new RuntimeException("title must be a paragraph");
          }
          
          UIChapter chapter = (UIChapter) findITextParent(this,UIChapter.class);
          if (chapter == null) {
              throw new RuntimeException("cannot find parent chapter for title");
          }
          
          chapter.getChapter().setTitle(paragraph);
      }
  
      @Override
      public void removeITextObject() {
          //
      }
  
  }
  
  
  



More information about the jboss-cvs-commits mailing list