vmote       2003/08/27 10:51:16

  Modified:    src/java/org/apache/fop/fo/pagination Region.java
                        RegionAfter.java RegionBefore.java RegionBody.java
                        RegionEnd.java RegionStart.java
               src/java/org/apache/fop/layoutmgr PageLayoutManager.java
  Log:
  duplicate the area.RegionReference region codes in fo/pagination/Region, and use the 
codes in Region from within the Region subclasses
  
  Revision  Changes    Path
  1.11      +17 -7     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.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- Region.java       27 Aug 2003 15:55:34 -0000      1.10
  +++ Region.java       27 Aug 2003 17:51:16 -0000      1.11
  @@ -82,6 +82,18 @@
       /** Key for body regions */
       public static final String BODY =   "body";
   
  +    /* The following codes correspond to those found in area/RegionReference */
  +    /** Integer Code for before regions */
  +    public static final int BEFORE_CODE = 0;
  +    /** Integer Code for start regions */
  +    public static final int START_CODE = 1;
  +    /** Integer Code for body regions */
  +    public static final int BODY_CODE = 2;
  +    /** Integer Code for end regions */
  +    public static final int END_CODE = 3;
  +    /** Integer Code for after regions */
  +    public static final int AFTER_CODE = 4;
  +
       private SimplePageMaster layoutMaster;
       private String regionName;
   
  @@ -136,13 +148,6 @@
       public abstract Rectangle getViewportRectangle(FODimension pageRefRect);
   
       /**
  -     * Return the enumerated value designating this type of region in the
  -     * Area tree.
  -     * @return the region area class
  -     */
  -    public abstract int getRegionAreaClass();
  -
  -    /**
        * Returns the default region name (xsl-region-before, xsl-region-start,
        * etc.)
        * @return the default region name
  @@ -156,6 +161,11 @@
        */
       public abstract String getRegionClass();
   
  +    /**
  +     * Returns the region class code.
  +     * @return the region class code
  +     */
  +    public abstract int getRegionClassCode();
   
       /**
        * Returns the name of this region.
  
  
  
  1.5       +6 -7      xml-fop/src/java/org/apache/fop/fo/pagination/RegionAfter.java
  
  Index: RegionAfter.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/pagination/RegionAfter.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- RegionAfter.java  27 Aug 2003 01:51:06 -0000      1.4
  +++ RegionAfter.java  27 Aug 2003 17:51:16 -0000      1.5
  @@ -58,7 +58,6 @@
   import org.apache.fop.fo.FOTreeVisitor;
   import org.apache.fop.fo.properties.WritingMode;
   import org.apache.fop.datatypes.FODimension;
  -import org.apache.fop.area.RegionReference;
   
   /**
    * The fo:region-after element.
  @@ -97,17 +96,17 @@
       }
   
       /**
  -     * @see org.apache.fop.fo.pagination.Region#getRegionAreaClass()
  +     * @see org.apache.fop.fo.pagination.Region#getRegionClass()
        */
  -    public int getRegionAreaClass() {
  -        return RegionReference.AFTER;
  +    public String getRegionClass() {
  +        return Region.AFTER;
       }
   
       /**
  -     * @see org.apache.fop.fo.pagination.Region#getRegionClass()
  +     * @see org.apache.fop.fo.pagination.Region#getRegionClassCode()
        */
  -    public String getRegionClass() {
  -        return Region.AFTER;
  +    public int getRegionClassCode() {
  +        return Region.AFTER_CODE;
       }
   
       /**
  
  
  
  1.5       +3 -4      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.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- RegionBefore.java 27 Aug 2003 01:51:06 -0000      1.4
  +++ RegionBefore.java 27 Aug 2003 17:51:16 -0000      1.5
  @@ -55,7 +55,6 @@
   import org.apache.fop.fo.properties.WritingMode;
   import org.apache.fop.fo.FONode;
   import org.apache.fop.fo.FOTreeVisitor;
  -import org.apache.fop.area.RegionReference;
   
   // Java
   import java.awt.Rectangle;
  @@ -87,10 +86,10 @@
       }
   
       /**
  -     * @see org.apache.fop.fo.pagination.Region#getRegionAreaClass()
  +     * @see org.apache.fop.fo.pagination.Region#getRegionClassCode()
        */
  -    public int getRegionAreaClass() {
  -        return RegionReference.BEFORE;
  +    public int getRegionClassCode() {
  +        return Region.BEFORE_CODE;
       }
   
       /**
  
  
  
  1.7       +3 -5      xml-fop/src/java/org/apache/fop/fo/pagination/RegionBody.java
  
  Index: RegionBody.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/pagination/RegionBody.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- RegionBody.java   27 Aug 2003 15:33:59 -0000      1.6
  +++ RegionBody.java   27 Aug 2003 17:51:16 -0000      1.7
  @@ -63,8 +63,6 @@
   import org.apache.fop.fo.properties.WritingMode;
   import org.apache.fop.datatypes.ColorType;
   import org.apache.fop.datatypes.FODimension;
  -import org.apache.fop.area.RegionReference;
  -import org.apache.fop.area.BodyRegion;
   import org.apache.fop.fo.properties.CommonMarginBlock;
   
   /**
  @@ -139,10 +137,10 @@
       }
   
       /**
  -     * @see org.apache.fop.fo.pagination.Region#getRegionAreaClass()
  +     * @see org.apache.fop.fo.pagination.Region#getRegionClassCode()
        */
  -    public int getRegionAreaClass() {
  -        return RegionReference.BODY;
  +    public int getRegionClassCode() {
  +        return Region.BODY_CODE;
       }
   
       /**
  
  
  
  1.5       +3 -4      xml-fop/src/java/org/apache/fop/fo/pagination/RegionEnd.java
  
  Index: RegionEnd.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/pagination/RegionEnd.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- RegionEnd.java    27 Aug 2003 01:51:06 -0000      1.4
  +++ RegionEnd.java    27 Aug 2003 17:51:16 -0000      1.5
  @@ -58,7 +58,6 @@
   import org.apache.fop.fo.FOTreeVisitor;
   import org.apache.fop.fo.properties.WritingMode;
   import org.apache.fop.datatypes.FODimension;
  -import org.apache.fop.area.RegionReference;
   
   /**
    * The fo:region-end element.
  @@ -105,10 +104,10 @@
       }
   
       /**
  -     * @see org.apache.fop.fo.pagination.Region#getRegionAreaClass()
  +     * @see org.apache.fop.fo.pagination.Region#getRegionClassCode()
        */
  -    public int getRegionAreaClass() {
  -        return RegionReference.END;
  +    public int getRegionClassCode() {
  +        return Region.END_CODE;
       }
   
       /**
  
  
  
  1.5       +3 -4      xml-fop/src/java/org/apache/fop/fo/pagination/RegionStart.java
  
  Index: RegionStart.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/pagination/RegionStart.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- RegionStart.java  27 Aug 2003 01:51:06 -0000      1.4
  +++ RegionStart.java  27 Aug 2003 17:51:16 -0000      1.5
  @@ -58,7 +58,6 @@
   import org.apache.fop.fo.FOTreeVisitor;
   import org.apache.fop.fo.properties.WritingMode;
   import org.apache.fop.datatypes.FODimension;
  -import org.apache.fop.area.RegionReference;
   
   /**
    * The fo:region-start element.
  @@ -104,10 +103,10 @@
       }
   
       /**
  -     * @see org.apache.fop.fo.pagination.Region#getRegionAreaClass()
  +     * @see org.apache.fop.fo.pagination.Region#getRegionClassCode()
        */
  -    public int getRegionAreaClass() {
  -        return RegionReference.START;
  +    public int getRegionClassCode() {
  +        return Region.START_CODE;
       }
   
       /**
  
  
  
  1.13      +4 -4      xml-fop/src/java/org/apache/fop/layoutmgr/PageLayoutManager.java
  
  Index: PageLayoutManager.java
  ===================================================================
  RCS file: 
/home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/PageLayoutManager.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- PageLayoutManager.java    27 Aug 2003 15:55:34 -0000      1.12
  +++ PageLayoutManager.java    27 Aug 2003 17:51:16 -0000      1.13
  @@ -786,13 +786,13 @@
               regenum.hasNext();) {
              Region r = (Region)regenum.next();
              RegionViewport rvp = makeRegionViewport(r, reldims, pageCTM);
  -           if (r.getRegionAreaClass() == RegionReference.BODY) {
  +           if (r.getRegionClassCode() == Region.BODY_CODE) {
                  rvp.setRegion(makeRegionBodyReferenceArea(r, rvp.getViewArea()));
              } else {
                  rvp.setRegion(makeRegionReferenceArea(r, rvp.getViewArea()));
              }
  -           page.setRegion(r.getRegionAreaClass(), rvp);
  -           if (r.getRegionAreaClass() == RegionReference.BODY) {
  +           page.setRegion(r.getRegionClassCode(), rvp);
  +           if (r.getRegionClassCode() == RegionReference.BODY) {
                  bHasBody = true;
              }
          }
  @@ -871,7 +871,7 @@
        */
       public RegionReference makeRegionReferenceArea(Region r,
               Rectangle2D absRegVPRect) {
  -        RegionReference rr = new RegionReference(r.getRegionAreaClass());
  +        RegionReference rr = new RegionReference(r.getRegionClassCode());
           setRegionPosition(r, rr, absRegVPRect);
           return rr;
       }
  
  
  

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

Reply via email to