You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by gm...@apache.org on 2005/04/30 07:14:08 UTC

cvs commit: xml-fop/src/java/org/apache/fop/area BodyRegion.java

gmazza      2005/04/29 22:14:08

  Modified:    src/java/org/apache/fop/layoutmgr Tag:
                        Temp_KnuthStylePageBreaking
                        AbstractLayoutManager.java
                        PageSequenceLayoutManager.java
               src/java/org/apache/fop/area Tag:
                        Temp_KnuthStylePageBreaking BodyRegion.java
  Log:
  More PSLM simplifications.
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.41.2.6  +0 -3      xml-fop/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java
  
  Index: AbstractLayoutManager.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java,v
  retrieving revision 1.41.2.5
  retrieving revision 1.41.2.6
  diff -u -r1.41.2.5 -r1.41.2.6
  --- AbstractLayoutManager.java	29 Apr 2005 00:06:21 -0000	1.41.2.5
  +++ AbstractLayoutManager.java	30 Apr 2005 05:14:08 -0000	1.41.2.6
  @@ -340,9 +340,6 @@
           return null;
       }
   
  -    protected void flush() {
  -    }
  -
       public void addChildArea(Area childArea) {
       }
   
  
  
  
  1.50.2.20 +9 -45     xml-fop/src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java
  
  Index: PageSequenceLayoutManager.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java,v
  retrieving revision 1.50.2.19
  retrieving revision 1.50.2.20
  diff -u -r1.50.2.19 -r1.50.2.20
  --- PageSequenceLayoutManager.java	29 Apr 2005 00:06:21 -0000	1.50.2.19
  +++ PageSequenceLayoutManager.java	30 Apr 2005 05:14:08 -0000	1.50.2.20
  @@ -26,8 +26,6 @@
   import org.apache.fop.area.PageViewport;
   import org.apache.fop.area.LineArea;
   import org.apache.fop.area.RegionViewport;
  -import org.apache.fop.area.BeforeFloat;
  -import org.apache.fop.area.Footnote;
   import org.apache.fop.area.Resolvable;
   import org.apache.fop.area.Trait;
   
  @@ -139,7 +137,7 @@
           areaTreeModel.startPageSequence(title);
           log.debug("Starting layout");
   
  -        makeNewPage(false, true, false);
  +        curPV = makeNewPage(false, true, false);
   
           PageBreaker breaker = new PageBreaker(this);
           int flowBPD = (int) curPV.getBodyRegion().getBPD();
  @@ -377,21 +375,6 @@
           return mark;
       }
   
  -    /**
  -     * For now, only handle normal flow areas.
  -     * @see org.apache.fop.layoutmgr.LayoutManager#addChildArea(org.apache.fop.area.Area)
  -     */
  -    public void addChildArea(Area childArea) {
  -        if (childArea == null) {
  -            return;
  -        }
  -        if (childArea.getAreaClass() == Area.CLASS_NORMAL) {
  -            getParentArea(childArea);
  -        } else {
  -             // todo: all the others!
  -        }
  -    }
  -
       private PageViewport makeNewPage(boolean bIsBlank, boolean bIsFirst, boolean bIsLast) {
           if (curPV != null) {
               finishPage();
  @@ -469,7 +452,6 @@
                   log.error("bp==null  cls=" + reg.getRegionName());
               }
           }*/
  -        //lm.flush();
           lm.reset(null);
       }
   
  @@ -496,9 +478,6 @@
           if (breakVal != Constants.EN_AUTO) {
               // We may be forced to make new page
               handleBreak(breakVal);
  -        } else if (curPV == null) {
  -            log.debug("curPV is null. Making new page");
  -            makeNewPage(false, false, false);
           }
           /* Determine if a new span is needed.  From the XSL
            * fo:region-body definition, if an fo:block has a span="ALL"
  @@ -542,33 +521,18 @@
        */
       public Area getParentArea(Area childArea) {
           int aclass = childArea.getAreaClass();
  +
           if (aclass == Area.CLASS_NORMAL) {
               //We now do this in PageBreaker
               //prepareNormalFlowArea(childArea);
               return curPV.getCurrentSpan().getNormalFlow(curFlowIdx);
  -        } else {
  -            if (curPV == null) {
  -                makeNewPage(false, false, false);
  -            }
  -            // Now handle different kinds of areas
  -            if (aclass == Area.CLASS_BEFORE_FLOAT) {
  -                BeforeFloat bf = curPV.getBodyRegion().getBeforeFloat();
  -                if (bf == null) {
  -                    bf = new BeforeFloat();
  -                    curPV.getBodyRegion().setBeforeFloat(bf);
  -                }
  -                return bf;
  -            } else if (aclass == Area.CLASS_FOOTNOTE) {
  -                Footnote fn = curPV.getBodyRegion().getFootnote();
  -                if (fn == null) {
  -                    fn = new Footnote();
  -                    curPV.getBodyRegion().setFootnote(fn);
  -                }
  -                return fn;
  -            }
  -            // todo!!! other area classes (side-float, absolute, fixed)
  -            return null;
  +        } else if (aclass == Area.CLASS_BEFORE_FLOAT) {
  +            return curPV.getBodyRegion().getBeforeFloat();
  +        } else if (aclass == Area.CLASS_FOOTNOTE) {
  +            return curPV.getBodyRegion().getFootnote();
           }
  +        // todo!!! other area classes (side-float, absolute, fixed)
  +        return null;
       }
   
       /**
  
  
  
  No                   revision
  No                   revision
  1.12.2.3  +16 -28    xml-fop/src/java/org/apache/fop/area/BodyRegion.java
  
  Index: BodyRegion.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/area/BodyRegion.java,v
  retrieving revision 1.12.2.2
  retrieving revision 1.12.2.3
  diff -u -r1.12.2.2 -r1.12.2.3
  --- BodyRegion.java	28 Mar 2005 06:14:13 -0000	1.12.2.2
  +++ BodyRegion.java	30 Apr 2005 05:14:08 -0000	1.12.2.3
  @@ -76,34 +76,7 @@
       public int getColumnGap() {
           return this.columnGap;
       }
  -    
  -    /**
  -     * Set the before float area.
  -     *
  -     * @param bf the before float area
  -     */
  -    public void setBeforeFloat(BeforeFloat bf) {
  -        beforeFloat = bf;
  -    }
  -
  -    /**
  -     * Set the footnote area.
  -     *
  -     * @param foot the footnote area
  -     */
  -    public void setFootnote(Footnote foot) {
  -        footnote = foot;
  -    }
  -
  -    /**
  -     * Get the before float area.
  -     *
  -     * @return the before float area
  -     */
  -    public BeforeFloat getBeforeFloat() {
  -        return beforeFloat;
  -    }
  -
  +   
       /**
        * Get the main reference area.
        *
  @@ -124,11 +97,26 @@
   
   
       /**
  +     * Get the before float area.
  +     *
  +     * @return the before float area
  +     */
  +    public BeforeFloat getBeforeFloat() {
  +        if (beforeFloat == null) {
  +            beforeFloat = new BeforeFloat();
  +        }
  +        return beforeFloat;
  +    }
  +
  +    /**
        * Get the footnote area.
        *
        * @return the footnote area
        */
       public Footnote getFootnote() {
  +        if (footnote == null) {
  +            footnote = new Footnote();
  +        }
           return footnote;
       }
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org