klease      01/11/11 06:15:10

  Modified:    src/org/apache/fop/fo FOText.java FObj.java
               src/org/apache/fop/fo/flow Block.java
               src/org/apache/fop/fo/pagination PageSequence.java
  Log:
  Integrate layout managers for text and block
  
  Revision  Changes    Path
  1.26      +6 -1      xml-fop/src/org/apache/fop/fo/FOText.java
  
  Index: FOText.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/FOText.java,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- FOText.java       2001/11/09 11:32:37     1.25
  +++ FOText.java       2001/11/11 14:15:09     1.26
  @@ -1,5 +1,5 @@
   /*
  - * $Id: FOText.java,v 1.25 2001/11/09 11:32:37 keiron Exp $
  + * $Id: FOText.java,v 1.26 2001/11/11 14:15:09 klease Exp $
    * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
    * For details on use and redistribution please refer to the
    * LICENSE file included with these sources."
  @@ -16,6 +16,8 @@
   import org.apache.fop.fo.properties.*;
   import org.apache.fop.apps.FOPException;
   import org.apache.fop.system.BufferManager;
  +import org.apache.fop.layoutmgr.LayoutManager;
  +import org.apache.fop.layoutmgr.TextLayoutManager;
   
   /**
    * a text node in the formatting object tree
  @@ -234,5 +236,8 @@
           return -1;
       }
   
  +    public LayoutManager getLayoutManager() {
  +     return new TextLayoutManager(this, ca);
  +    }
   }
   
  
  
  
  1.24      +4 -3      xml-fop/src/org/apache/fop/fo/FObj.java
  
  Index: FObj.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/FObj.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- FObj.java 2001/11/09 22:04:58     1.23
  +++ FObj.java 2001/11/11 14:15:09     1.24
  @@ -1,5 +1,5 @@
   /*
  - * $Id: FObj.java,v 1.23 2001/11/09 22:04:58 klease Exp $
  + * $Id: FObj.java,v 1.24 2001/11/11 14:15:09 klease Exp $
    * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
    * For details on use and redistribution please refer to the
    * LICENSE file included with these sources.
  @@ -25,6 +25,7 @@
   import org.xml.sax.Attributes;
   
   import java.util.Iterator;
  +import java.util.ListIterator;
   import java.util.Vector;
   import java.util.Hashtable;
   
  @@ -199,8 +200,8 @@
       }
   
       
  -    public Iterator getChildren() {
  -     return children.iterator();
  +    public ListIterator getChildren() {
  +     return children.listIterator();
       }
   
       public void setIsInTableCell() {
  
  
  
  1.45      +3 -4      xml-fop/src/org/apache/fop/fo/flow/Block.java
  
  Index: Block.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/Block.java,v
  retrieving revision 1.44
  retrieving revision 1.45
  diff -u -r1.44 -r1.45
  --- Block.java        2001/11/09 22:08:49     1.44
  +++ Block.java        2001/11/11 14:15:10     1.45
  @@ -1,5 +1,5 @@
   /*
  - * $Id: Block.java,v 1.44 2001/11/09 22:08:49 klease Exp $
  + * $Id: Block.java,v 1.45 2001/11/11 14:15:10 klease Exp $
    * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
    * For details on use and redistribution please refer to the
    * LICENSE file included with these sources.
  @@ -14,7 +14,7 @@
   import org.apache.fop.datatypes.*;
   import org.apache.fop.apps.FOPException;
   import org.apache.fop.layoutmgr.LayoutManager;
  -//import org.apache.fop.layoutmgr.BlockLayoutManager;
  +import org.apache.fop.layoutmgr.BlockLayoutManager;
   
   import org.xml.sax.Attributes;
   
  @@ -353,8 +353,7 @@
       }
   
       public LayoutManager getLayoutManager() {
  -     //return new BlockLayoutManager(this);
  -     return null;
  +     return new BlockLayoutManager(this);
       }
   
   }
  
  
  
  1.44      +27 -23    xml-fop/src/org/apache/fop/fo/pagination/PageSequence.java
  
  Index: PageSequence.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/pagination/PageSequence.java,v
  retrieving revision 1.43
  retrieving revision 1.44
  diff -u -r1.43 -r1.44
  --- PageSequence.java 2001/11/09 22:37:40     1.43
  +++ PageSequence.java 2001/11/11 14:15:10     1.44
  @@ -1,5 +1,5 @@
   /*
  - * $Id: PageSequence.java,v 1.43 2001/11/09 22:37:40 klease Exp $
  + * $Id: PageSequence.java,v 1.44 2001/11/11 14:15:10 klease Exp $
    * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
    * For details on use and redistribution please refer to the
    * LICENSE file included with these sources.
  @@ -242,6 +242,7 @@
                else {
                    this.mainFlow = (Flow)child;
                    addFlow(mainFlow);
  +                 super.addChild(child); // For getChildren
                }
            } 
            else if (childName.equals("fo:static-content")) {
  @@ -267,7 +268,10 @@
   
       public void end() {
        try {
  -         format(null);
  +         AreaTree at = new AreaTree();
  +         at.setTreeModel(AreaTree.createStorePagesModel());
  +         at.startPageSequence(null);
  +         format(at);
        } catch (FOPException fopex) {
            log.error("Error in PageSequence.end(): " +
                      fopex.getMessage());
  @@ -277,27 +281,27 @@
   
   
   
  -    /**
  -     * Return children for layout. Only the main flow is laid out directly.
  -     */
  -    public Iterator getChildren() {
  -     return new Iterator() {
  -             boolean bFirst=true;
  -             public boolean hasNext() {
  -                 return (bFirst==true && mainFlow != null);
  -             }
  -             public Object next() {
  -                 if (bFirst==true && mainFlow != null) {
  -                     bFirst=false;
  -                     return mainFlow;
  -                 }
  -                 else throw new NoSuchElementException();
  -             }
  -             public void remove() {
  -                 throw new UnsupportedOperationException();
  -             }
  -         };
  -    }
  +//     /**
  +//      * Return children for layout. Only the main flow is laid out directly.
  +//      */
  +//     public ListIterator getChildren() {
  +//   return new ListIterator() {
  +//           boolean bFirst=true;
  +//           public boolean hasNext() {
  +//               return (bFirst==true && mainFlow != null);
  +//           }
  +//           public Object next() {
  +//               if (bFirst==true && mainFlow != null) {
  +//                   bFirst=false;
  +//                   return mainFlow;
  +//               }
  +//               else throw new NoSuchElementException();
  +//           }
  +//           public void remove() {
  +//               throw new UnsupportedOperationException();
  +//           }
  +//       };
  +//     }
   
       /**
        * Runs the formatting of this page sequence into the given area tree
  
  
  

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

Reply via email to