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 pb...@apache.org on 2004/06/03 15:28:47 UTC

cvs commit: xml-fop/src/java/org/apache/fop/fo/flow FoPageSequence.java

pbwest      2004/06/03 06:28:47

  Modified:    src/java/org/apache/fop/fo/flow Tag: FOP_0-20-0_Alt-Design
                        FoPageSequence.java
  Log:
  Added mapFlowName() and unmapFlowName()
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.1.2.18  +41 -7     xml-fop/src/java/org/apache/fop/fo/flow/Attic/FoPageSequence.java
  
  Index: FoPageSequence.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/Attic/FoPageSequence.java,v
  retrieving revision 1.1.2.17
  retrieving revision 1.1.2.18
  diff -u -r1.1.2.17 -r1.1.2.18
  --- FoPageSequence.java	23 May 2004 10:41:24 -0000	1.1.2.17
  +++ FoPageSequence.java	3 Jun 2004 13:28:47 -0000	1.1.2.18
  @@ -41,6 +41,7 @@
   import org.apache.fop.area.PageSetElement;
   import org.apache.fop.datastructs.TreeException;
   import org.apache.fop.fo.FONode;
  +import org.apache.fop.fo.FOPageSeqNode;
   import org.apache.fop.fo.FOTree;
   import org.apache.fop.fo.FObjectNames;
   import org.apache.fop.fo.PropNames;
  @@ -126,10 +127,6 @@
       public Map staticContents = null;
       /** Child index of fo:flow child. */
       private int flowChild = -1;
  -    /** The <code>PageList</code> for this page-sequence */
  -    private PageList pagelist = null;
  -    /** The index of the current element in the pagelist */
  -    private int pgListIndex = -1;
       /** The page currently being processed by this page-sequence */
       private Page page = null;
       /**
  @@ -140,6 +137,11 @@
           return page;
       }
   
  +    /** The <code>PageList</code> for this page-sequence */
  +    private PageList pagelist = null;
  +    /** The index of the current element in the pagelist */
  +    private int pgListIndex = -1;
  +
       /**
        * @return the pagelist
        */
  @@ -183,6 +185,38 @@
           return (Page)firstPage;
       }
   
  +    /** Maps flownames to fo:flow and fo:static-content objects */
  +    private HashMap flowMap = new HashMap(10);
  +    /**
  +     * Maps a flow name to a <code>FoFlow</code> or <code>FoStaticContent</code>
  +     * object.
  +     * @param flowname the name of the flow
  +     * @param flow the flow or static-content object
  +     * @throws FOPException if object that the name is being mapped to is
  +     * not a flow or static-content
  +     */
  +    public void mapFlowName(String flowname, FOPageSeqNode flow)
  +    throws FOPException {
  +        synchronized (flowMap) {
  +            if ( ! (flow.type == FObjectNames.FLOW
  +                    || flow.type == FObjectNames.STATIC_CONTENT)) {
  +                throw new FOPException(
  +                "Only fo:flow or fo:static-content allowed in flowmap");
  +            }
  +            flowMap.put(flowname, flow);
  +        }
  +    }
  +
  +
  +    /**
  +     * @param flowname
  +     * @return
  +     */
  +    public FOPageSeqNode unmapFlowName(String flowname) {
  +        synchronized (flowMap) {
  +            return (FOPageSeqNode)(flowMap.get(flowname));
  +        }
  +    }
       /** An image on which to draw areas */
       private BufferedImage pageSpread = null;
       /**
  
  
  

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