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/05/10 00:15:21 UTC

cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr LineLayoutManager.java ContentLayoutManager.java AbstractLayoutManager.java BasicLinkLayoutManager.java PageSequenceLayoutManager.java LayoutManager.java PageNumberCitationLayoutManager.java PageNumberLayoutManager.java

gmazza      2005/05/09 15:15:21

  Modified:    src/java/org/apache/fop/layoutmgr Tag:
                        Temp_KnuthStylePageBreaking LineLayoutManager.java
                        ContentLayoutManager.java
                        AbstractLayoutManager.java
                        BasicLinkLayoutManager.java
                        PageSequenceLayoutManager.java LayoutManager.java
                        PageNumberCitationLayoutManager.java
                        PageNumberLayoutManager.java
  Log:
  Added getPSLM() to LM interface, removed six other methods.
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.42.2.7  +0 -22     xml-fop/src/java/org/apache/fop/layoutmgr/LineLayoutManager.java
  
  Index: LineLayoutManager.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/LineLayoutManager.java,v
  retrieving revision 1.42.2.6
  retrieving revision 1.42.2.7
  diff -u -r1.42.2.6 -r1.42.2.7
  --- LineLayoutManager.java	2 May 2005 16:23:37 -0000	1.42.2.6
  +++ LineLayoutManager.java	9 May 2005 22:15:20 -0000	1.42.2.7
  @@ -25,7 +25,6 @@
   import org.apache.fop.hyphenation.Hyphenation;
   import org.apache.fop.hyphenation.Hyphenator;
   import org.apache.fop.area.LineArea;
  -import org.apache.fop.area.Resolvable;
   
   import java.util.ListIterator;
   import java.util.Iterator;
  @@ -1572,26 +1571,5 @@
           }
           setCurrentArea(null); // ?? necessary
       }
  -
  -    /**
  -     * Add an unresolved area.
  -     * If a child layout manager needs to add an unresolved area
  -     * for page reference or linking then this intercepts it for
  -     * line area handling.
  -     * A line area may need to have the inline areas adjusted
  -     * to properly fill the line area. This adds a resolver that
  -     * resolves the inline area and can do the necessary
  -     * adjustments to the line and inline areas.
  -     *
  -     * @param id the id reference of the resolvable
  -     * @param res the resolvable object
  -     */
  -    public void addUnresolvedArea(String id, Resolvable res) {
  -        // create a resolvable class that handles ipd
  -        // adjustment for the current line
  -
  -        parentLM.addUnresolvedArea(id, res);
  -    }
  -
   }
   
  
  
  
  1.24.2.7  +4 -37     xml-fop/src/java/org/apache/fop/layoutmgr/ContentLayoutManager.java
  
  Index: ContentLayoutManager.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/ContentLayoutManager.java,v
  retrieving revision 1.24.2.6
  retrieving revision 1.24.2.7
  diff -u -r1.24.2.6 -r1.24.2.7
  --- ContentLayoutManager.java	9 May 2005 03:32:10 -0000	1.24.2.6
  +++ ContentLayoutManager.java	9 May 2005 22:15:20 -0000	1.24.2.7
  @@ -22,12 +22,9 @@
   import org.apache.fop.fo.FObj;
   import org.apache.fop.fo.Constants;
   import org.apache.fop.fo.pagination.Title;
  -import org.apache.fop.fo.flow.Marker;
   import org.apache.fop.area.Area;
   import org.apache.fop.area.LineArea;
   import org.apache.fop.area.inline.InlineArea;
  -import org.apache.fop.area.Resolvable;
  -import org.apache.fop.area.PageViewport;
   
   import java.util.LinkedList;
   import java.util.List;
  @@ -249,39 +246,6 @@
       public void getWordChars(StringBuffer sbChars, Position bp1,
               Position bp2) { }
   
  -    /** @see org.apache.fop.layoutmgr.LayoutManager */
  -    public PageViewport getCurrentPV() {
  -        return parentLM.getCurrentPV();
  -    }
  -
  -    /** @see org.apache.fop.layoutmgr.LayoutManager */
  -    public PageViewport getFirstPVWithID(String ref) {
  -        return parentLM.getFirstPVWithID(ref);
  -    }
  -
  -    /** @see org.apache.fop.layoutmgr.LayoutManager */
  -    public void addIDToPage(String id) {
  -        parentLM.addIDToPage(id);
  -    }
  -
  -    /** @see org.apache.fop.layoutmgr.LayoutManager */
  -    public void addUnresolvedArea(String id, Resolvable res) {
  -        parentLM.addUnresolvedArea(id, res);
  -    }
  -
  -    /** @see org.apache.fop.layoutmgr.LayoutManager */
  -    public Marker retrieveMarker(String name, int pos, int boundary) {
  -        return parentLM.retrieveMarker(name, pos, boundary);
  -    }
  -
  -    /**
  -     * @see org.apache.fop.layoutmgr.LayoutManager
  -     * @return the LayoutManagerMaker object.
  -     */
  -    public LayoutManagerMaker getLayoutManagerMaker() {
  -        return parentLM.getLayoutManagerMaker();
  -    }
  -
       /**
        * @see org.apache.fop.layoutmgr.LayoutManager#preLoadNext
        */
  @@ -369,6 +333,9 @@
                                                 int alignment) {
           return null;
       }
  -
  +    
  +    public PageSequenceLayoutManager getPSLM() {
  +    	return parentLM.getPSLM();
  +    }
   }
   
  
  
  
  1.41.2.8  +17 -61    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.7
  retrieving revision 1.41.2.8
  diff -u -r1.41.2.7 -r1.41.2.8
  --- AbstractLayoutManager.java	9 May 2005 03:32:10 -0000	1.41.2.7
  +++ AbstractLayoutManager.java	9 May 2005 22:15:20 -0000	1.41.2.8
  @@ -21,7 +21,6 @@
   import org.apache.fop.fo.FObj;
   import org.apache.fop.fo.FONode;
   import org.apache.fop.area.Area;
  -import org.apache.fop.area.Resolvable;
   import org.apache.fop.area.PageViewport;
   import org.apache.fop.fo.Constants;
   import org.apache.fop.fo.flow.RetrieveMarker;
  @@ -344,71 +343,16 @@
       }
   
       /**
  -     * Delegate getting the current page viewport to the parent layout manager.
  -     *
  -     * @see org.apache.fop.layoutmgr.LayoutManager
  -     */
  -    public PageViewport getCurrentPV() {
  -        return parentLM.getCurrentPV();
  -    }
  -
  -    /**
  -     * Delegate resolving the id reference to the PSLM
  -     *
  -     * @see org.apache.fop.layoutmgr.LayoutManager
  -     */
  -    public PageViewport getFirstPVWithID(String ref) {
  -        return parentLM.getFirstPVWithID(ref);
  -    }
  -
  -    /**
        * Add the id to the page.
        * If the id string is not null then add the id to the current page.
        */
       protected void addID(String foID) {
           if (foID != null && foID.length() > 0) {
  -            addIDToPage(foID);
  +            getPSLM().addIDToPage(foID);
           }
       }
   
       /**
  -     * Delegate adding id reference to the parent layout manager.
  -     *
  -     * @see org.apache.fop.layoutmgr.LayoutManager
  -     */
  -    public void addIDToPage(String id) {
  -        parentLM.addIDToPage(id);
  -    }
  -
  -    /**
  -     * Delegate adding unresolved area to the parent layout manager.
  -     *
  -     * @see org.apache.fop.layoutmgr.LayoutManager
  -     */
  -    public void addUnresolvedArea(String id, Resolvable res) {
  -        parentLM.addUnresolvedArea(id, res);
  -    }
  -
  -    /**
  -     * Delegate retrieve marker to the parent layout manager.
  -     *
  -     * @see org.apache.fop.layoutmgr.LayoutManager
  -     */
  -    public Marker retrieveMarker(String name, int pos, int boundary) {
  -        return parentLM.retrieveMarker(name, pos, boundary);
  -    }
  -
  -    /**
  -     * Delegate getLayoutManagerMaker to the parent layout manager.
  -     *
  -     * @see org.apache.fop.layoutmgr.LayoutManager
  -     * @return the LayoutManagerMaker object.
  -     */
  -    public LayoutManagerMaker getLayoutManagerMaker() {
  -        return parentLM.getLayoutManagerMaker();
  -    }
  -
  -    /**
        * Handles retrieve-marker nodes as they occur.
        * @param foNode FO node to check
        * @return the original foNode or in case of a retrieve-marker the replaced
  @@ -418,7 +362,7 @@
       private FONode handleRetrieveMarker(FONode foNode) {
           if (foNode instanceof RetrieveMarker) {
               RetrieveMarker rm = (RetrieveMarker) foNode;
  -            Marker marker = retrieveMarker(rm.getRetrieveClassName(),
  +            Marker marker = getPSLM().retrieveMarker(rm.getRetrieveClassName(),
                                              rm.getRetrievePosition(),
                                              rm.getRetrieveBoundary());
               if (marker == null) {
  @@ -447,7 +391,7 @@
                   FONode foNode = (FONode) theobj;
                   foNode = handleRetrieveMarker(foNode);
                   if (foNode != null) {
  -                    getLayoutManagerMaker().
  +                    getPSLM().getLayoutManagerMaker().
                           makeLayoutManagers(foNode, newLMs);
                   }
               }
  @@ -456,6 +400,20 @@
       }
   
       /**
  +     * @see org.apache.fop.layoutmgr.PageSequenceLayoutManager#getPSLM
  +     */
  +    public PageSequenceLayoutManager getPSLM() {
  +    	return parentLM.getPSLM();
  +    }
  +    
  +    /**
  +     * @see org.apache.fop.layoutmgr.PageSequenceLayoutManager#getCurrentPV
  +     */
  +    public PageViewport getCurrentPV() {
  +    	return getPSLM().getCurrentPV();
  +    }  
  +    
  +    /**
        * @see org.apache.fop.layoutmgr.LayoutManager#preLoadNext
        */
       public boolean preLoadNext(int pos) {
  @@ -504,6 +462,4 @@
               addChildLM(lm);
           }
       }
  -
   }
  -
  
  
  
  1.6.2.2   +3 -3      xml-fop/src/java/org/apache/fop/layoutmgr/BasicLinkLayoutManager.java
  
  Index: BasicLinkLayoutManager.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/BasicLinkLayoutManager.java,v
  retrieving revision 1.6.2.1
  retrieving revision 1.6.2.2
  diff -u -r1.6.2.1 -r1.6.2.2
  --- BasicLinkLayoutManager.java	9 May 2005 03:32:10 -0000	1.6.2.1
  +++ BasicLinkLayoutManager.java	9 May 2005 22:15:20 -0000	1.6.2.2
  @@ -52,12 +52,12 @@
                area.addTrait(Trait.EXTERNAL_LINK, fobj.getExternalDestination());
            } else {
                String idref = fobj.getInternalDestination();
  -             PageViewport page = parentLM.getFirstPVWithID(idref);
  +             PageViewport page = getPSLM().getFirstPVWithID(idref);
                if (page != null) {
                    area.addTrait(Trait.INTERNAL_LINK, page.getKey());
                } else {
                    LinkResolver res = new LinkResolver(idref, area);
  -                 parentLM.addUnresolvedArea(idref, res);
  +                 getPSLM().addUnresolvedArea(idref, res);
                }
            }
        }
  
  
  
  1.50.2.26 +9 -1      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.25
  retrieving revision 1.50.2.26
  diff -u -r1.50.2.25 -r1.50.2.26
  --- PageSequenceLayoutManager.java	9 May 2005 03:32:10 -0000	1.50.2.25
  +++ PageSequenceLayoutManager.java	9 May 2005 22:15:20 -0000	1.50.2.26
  @@ -270,6 +270,14 @@
       }
   
       /**
  +     * Provides access to this object
  +     * @return this PageSequenceLayoutManager instance
  +     */
  +    public PageSequenceLayoutManager getPSLM() {
  +    	return this;
  +    }
  +    
  +    /**
        * This returns the first PageViewport that contains an id trait
        * matching the idref argument, or null if no such PV exists.
        *
  
  
  
  1.21.2.7  +7 -27     xml-fop/src/java/org/apache/fop/layoutmgr/LayoutManager.java
  
  Index: LayoutManager.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/LayoutManager.java,v
  retrieving revision 1.21.2.6
  retrieving revision 1.21.2.7
  diff -u -r1.21.2.6 -r1.21.2.7
  --- LayoutManager.java	9 May 2005 03:32:10 -0000	1.21.2.6
  +++ LayoutManager.java	9 May 2005 22:15:20 -0000	1.21.2.7
  @@ -21,11 +21,7 @@
   import java.util.LinkedList;
   import java.util.List;
   
  -import org.apache.fop.fo.flow.Marker;
  -
   import org.apache.fop.area.Area;
  -import org.apache.fop.area.Resolvable;
  -import org.apache.fop.area.PageViewport;
   import org.apache.fop.fo.FObj;
   
   /**
  @@ -62,6 +58,12 @@
       void initialize();
   
       /**
  +     * Get the active PageSequenceLayoutManager instance for this
  +     * layout process.
  +     */
  +    PageSequenceLayoutManager getPSLM();
  +
  +    /**
        * Generates inline areas.
        * This is used to check if the layout manager generates inline
        * areas.
  @@ -167,13 +169,6 @@
       void addAreas(PositionIterator posIter, LayoutContext context);
   
       /**
  -     * Get the PageViewport currently being generated
  -     *
  -     * @return the current PageViewport
  -     */
  -    PageViewport getCurrentPV();
  -
  -    /**
        * Load next child LMs, up to child LM index pos
        * @param pos index up to which child LMs are requested
        * @return if requested index does exist
  @@ -220,21 +215,6 @@
        */
       LinkedList getChangedKnuthElements(List oldList, /*int flaggedPenalty,*/
                                          int alignment);
  -
  -    /** @see PageSequenceLayoutManager#getFirstPVWithID(String) */
  -    PageViewport getFirstPVWithID(String ref);
  -
  -    /** @see PageSequenceLayoutManager#addIDToPage(String) */
  -    void addIDToPage(String id);
  -
  -    /** @see PageSequenceLayoutManager#addUnresolvedArea(String, Resolvable) */
  -    void addUnresolvedArea(String id, Resolvable res);
  -
  -    /** @see PageSequenceLayoutManager#retrieveMarker(String, int, int) */
  -    Marker retrieveMarker(String name, int pos, int boundary);
  -
  -    /** @see PageSequenceLayoutManager#getLayoutManagerMaker() */
  -    LayoutManagerMaker getLayoutManagerMaker();
  -
  +   
       public static final int FLAGGED_PENALTY = 50;
   }
  
  
  
  1.12.2.2  +3 -3      xml-fop/src/java/org/apache/fop/layoutmgr/PageNumberCitationLayoutManager.java
  
  Index: PageNumberCitationLayoutManager.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/PageNumberCitationLayoutManager.java,v
  retrieving revision 1.12.2.1
  retrieving revision 1.12.2.2
  diff -u -r1.12.2.1 -r1.12.2.2
  --- PageNumberCitationLayoutManager.java	9 May 2005 03:32:10 -0000	1.12.2.1
  +++ PageNumberCitationLayoutManager.java	9 May 2005 22:15:20 -0000	1.12.2.2
  @@ -58,7 +58,7 @@
       public void addAreas(PositionIterator posIter, LayoutContext context) {
           super.addAreas(posIter, context);
           if (!resolved) {
  -            parentLM.addUnresolvedArea(fobj.getRefId(), (Resolvable) curArea);
  +        	getPSLM().addUnresolvedArea(fobj.getRefId(), (Resolvable) curArea);
           }
       }
       
  @@ -71,7 +71,7 @@
        * return a resolvable area
        */
       private InlineArea getPageNumberCitationInlineArea(LayoutManager parentLM) {
  -        PageViewport page = parentLM.getFirstPVWithID(fobj.getRefId());
  +        PageViewport page = getPSLM().getFirstPVWithID(fobj.getRefId());
           InlineArea inline = null;
           if (page != null) {
               String str = page.getPageNumberString();
  
  
  
  1.7.2.3   +2 -2      xml-fop/src/java/org/apache/fop/layoutmgr/PageNumberLayoutManager.java
  
  Index: PageNumberLayoutManager.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/PageNumberLayoutManager.java,v
  retrieving revision 1.7.2.2
  retrieving revision 1.7.2.3
  diff -u -r1.7.2.2 -r1.7.2.3
  --- PageNumberLayoutManager.java	29 Apr 2005 00:06:21 -0000	1.7.2.2
  +++ PageNumberLayoutManager.java	9 May 2005 22:15:20 -0000	1.7.2.3
  @@ -46,7 +46,7 @@
       public InlineArea get(LayoutContext context) {
           // get page string from parent, build area
           TextArea inline = new TextArea();
  -        String str = parentLM.getCurrentPV().getPageNumberString();
  +        String str = getCurrentPV().getPageNumberString();
           int width = 0;
           for (int count = 0; count < str.length(); count++) {
               width += font.getCharWidth(str.charAt(count));
  
  
  

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