vmote       2003/08/26 18:51:06

  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:
  move makeRegionViewport() and setRegionViewportTraits() from fo/pagination/Region to 
layoutmgr/PageLayoutManager
  
  Revision  Changes    Path
  1.8       +1 -36     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.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- Region.java       26 Aug 2003 22:11:17 -0000      1.7
  +++ Region.java       27 Aug 2003 01:51:06 -0000      1.8
  @@ -59,13 +59,9 @@
   import org.apache.fop.fo.FObj;
   import org.apache.fop.fo.FONode;
   import org.apache.fop.fo.FOTreeVisitor;
  -import org.apache.fop.fo.properties.CommonBorderAndPadding;
  -import org.apache.fop.fo.properties.CommonBackground;
   import org.apache.fop.apps.FOPException;
   import org.apache.fop.area.CTM;
  -import org.apache.fop.area.RegionViewport;
   import org.apache.fop.area.RegionReference;
  -import org.apache.fop.layoutmgr.TraitSetter;
   
   // SAX
   import org.xml.sax.Attributes;
  @@ -133,44 +129,13 @@
                       + parent.getName());
           }
           this.wm = this.properties.get("writing-mode").getEnum();
  -    }
  -
  -    /**
  -     * Creates a RegionViewport Area object for this pagination Region.
  -     * @param reldims relative dimensions
  -     * @param pageCTM page coordinate transformation matrix
  -     * @return the new region viewport
  -     */
  -    public RegionViewport makeRegionViewport(FODimension reldims, CTM pageCTM) {
  -        Rectangle2D relRegionRect = getViewportRectangle(reldims);
  -        Rectangle2D absRegionRect = pageCTM.transform(relRegionRect);
  -        // Get the region viewport rectangle in absolute coords by
  -        // transforming it using the page CTM
  -        RegionViewport rv = new RegionViewport(absRegionRect);
  -        setRegionViewportTraits(rv);
  -        return rv;
  -    }
  -
  -    /**
  -     * Set the region viewport traits.
  -     * The viewport has the border, background and
  -     * clipping overflow traits.
  -     *
  -     * @param r the region viewport
  -     */
  -    protected void setRegionViewportTraits(RegionViewport r) {
  -        // Common Border, Padding, and Background Properties
  -        CommonBorderAndPadding bap = propMgr.getBorderAndPadding();
  -        CommonBackground bProps = propMgr.getBackgroundProps();
  -        TraitSetter.addBorders(r, bap);
  -        TraitSetter.addBackground(r, bProps);
   
           // this.properties.get("clip");
           // this.properties.get("display-align");
           this.overflow = this.properties.get("overflow").getEnum();
       }
   
  -    protected abstract Rectangle getViewportRectangle(FODimension pageRefRect);
  +    public abstract Rectangle getViewportRectangle(FODimension pageRefRect);
   
       /**
        * Create the region reference area for this region master.
  
  
  
  1.4       +1 -1      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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- RegionAfter.java  22 Aug 2003 06:27:34 -0000      1.3
  +++ RegionAfter.java  27 Aug 2003 01:51:06 -0000      1.4
  @@ -75,7 +75,7 @@
       /**
        * @see org.apache.fop.fo.pagination.Region#getViewportRectangle(FODimension)
        */
  -    protected Rectangle getViewportRectangle (FODimension reldims) {
  +    public Rectangle getViewportRectangle (FODimension reldims) {
           // Depends on extent, precedence ans writing mode
           Rectangle vpRect;
           if (this.wm == WritingMode.LR_TB || this.wm == WritingMode.RL_TB) {
  
  
  
  1.4       +1 -1      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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- RegionBefore.java 22 Aug 2003 06:27:34 -0000      1.3
  +++ RegionBefore.java 27 Aug 2003 01:51:06 -0000      1.4
  @@ -96,7 +96,7 @@
       /**
        * @see org.apache.fop.fo.pagination.Region#getViewportRectangle(FODimension)
        */
  -    protected Rectangle getViewportRectangle (FODimension reldims) {
  +    public Rectangle getViewportRectangle (FODimension reldims) {
           // Depends on extent, precedence and writing mode
           // This should return rectangle in writing-mode coordinates relative
           // to the page-reference area rectangle
  
  
  
  1.5       +1 -1      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.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- RegionBody.java   22 Aug 2003 06:27:34 -0000      1.4
  +++ RegionBody.java   27 Aug 2003 01:51:06 -0000      1.5
  @@ -85,7 +85,7 @@
       /**
        * @see org.apache.fop.fo.pagination.Region#getViewportRectangle(FODimension)
        */
  -    protected Rectangle getViewportRectangle (FODimension reldims) {
  +    public Rectangle getViewportRectangle (FODimension reldims) {
           /*
           * Use space-before and space-after which will use corresponding
           * absolute margin properties if specified. For indents:
  
  
  
  1.4       +1 -1      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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- RegionEnd.java    22 Aug 2003 06:27:34 -0000      1.3
  +++ RegionEnd.java    27 Aug 2003 01:51:06 -0000      1.4
  @@ -76,7 +76,7 @@
       /**
        * @see org.apache.fop.fo.pagination.Region#getViewportRectangle(FODimension)
        */
  -    protected Rectangle getViewportRectangle (FODimension reldims) {
  +    public Rectangle getViewportRectangle (FODimension reldims) {
           // Depends on extent, precedence and writing mode
           Rectangle vpRect;
           if (this.wm == WritingMode.LR_TB || this.wm == WritingMode.RL_TB) {
  
  
  
  1.4       +1 -1      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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- RegionStart.java  22 Aug 2003 06:27:34 -0000      1.3
  +++ RegionStart.java  27 Aug 2003 01:51:06 -0000      1.4
  @@ -75,7 +75,7 @@
       /**
        * @see org.apache.fop.fo.pagination.Region#getViewportRectangle(FODimension)
        */
  -    protected Rectangle getViewportRectangle (FODimension reldims) {
  +    public Rectangle getViewportRectangle (FODimension reldims) {
           // Depends on extent, precedence and writing mode
           // This is the rectangle relative to the page-reference area in
           // writing-mode relative coordinates
  
  
  
  1.10      +35 -1     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.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- PageLayoutManager.java    27 Aug 2003 01:23:59 -0000      1.9
  +++ PageLayoutManager.java    27 Aug 2003 01:51:06 -0000      1.10
  @@ -79,6 +79,8 @@
   import org.apache.fop.fo.pagination.SimplePageMaster;
   import org.apache.fop.fo.pagination.StaticContent;
   
  +import org.apache.fop.fo.properties.CommonBackground;
  +import org.apache.fop.fo.properties.CommonBorderAndPadding;
   import org.apache.fop.fo.properties.CommonMarginBlock;
   import org.apache.fop.fo.properties.Constants;
   
  @@ -87,6 +89,7 @@
   import java.util.Map;
   import java.awt.Rectangle;
   import java.util.Iterator;
  +import java.awt.geom.Rectangle2D;
   
   /**
    * LayoutManager for a PageSequence and its flow.
  @@ -781,7 +784,7 @@
          for (Iterator regenum = spm.getRegions().values().iterator();
               regenum.hasNext();) {
              Region r = (Region)regenum.next();
  -           RegionViewport rvp = r.makeRegionViewport(reldims, pageCTM);
  +           RegionViewport rvp = makeRegionViewport(r, reldims, pageCTM);
              rvp.setRegion(r.makeRegionReferenceArea(rvp.getViewArea()));
              page.setRegion(r.getRegionAreaClass(), rvp);
              if (r.getRegionAreaClass() == RegionReference.BODY) {
  @@ -795,6 +798,37 @@
   
          return new PageViewport(page, new Rectangle(0, 0, pageWidth, pageHeight));
   
  +    }
  +
  +    /**
  +     * Creates a RegionViewport Area object for this pagination Region.
  +     * @param reldims relative dimensions
  +     * @param pageCTM page coordinate transformation matrix
  +     * @return the new region viewport
  +     */
  +    public RegionViewport makeRegionViewport(Region r, FODimension reldims, CTM 
pageCTM) {
  +        Rectangle2D relRegionRect = r. getViewportRectangle(reldims);
  +        Rectangle2D absRegionRect = pageCTM.transform(relRegionRect);
  +        // Get the region viewport rectangle in absolute coords by
  +        // transforming it using the page CTM
  +        RegionViewport rv = new RegionViewport(absRegionRect);
  +        setRegionViewportTraits(r, rv);
  +        return rv;
  +    }
  +
  +    /**
  +     * Set the region viewport traits.
  +     * The viewport has the border, background and
  +     * clipping overflow traits.
  +     *
  +     * @param r the region viewport
  +     */
  +    protected void setRegionViewportTraits(Region r, RegionViewport rv) {
  +        // Common Border, Padding, and Background Properties
  +        CommonBorderAndPadding bap = r.getPropertyManager().getBorderAndPadding();
  +        CommonBackground bProps = r.getPropertyManager().getBackgroundProps();
  +        TraitSetter.addBorders(rv, bap);
  +        TraitSetter.addBackground(rv, bProps);
       }
   
   }
  
  
  

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

Reply via email to