gmazza      2004/08/01 08:26:53

  Modified:    src/java/org/apache/fop/fo/pagination Region.java
                        RegionBA.java RegionBefore.java RegionSE.java
               src/java/org/apache/fop/layoutmgr AddLMVisitor.java
  Removed:     src/java/org/apache/fop/fo/pagination RegionBASE.java
  Log:
  Consolidated RegionBASE into Region and RegionBA/RegionSE (RegionBASE was
  supporting only one unique property.)
  
  Revision  Changes    Path
  1.26      +3 -11     xml-fop/src/java/org/apache/fop/fo/pagination/Region.java
  
  Index: Region.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/pagination/Region.java,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- Region.java       1 Aug 2004 04:20:50 -0000       1.25
  +++ Region.java       1 Aug 2004 15:26:52 -0000       1.26
  @@ -57,6 +57,8 @@
       /** Holds the writing mode */
       protected int wm;
   
  +    protected int extent = 0;
  +
       /**
        * @see org.apache.fop.fo.FONode#FONode(FONode)
        */
  @@ -190,16 +192,6 @@
       }
   
       public int getExtent() {
  -        return 0;
  -    }
  -
  -    /**
  -     * This is a hook for the AddLMVisitor class to be able to access
  -     * this object.
  -     * @param aLMV the AddLMVisitor object that can access this object.
  -     */
  -    public void acceptVisitor(AddLMVisitor aLMV) {
  -        aLMV.serveRegion(this);
  +        return extent;
       }
  -
   }
  
  
  
  1.13      +11 -15    xml-fop/src/java/org/apache/fop/fo/pagination/RegionBA.java
  
  Index: RegionBA.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/pagination/RegionBA.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- RegionBA.java     27 Jul 2004 23:57:16 -0000      1.12
  +++ RegionBA.java     1 Aug 2004 15:26:52 -0000       1.13
  @@ -22,6 +22,7 @@
   import java.awt.Rectangle;
   
   // XML
  +import org.xml.sax.Attributes;
   import org.xml.sax.SAXParseException;
   
   // FOP
  @@ -32,7 +33,7 @@
   /**
    * Abstract base class for fo:region-before and fo:region-after.
    */
  -public abstract class RegionBA extends RegionBASE {
  +public abstract class RegionBA extends Region {
   
       private boolean bPrecedence;
   
  @@ -43,6 +44,15 @@
           super(parent, regionId);
       }
   
  +    protected void addProperties(Attributes attlist) throws SAXParseException {
  +        super.addProperties(attlist);
  +        
  +        bPrecedence =
  +            (this.propertyList.get(PR_PRECEDENCE).getEnum() == Precedence.TRUE);
  +
  +        this.extent = this.propertyList.get(PR_EXTENT).getLength().getValue();
  +    }
  +
       /**
        * @see org.apache.fop.fo.pagination.Region#getPrecedence()
        */
  @@ -51,15 +61,6 @@
       }
   
       /**
  -     * @see org.apache.fop.fo.FONode#endOfNode()
  -     */
  -    protected void endOfNode() throws SAXParseException {
  -        super.endOfNode();
  -        bPrecedence =
  -            (this.propertyList.get(PR_PRECEDENCE).getEnum() == Precedence.TRUE);
  -    }
  -
  -    /**
        * Adjust the viewport reference rectangle for a region as a function
        * of precedence.
        * If precedence is false on a before or after region, its
  @@ -87,10 +88,5 @@
               }
           }
       }
  -
  -    public void acceptVisitor(AddLMVisitor aLMV) {
  -        aLMV.serveRegionBA(this);
  -    }
  -
   }
   
  
  
  
  1.12      +3 -3      xml-fop/src/java/org/apache/fop/fo/pagination/RegionBefore.java
  
  Index: RegionBefore.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/pagination/RegionBefore.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- RegionBefore.java 27 Jul 2004 23:57:16 -0000      1.11
  +++ RegionBefore.java 1 Aug 2004 15:26:52 -0000       1.12
  @@ -18,13 +18,13 @@
   
   package org.apache.fop.fo.pagination;
   
  +// Java
  +import java.awt.Rectangle;
  +
   // FOP
   import org.apache.fop.datatypes.FODimension;
   import org.apache.fop.fo.FONode;
   import org.apache.fop.layoutmgr.AddLMVisitor;
  -
  -// Java
  -import java.awt.Rectangle;
   
   /**
    * The fo:region-before element.
  
  
  
  1.8       +11 -6     xml-fop/src/java/org/apache/fop/fo/pagination/RegionSE.java
  
  Index: RegionSE.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/pagination/RegionSE.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- RegionSE.java     27 Jul 2004 23:57:16 -0000      1.7
  +++ RegionSE.java     1 Aug 2004 15:26:53 -0000       1.8
  @@ -21,6 +21,10 @@
   // Java
   import java.awt.Rectangle;
   
  +// XML
  +import org.xml.sax.Attributes;
  +import org.xml.sax.SAXParseException;
  +
   // FOP
   import org.apache.fop.fo.FONode;
   import org.apache.fop.layoutmgr.AddLMVisitor;
  @@ -28,7 +32,7 @@
   /**
    * Abstract base class for fo:region-start and fo:region-end.
    */
  -public abstract class RegionSE extends RegionBASE {
  +public abstract class RegionSE extends Region {
   
       /**
        * @see org.apache.fop.fo.FONode#FONode(FONode)
  @@ -37,6 +41,12 @@
           super(parent, regionId);
       }
   
  +    protected void addProperties(Attributes attlist) throws SAXParseException {
  +        super.addProperties(attlist);
  +        
  +        this.extent = this.propertyList.get(PR_EXTENT).getLength().getValue();
  +    }
  +
       /**
        * Adjust the viewport reference rectangle for a region as a function
        * of precedence.
  @@ -66,10 +76,5 @@
               }
           }
       }
  -
  -    public void acceptVisitor(AddLMVisitor aLMV) {
  -        aLMV.serveRegionSE(this);
  -    }
  -
   }
   
  
  
  
  1.45      +3 -11     xml-fop/src/java/org/apache/fop/layoutmgr/AddLMVisitor.java
  
  Index: AddLMVisitor.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/AddLMVisitor.java,v
  retrieving revision 1.44
  retrieving revision 1.45
  diff -u -r1.44 -r1.45
  --- AddLMVisitor.java 31 Jul 2004 00:44:23 -0000      1.44
  +++ AddLMVisitor.java 1 Aug 2004 15:26:53 -0000       1.45
  @@ -105,7 +105,6 @@
   import org.apache.fop.fo.pagination.Region;
   import org.apache.fop.fo.pagination.RegionAfter;
   import org.apache.fop.fo.pagination.RegionBA;
  -import org.apache.fop.fo.pagination.RegionBASE;
   import org.apache.fop.fo.pagination.RegionBefore;
   import org.apache.fop.fo.pagination.RegionBody;
   import org.apache.fop.fo.pagination.RegionEnd;
  @@ -965,17 +964,10 @@
       }
   
       /**
  -     * @param node RegionBASE object to process
  -     */
  -    public void serveRegionBASE(RegionBASE node) {
  -        serveRegion((Region)node);
  -    }
  -
  -    /**
        * @param node RegionBA object to process
        */
       public void serveRegionBA(RegionBA node) {
  -        serveRegionBASE((RegionBASE)node);
  +        serveRegion((Region)node);
       }
   
       /**
  @@ -996,7 +988,7 @@
        * @param node RegionSE object to process
        */
       public void serveRegionSE(RegionSE node) {
  -        serveRegionBASE((RegionBASE)node);
  +        serveRegion((Region)node);
       }
   
       /**
  
  
  

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

Reply via email to