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

Norman Richards norman.richards at jboss.com
Thu Jan 25 01:16:34 EST 2007


  User: nrichards
  Date: 07/01/25 01:16:34

  Modified:    src/pdf/org/jboss/seam/pdf/ui  UIImage.java
  Log:
  image scaling
  
  Revision  Changes    Path
  1.10      +17 -0     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.9
  retrieving revision 1.10
  diff -u -b -r1.9 -r1.10
  --- UIImage.java	18 Jan 2007 02:29:03 -0000	1.9
  +++ UIImage.java	25 Jan 2007 06:16:34 -0000	1.10
  @@ -30,6 +30,7 @@
       Float widthPercentage;
       Float initialRotation;
       String dpi;
  +    String scalePercent;
       
       Boolean wrap;
       Boolean underlying;
  @@ -95,6 +96,10 @@
           this.widthPercentage = widthPercentage;
       }
   
  +    public void setScalePercent(String scalePercent) { 
  +        this.scalePercent = scalePercent; 
  +    }
  +
       public Object getITextObject() {
           return image;
       }
  @@ -193,6 +198,18 @@
            }
           
           applyRectangleProperties(context, image);
  +        
  +        scalePercent = (String) valueBinding(context, "scalePercent", scalePercent);
  +        if (scalePercent != null) {
  +            float[] scale = ITextUtils.stringToFloatArray(scalePercent);
  +            if (scale.length == 1) {
  +                image.scalePercent(scale[0]); 
  +            } else if (scale.length == 2) {
  +                image.scalePercent(scale[0], scale[1]);
  +            } else {
  +                throw new RuntimeException("scalePercent must contain one or two scale percentages");
  +            }
  +        }
       }
   
       public void handleAdd(Object o) {
  
  
  



More information about the jboss-cvs-commits mailing list