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/25 04:54:24 UTC

cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr PageSequenceLayoutManager.java StaticContentLayoutManager.java

gmazza      2005/04/24 19:54:24

  Modified:    src/java/org/apache/fop/layoutmgr Tag:
                        Temp_KnuthStylePageBreaking
                        PageSequenceLayoutManager.java
                        StaticContentLayoutManager.java
  Log:
  Minor simplifications.
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.50.2.15 +14 -9     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.14
  retrieving revision 1.50.2.15
  diff -u -r1.50.2.14 -r1.50.2.15
  --- PageSequenceLayoutManager.java	24 Apr 2005 23:54:34 -0000	1.50.2.14
  +++ PageSequenceLayoutManager.java	25 Apr 2005 02:54:24 -0000	1.50.2.15
  @@ -44,7 +44,6 @@
   import java.util.LinkedList;
   import java.util.List;
   import java.util.Map;
  -import org.apache.fop.traits.MinOptMax;
   
   /**
    * LayoutManager for a PageSequence.
  @@ -82,14 +81,18 @@
       private AreaTreeModel areaTreeModel;
   
       /**
  -     * The collection of StaticContentLayoutManager objects that are associated
  -     * with this Page Sequence, keyed by flow-name.
  +     * The single FlowLayoutManager object, which processes
  +     * the single fo:flow of the fo:page-sequence
        */
  -    //private HashMap staticContentLMs = new HashMap(4);
  -
       private FlowLayoutManager childFLM = null;
       
       /**
  +     * The collection of StaticContentLayoutManager objects that
  +     * are associated with this Page Sequence, keyed by flow-name.
  +     */
  +    //private HashMap staticContentLMs = new HashMap(4);
  +
  +    /**
        * Constructor - activated by AreaTreeHandler for each
        * fo:page-sequence in the input FO stream
        *
  @@ -434,6 +437,9 @@
           return curPage;
       }
   
  +    /* TODO: See if can initialize the SCLM's just once for
  +     * the page sequence, instead of after every page.
  +     */
       private void layoutSideRegion(int regionID) {
           SideRegion reg = (SideRegion)curPage.getSPM().getRegion(regionID);
           if (reg == null) {
  @@ -449,7 +455,7 @@
           lm = (StaticContentLayoutManager)
               areaTreeHandler.getLayoutManagerMaker().makeLayoutManager(sc);
           lm.initialize();
  -        lm.setRegionReference(rv.getRegionReference());
  +        lm.setTargetRegion(rv.getRegionReference());
           lm.setParent(this);
           /*
           LayoutContext childLC = new LayoutContext(0);
  @@ -457,8 +463,7 @@
           childLC.setRefIPD(rv.getRegion().getIPD());
           */
           
  -        MinOptMax range = new MinOptMax(rv.getRegionReference().getIPD());
  -        lm.doLayout(reg, lm, range);
  +        lm.doLayout(reg);
           
           /*
           while (!lm.isFinished()) {
  
  
  
  1.8.2.4   +16 -13    xml-fop/src/java/org/apache/fop/layoutmgr/StaticContentLayoutManager.java
  
  Index: StaticContentLayoutManager.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/StaticContentLayoutManager.java,v
  retrieving revision 1.8.2.3
  retrieving revision 1.8.2.4
  diff -u -r1.8.2.3 -r1.8.2.4
  --- StaticContentLayoutManager.java	14 Apr 2005 00:17:06 -0000	1.8.2.3
  +++ StaticContentLayoutManager.java	25 Apr 2005 02:54:24 -0000	1.8.2.4
  @@ -39,8 +39,7 @@
    * and filling them with block-level areas generated by its children.
    */
   public class StaticContentLayoutManager extends BlockStackingLayoutManager {
  -
  -    private RegionReference region;
  +    private RegionReference targetRegion;
       private List blockBreaks = new ArrayList();
   
       public StaticContentLayoutManager(StaticContent node) {
  @@ -51,13 +50,16 @@
        * Sets the region reference
        * @param region region reference
        */
  -    public void setRegionReference(RegionReference region) {
  -        this.region = region;
  +    public void setTargetRegion(RegionReference targetRegion) {
  +        this.targetRegion = targetRegion;
       }
   
  -    /** @return the region reference */
  -    public RegionReference getRegionReference() {
  -        return this.region;
  +    /** 
  +     * @return the region-reference-area that this 
  +     * static content is directed to.  
  +     */
  +    public RegionReference getTargetRegion() {
  +        return targetRegion;
       }
       
       /**
  @@ -205,7 +207,7 @@
           blockBreaks.clear();
           */
           flush();
  -        region = null;
  +        targetRegion = null;
       }
   
   
  @@ -216,19 +218,20 @@
        * @see org.apache.fop.layoutmgr.LayoutManager#addChildArea(Area)
        */
       public void addChildArea(Area childArea) {
  -        region.addBlock((Block)childArea);
  +        targetRegion.addBlock((Block)childArea);
       }
   
       /**
        * @see org.apache.fop.layoutmgr.LayoutManager#getParentArea(Area)
        */
       public Area getParentArea(Area childArea) {
  -        return region;
  +        return targetRegion;
       }
   
  -    public void doLayout(SideRegion region, StaticContentLayoutManager lm, MinOptMax ipd) {
  -        StaticContentBreaker breaker = new StaticContentBreaker(region, lm, ipd);
  -        breaker.doLayout(lm.getRegionReference().getBPD());
  +    public void doLayout(SideRegion region) {
  +        MinOptMax range = new MinOptMax(targetRegion.getIPD());
  +        StaticContentBreaker breaker = new StaticContentBreaker(region, this, range);
  +        breaker.doLayout(targetRegion.getBPD());
           if (breaker.isOverflow()) {
               if (region.getOverflow() == EN_ERROR_IF_OVERFLOW) {
                   //TODO throw layout exception
  
  
  

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