keiron      02/03/21 01:34:20

  Modified:    src/org/apache/fop/area Area.java Block.java LineArea.java
               src/org/apache/fop/area/inline InlineArea.java
               src/org/apache/fop/render/pdf PDFRenderer.java
               src/org/apache/fop/render/xml XMLRenderer.java
               src/org/apache/fop/tools AreaTreeBuilder.java
  Added:       src/org/apache/fop/area LineTrait.java Trait.java
  Removed:     src/org/apache/fop/area LineProperty.java Property.java
  Log:
  changed property to trait for areas
  added ipd to area
  
  Revision  Changes    Path
  1.5       +10 -1     xml-fop/src/org/apache/fop/area/Area.java
  
  Index: Area.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/area/Area.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Area.java 9 Nov 2001 22:02:34 -0000       1.4
  +++ Area.java 21 Mar 2002 09:34:19 -0000      1.5
  @@ -1,5 +1,5 @@
   /*
  - * $Id: Area.java,v 1.4 2001/11/09 22:02:34 klease Exp $
  + * $Id: Area.java,v 1.5 2002/03/21 09:34:19 keiron Exp $
    * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
    * For details on use and redistribution please refer to the
    * LICENSE file included with these sources.
  @@ -46,6 +46,7 @@
   
       private int areaClass=CLASS_NORMAL;
       private FObj genFObj;
  +    private int ipd;
   
       protected Area parent =null; // Doesn't need to be saved in serialization
   
  @@ -55,6 +56,14 @@
   
       public void setAreaClass(int areaClass) {
        this.areaClass = areaClass;
  +    }
  +
  +    public void setIPD(int i) {
  +        ipd = i;
  +    }
  +
  +    public int getIPD() {
  +        return ipd;
       }
   
       /**
  
  
  
  1.5       +9 -8      xml-fop/src/org/apache/fop/area/Block.java
  
  Index: Block.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/area/Block.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Block.java        8 Jan 2002 09:52:16 -0000       1.4
  +++ Block.java        21 Mar 2002 09:34:19 -0000      1.5
  @@ -1,5 +1,5 @@
   /*
  - * $Id: Block.java,v 1.4 2002/01/08 09:52:16 keiron Exp $
  + * $Id: Block.java,v 1.5 2002/03/21 09:34:19 keiron Exp $
    * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
    * For details on use and redistribution please refer to the
    * LICENSE file included with these sources.
  @@ -59,16 +59,17 @@
       }
   
       // store properties in array list, need better solution
  -    ArrayList props = null;
  +    ArrayList traits = null;
   
  -    public void addProperty(Property prop) {
  -        if (props == null) {
  -            props = new ArrayList();
  +    public void addTrait(Trait prop) {
  +        if (traits == null) {
  +            traits = new ArrayList();
           }
  -        props.add(prop);
  +        traits.add(prop);
       }
   
  -    public List getPropertyList() {
  -        return props;
  +    public List getTraitList() {
  +        return traits;
       }
   }
  +
  
  
  
  1.3       +3 -3      xml-fop/src/org/apache/fop/area/LineArea.java
  
  Index: LineArea.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/area/LineArea.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- LineArea.java     26 Oct 2001 09:26:59 -0000      1.2
  +++ LineArea.java     21 Mar 2002 09:34:19 -0000      1.3
  @@ -1,5 +1,5 @@
   /*
  - * $Id: LineArea.java,v 1.2 2001/10/26 09:26:59 keiron Exp $
  + * $Id: LineArea.java,v 1.3 2002/03/21 09:34:19 keiron Exp $
    * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
    * For details on use and redistribution please refer to the
    * LICENSE file included with these sources.
  @@ -50,14 +50,14 @@
       // store properties in array list, need better solution
       ArrayList props = null;
   
  -    public void addProperty(Property prop) {
  +    public void addTrait(Trait prop) {
           if (props == null) {
               props = new ArrayList();
           }
           props.add(prop);
       }
   
  -    public List getPropertyList() {
  +    public List getTraitList() {
           return props;
       }
   }
  
  
  
  1.1                  xml-fop/src/org/apache/fop/area/LineTrait.java
  
  Index: LineTrait.java
  ===================================================================
  /*
   * $Id: LineTrait.java,v 1.1 2002/03/21 09:34:19 keiron Exp $
   * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
   * For details on use and redistribution please refer to the
   * LICENSE file included with these sources.
   */
  
  package org.apache.fop.area;
  
  public class LineTrait extends Trait {
      int[] range;
  }
  
  
  
  
  1.1                  xml-fop/src/org/apache/fop/area/Trait.java
  
  Index: Trait.java
  ===================================================================
  /*
   * $Id: Trait.java,v 1.1 2002/03/21 09:34:19 keiron Exp $
   * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
   * For details on use and redistribution please refer to the
   * LICENSE file included with these sources.
   */
  
  package org.apache.fop.area;
  
  import org.apache.fop.datatypes.ColorType;
  
  import java.io.Serializable;
  
  // properties should be serialized by the holder
  public class Trait implements Serializable {
      public static final int ID_LINK = 0;
      public static final int INTERNAL_LINK = 1; //resolved
      public static final int EXTERNAL_LINK = 2;
      public static final int FONT_FAMILY = 3;
      public static final int FONT_SIZE = 4;
      public static final int FONT_WEIGHT = 5;
      public static final int FONT_STYLE = 6;
      public static final int COLOR = 7;
      public static final int ID_AREA = 8;
      public static final int BACKGROUND = 9;
      public static final int UNDERLINE = 10;
      public static final int OVERLINE = 11;
      public static final int LINETHROUGH = 12;
      public static final int OFFSET = 13;
      public static final int SHADOW = 14;
  
      public static final int FONT_STATE = 100;
  
      public int propType;
      public Object data;
  
      public static class Background {
          ColorType color;
          String url;
          int repeat;
          int horiz;
          int vertical;
      }
  }
  
  
  
  
  1.5       +12 -4     xml-fop/src/org/apache/fop/area/inline/InlineArea.java
  
  Index: InlineArea.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/area/inline/InlineArea.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- InlineArea.java   11 Nov 2001 14:10:29 -0000      1.4
  +++ InlineArea.java   21 Mar 2002 09:34:19 -0000      1.5
  @@ -1,5 +1,5 @@
   /*
  - * $Id: InlineArea.java,v 1.4 2001/11/11 14:10:29 klease Exp $
  + * $Id: InlineArea.java,v 1.5 2002/03/21 09:34:19 keiron Exp $
    * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
    * For details on use and redistribution please refer to the
    * LICENSE file included with these sources.
  @@ -9,7 +9,7 @@
   
   import org.apache.fop.area.Area;
   import org.apache.fop.area.MinOptMax;
  -import org.apache.fop.area.Property;
  +import org.apache.fop.area.Trait;
   import org.apache.fop.render.Renderer;
   
   import java.util.List;
  @@ -46,6 +46,14 @@
           return width;
       }
   
  +    public void setHeight(int h) {
  +        height = h;
  +    }
  +
  +    public int getHeight() {
  +        return height;
  +    }
  +
       public MinOptMax getAllocationIPD() {
        // Should also account for any borders and padding in the
        // inline progression dimension
  @@ -60,14 +68,14 @@
           return verticalPosition;
       }
   
  -    public void addProperty(Property prop) {
  +    public void addTrait(Trait prop) {
           if (props == null) {
               props = new ArrayList();
           }
           props.add(prop);
       }
   
  -    public List getPropertyList() {
  +    public List getTraitList() {
           return props;
       }
   }
  
  
  
  1.100     +6 -6      xml-fop/src/org/apache/fop/render/pdf/PDFRenderer.java
  
  Index: PDFRenderer.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/render/pdf/PDFRenderer.java,v
  retrieving revision 1.99
  retrieving revision 1.100
  diff -u -r1.99 -r1.100
  --- PDFRenderer.java  8 Mar 2002 11:00:20 -0000       1.99
  +++ PDFRenderer.java  21 Mar 2002 09:34:19 -0000      1.100
  @@ -1,5 +1,5 @@
   /*
  - * $Id: PDFRenderer.java,v 1.99 2002/03/08 11:00:20 keiron Exp $
  + * $Id: PDFRenderer.java,v 1.100 2002/03/21 09:34:19 keiron Exp $
    * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
    * For details on use and redistribution please refer to the
    * LICENSE file included with these sources.
  @@ -266,10 +266,10 @@
   
               FontState fs = null;
   
  -            List props = word.getPropertyList();
  +            List props = word.getTraitList();
               for(int count = 0; count < props.size(); count++) {
  -                Property pro = (Property)props.get(count);
  -                if(pro.propType == Property.FONT_STATE) {
  +                Trait pro = (Trait)props.get(count);
  +                if(pro.propType == Trait.FONT_STATE) {
                       fs = (FontState)pro.data;
                   }
               }
  @@ -289,7 +289,7 @@
   
               int rx = currentBlockIPPosition;
               // int bl = pageHeight - currentBPPosition;
  -            int bl = currentBPPosition;
  +            int bl = currentBPPosition + word.getOffset();
   
               // Set letterSpacing
               //float ls = fs.getLetterSpacing() / this.currentFontSize;
  @@ -530,7 +530,7 @@
       public void renderDocument(Document doc, String ns) {
           RendererContext context;
           context = new RendererContext(mimeType);
  -        context.setLogger(log);
  +        context.setUserAgent(userAgent);
   
           context.setProperty(PDFXMLHandler.PDF_DOCUMENT, pdfDoc);
           context.setProperty(PDFXMLHandler.PDF_STREAM, currentStream);
  
  
  
  1.35      +19 -19    xml-fop/src/org/apache/fop/render/xml/XMLRenderer.java
  
  Index: XMLRenderer.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/render/xml/XMLRenderer.java,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- XMLRenderer.java  26 Feb 2002 12:43:10 -0000      1.34
  +++ XMLRenderer.java  21 Mar 2002 09:34:19 -0000      1.35
  @@ -1,5 +1,5 @@
   /*
  - * $Id: XMLRenderer.java,v 1.34 2002/02/26 12:43:10 keiron Exp $
  + * $Id: XMLRenderer.java,v 1.35 2002/03/21 09:34:19 keiron Exp $
    * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
    * For details on use and redistribution please refer to the
    * LICENSE file included with these sources.
  @@ -277,7 +277,7 @@
   
       protected void renderBlock(Block block) {
           String prop = "";
  -        List list = block.getPropertyList();
  +        List list = block.getTraitList();
           if (list != null) {
               prop = " props=\"" + getPropString(list) + "\"";
           }
  @@ -288,7 +288,7 @@
   
       protected void renderLineArea(LineArea line) {
           String prop = "";
  -        List list = line.getPropertyList();
  +        List list = line.getTraitList();
           if (list != null) {
               prop = " props=\"" + getPropString(list) + "\"";
           }
  @@ -326,7 +326,7 @@
   
       public void renderCharacter(org.apache.fop.area.inline.Character ch) {
           String prop = "";
  -        List list = ch.getPropertyList();
  +        List list = ch.getTraitList();
           if (list != null) {
               prop = " props=\"" + getPropString(list) + "\"";
           }
  @@ -339,7 +339,7 @@
   
       public void renderWord(Word word) {
           String prop = "";
  -        List list = word.getPropertyList();
  +        List list = word.getTraitList();
           if (list != null) {
               prop = " props=\"" + getPropString(list) + "\"";
           }
  @@ -376,45 +376,45 @@
       protected String getPropString(List list) {
           String str = "";
           for (int count = 0; count < list.size(); count++) {
  -            Property prop = (Property) list.get(count);
  +            Trait prop = (Trait) list.get(count);
               switch (prop.propType) {
  -                case Property.INTERNAL_LINK:
  +                case Trait.INTERNAL_LINK:
                       str += "internal-link:" + prop.data;
                       break;
  -                case Property.EXTERNAL_LINK:
  +                case Trait.EXTERNAL_LINK:
                       str += "external-link:" + prop.data;
                       break;
  -                case Property.FONT_FAMILY:
  +                case Trait.FONT_FAMILY:
                       str += "font-family:" + prop.data;
                       break;
  -                case Property.FONT_SIZE:
  +                case Trait.FONT_SIZE:
                       str += "font-size:" + prop.data;
                       break;
  -                case Property.FONT_WEIGHT:
  +                case Trait.FONT_WEIGHT:
                       str += "font-weight:" + prop.data;
                       break;
  -                case Property.FONT_STYLE:
  +                case Trait.FONT_STYLE:
                       str += "font-style:" + prop.data;
                       break;
  -                case Property.COLOR:
  +                case Trait.COLOR:
                       str += "color:" + prop.data;
                       break;
  -                case Property.BACKGROUND:
  +                case Trait.BACKGROUND:
                       str += "background:" + prop.data;
                       break;
  -                case Property.UNDERLINE:
  +                case Trait.UNDERLINE:
                       str += "underline:" + prop.data;
                       break;
  -                case Property.OVERLINE:
  +                case Trait.OVERLINE:
                       str += "overline:" + prop.data;
                       break;
  -                case Property.LINETHROUGH:
  +                case Trait.LINETHROUGH:
                       str += "linethrough:" + prop.data;
                       break;
  -                case Property.OFFSET:
  +                case Trait.OFFSET:
                       str += "offset:" + prop.data;
                       break;
  -                case Property.SHADOW:
  +                case Trait.SHADOW:
                       str += "shadow:" + prop.data;
                       break;
                   default:
  
  
  
  1.6       +21 -21    xml-fop/src/org/apache/fop/tools/AreaTreeBuilder.java
  
  Index: AreaTreeBuilder.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/tools/AreaTreeBuilder.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- AreaTreeBuilder.java      11 Feb 2002 09:45:39 -0000      1.5
  +++ AreaTreeBuilder.java      21 Mar 2002 09:34:19 -0000      1.6
  @@ -1,5 +1,5 @@
   /*
  - * $Id: AreaTreeBuilder.java,v 1.5 2002/02/11 09:45:39 keiron Exp $
  + * $Id: AreaTreeBuilder.java,v 1.6 2002/03/21 09:34:19 keiron Exp $
    * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
    * For details on use and redistribution please refer to the
    * LICENSE file included with these sources.
  @@ -428,7 +428,7 @@
                   Block block = new Block();
                   List props = getProperties((Element) obj);
                   for (int count = 0; count < props.size(); count++) {
  -                    block.addProperty((Property) props.get(count));
  +                    block.addTrait((Trait) props.get(count));
                   }
                   addBlockChildren(block, (Element) obj);
                   list.add(block);
  @@ -457,7 +457,7 @@
                   LineArea line = new LineArea();
                   List props = getProperties((Element) obj);
                   for (int count = 0; count < props.size(); count++) {
  -                    line.addProperty((Property) props.get(count));
  +                    line.addTrait((Trait) props.get(count));
                   }
                   String height = ((Element) obj).getAttribute("height");
                   int h = Integer.parseInt(height);
  @@ -521,10 +521,10 @@
                       e.printStackTrace();
                   }
                   Word word = getWord((Element) obj);
  -                Property prop = new Property();
  -                prop.propType = Property.FONT_STATE;
  +                Trait prop = new Trait();
  +                prop.propType = Trait.FONT_STATE;
                   prop.data = currentFontState;
  -                word.addProperty(prop);
  +                word.addTrait(prop);
                   if (word != null) {
                       list.add(word);
                   }
  @@ -672,7 +672,7 @@
       public void addProperties(Element ele, InlineArea inline) {
           List props = getProperties(ele);
           for (int count = 0; count < props.size(); count++) {
  -            inline.addProperty((Property) props.get(count));
  +            inline.addTrait((Trait) props.get(count));
           }
           String str = ele.getAttribute("width");
   
  @@ -687,57 +687,57 @@
               int index = tok.indexOf(":");
               String id = tok.substring(0, index);
               String val = tok.substring(index + 1);
  -            Property prop = new Property();
  +            Trait prop = new Trait();
               if ("internal-link".equals(id)) {
  -                prop.propType = Property.INTERNAL_LINK;
  +                prop.propType = Trait.INTERNAL_LINK;
                   prop.data = val;
                   list.add(prop);
               } else if ("external-link".equals(id)) {
  -                prop.propType = Property.EXTERNAL_LINK;
  +                prop.propType = Trait.EXTERNAL_LINK;
                   prop.data = val;
                   list.add(prop);
               } else if ("font-family".equals(id)) {
  -                prop.propType = Property.FONT_FAMILY;
  +                prop.propType = Trait.FONT_FAMILY;
                   prop.data = val;
                   list.add(prop);
               } else if ("font-size".equals(id)) {
  -                prop.propType = Property.FONT_SIZE;
  +                prop.propType = Trait.FONT_SIZE;
                   prop.data = Integer.valueOf(val);
                   list.add(prop);
               } else if ("font-weight".equals(id)) {
  -                prop.propType = Property.FONT_WEIGHT;
  +                prop.propType = Trait.FONT_WEIGHT;
                   prop.data = val;
                   list.add(prop);
               } else if ("font-style".equals(id)) {
  -                prop.propType = Property.FONT_STYLE;
  +                prop.propType = Trait.FONT_STYLE;
                   prop.data = val;
                   list.add(prop);
               } else if ("color".equals(id)) {
  -                prop.propType = Property.COLOR;
  +                prop.propType = Trait.COLOR;
                   prop.data = val;
                   list.add(prop);
               } else if ("background".equals(id)) {
  -                prop.propType = Property.BACKGROUND;
  +                prop.propType = Trait.BACKGROUND;
                   prop.data = val;
                   list.add(prop);
               } else if ("underline".equals(id)) {
  -                prop.propType = Property.UNDERLINE;
  +                prop.propType = Trait.UNDERLINE;
                   prop.data = new Boolean(val);
                   list.add(prop);
               } else if ("overline".equals(id)) {
  -                prop.propType = Property.OVERLINE;
  +                prop.propType = Trait.OVERLINE;
                   prop.data = new Boolean(val);
                   list.add(prop);
               } else if ("linethrough".equals(id)) {
  -                prop.propType = Property.LINETHROUGH;
  +                prop.propType = Trait.LINETHROUGH;
                   prop.data = new Boolean(val);
                   list.add(prop);
               } else if ("offset".equals(id)) {
  -                prop.propType = Property.OFFSET;
  +                prop.propType = Trait.OFFSET;
                   prop.data = Integer.valueOf(val);
                   list.add(prop);
               } else if ("shadow".equals(id)) {
  -                prop.propType = Property.SHADOW;
  +                prop.propType = Trait.SHADOW;
                   prop.data = val;
                   list.add(prop);
               }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to