vmote       2003/08/24 11:04:07

  Modified:    src/java/org/apache/fop/area CTM.java
               src/java/org/apache/fop/fo/pagination Region.java
                        SimplePageMaster.java
               src/java/org/apache/fop/layoutmgr
                        BlockContainerLayoutManager.java
  Log:
  make area/CTM.getCTMandRelDims() more general by decoupling it from 
fo/PropertyManager
  
  Revision  Changes    Path
  1.5       +6 -6      xml-fop/src/java/org/apache/fop/area/CTM.java
  
  Index: CTM.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/area/CTM.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- CTM.java  24 Aug 2003 17:46:10 -0000      1.4
  +++ CTM.java  24 Aug 2003 18:04:06 -0000      1.5
  @@ -285,12 +285,13 @@
        * @param reldims relative dimensions
        * @return CTM the coordinate transformation matrix (CTM)
        */
  -    public static CTM getCTMandRelDims(PropertyManager pm, Rectangle2D absVPrect,
  -                                FODimension reldims) {
  +    public static CTM getCTMandRelDims(int absRefOrient,
  +                                       int writingMode,
  +                                       Rectangle2D absVPrect,
  +                                       FODimension reldims) {
           int width, height;
           // We will use the absolute reference-orientation to set up the CTM.
           // The value here is relative to its ancestor reference area.
  -        int absRefOrient = pm.getAbsRefOrient();
           if (absRefOrient % 180 == 0) {
               width = (int) absVPrect.getWidth();
               height = (int) absVPrect.getHeight();
  @@ -326,13 +327,12 @@
               }
               ctm = ctm.rotate(absRefOrient);
           }
  -        int wm = pm.getWritingMode();
           /* Since we've already put adjusted width and height values for the
            * top and left positions implied by the reference-orientation, we
            * can set ipd and bpd appropriately based on the writing mode.
            */
   
  -        if (wm == WritingMode.LR_TB || wm == WritingMode.RL_TB) {
  +        if (writingMode == WritingMode.LR_TB || writingMode == WritingMode.RL_TB) {
               reldims.ipd = width;
               reldims.bpd = height;
           } else {
  @@ -341,7 +341,7 @@
           }
           // Set a rectangle to be the writing-mode relative version???
           // Now transform for writing mode
  -        return ctm.multiply(CTM.getWMctm(wm, reldims.ipd, reldims.bpd));
  +        return ctm.multiply(CTM.getWMctm(writingMode, reldims.ipd, reldims.bpd));
       }
   
   }
  
  
  
  1.6       +2 -1      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.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Region.java       23 Aug 2003 19:26:30 -0000      1.5
  +++ Region.java       24 Aug 2003 18:04:06 -0000      1.6
  @@ -195,7 +195,8 @@
        */
       protected void setRegionPosition(RegionReference r, Rectangle2D absRegVPRect) {
           FODimension reldims = new FODimension(0, 0);
  -        r.setCTM(CTM.getCTMandRelDims(propMgr, absRegVPRect, reldims));
  +        r.setCTM(CTM.getCTMandRelDims(propMgr.getAbsRefOrient(),
  +                propMgr.getWritingMode(), absRegVPRect, reldims));
       }
   
       /**
  
  
  
  1.6       +2 -1      
xml-fop/src/java/org/apache/fop/fo/pagination/SimplePageMaster.java
  
  Index: SimplePageMaster.java
  ===================================================================
  RCS file: 
/home/cvs/xml-fop/src/java/org/apache/fop/fo/pagination/SimplePageMaster.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- SimplePageMaster.java     23 Aug 2003 19:26:30 -0000      1.5
  +++ SimplePageMaster.java     24 Aug 2003 18:04:06 -0000      1.6
  @@ -149,7 +149,8 @@
           // Set up the CTM on the page reference area based on writing-mode
           // and reference-orientation
           FODimension reldims = new FODimension(0, 0);
  -        CTM pageCTM = CTM.getCTMandRelDims(propMgr, pageRefRect, reldims);
  +        CTM pageCTM = CTM.getCTMandRelDims(propMgr.getAbsRefOrient(),
  +                propMgr.getWritingMode(), pageRefRect, reldims);
   
           // Create a RegionViewport/ reference area pair for each page region
   
  
  
  
  1.5       +4 -2      
xml-fop/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java
  
  Index: BlockContainerLayoutManager.java
  ===================================================================
  RCS file: 
/home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- BlockContainerLayoutManager.java  23 Aug 2003 19:26:30 -0000      1.4
  +++ BlockContainerLayoutManager.java  24 Aug 2003 18:04:07 -0000      1.5
  @@ -100,7 +100,8 @@
                                   abProps.top, abProps.right - abProps.left,
                                   abProps.bottom - abProps.top);
               relDims = new FODimension(0, 0);
  -            absoluteCTM = CTM.getCTMandRelDims(pm, rect, relDims);
  +            absoluteCTM = CTM.getCTMandRelDims(pm.getAbsRefOrient(),
  +                pm.getWritingMode(), rect, relDims);
           }
       }
   
  @@ -121,7 +122,8 @@
           Rectangle2D rect = new Rectangle2D.Double(0, 0, context.getRefIPD(),
                                                     context.getStackLimit().opt);
           relDims = new FODimension(0, 0);
  -        absoluteCTM = CTM.getCTMandRelDims(propManager, rect, relDims);
  +        absoluteCTM = CTM.getCTMandRelDims(propManager.getAbsRefOrient(),
  +                propManager.getWritingMode(), rect, relDims);
           double[] vals = absoluteCTM.toArray();
   
           MinOptMax stackLimit;
  
  
  

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

Reply via email to