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

2004-10-12 Thread gmazza
gmazza  2004/10/12 17:31:46

  Modified:src/java/org/apache/fop/fo FOText.java FObj.java
FObjMixed.java
   src/java/org/apache/fop/layoutmgr AbstractLayoutManager.java
  Log:
  Some simplifications allowed as a result of having FOText extend FONode directly.
  
  Revision  ChangesPath
  1.29  +1 -9  xml-fop/src/java/org/apache/fop/fo/FOText.java
  
  Index: FOText.java
  ===
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/FOText.java,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- FOText.java   13 Oct 2004 00:09:54 -  1.28
  +++ FOText.java   13 Oct 2004 00:31:46 -  1.29
  @@ -28,7 +28,7 @@
   import org.apache.fop.layoutmgr.TextLayoutManager;
   
   /**
  - * A text node in the formatting object tree.
  + * A text node (PCDATA) in the formatting object tree.
*
* Unfortunately the BufferManager implementatation holds
* onto references to the character data in this object
  @@ -486,14 +486,6 @@
   }
   }
   
  -}
  -
  -/**
  - * @todo rename somehow, there isn't an fo:text.
  - * @todo see if should still be a subclass of FObj
  - */
  -public String getName() {
  -return "fo:text";
   }
   
   /**
  
  
  
  1.78  +9 -26 xml-fop/src/java/org/apache/fop/fo/FObj.java
  
  Index: FObj.java
  ===
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/FObj.java,v
  retrieving revision 1.77
  retrieving revision 1.78
  diff -u -r1.77 -r1.78
  --- FObj.java 12 Oct 2004 05:07:46 -  1.77
  +++ FObj.java 13 Oct 2004 00:31:46 -  1.78
  @@ -54,9 +54,6 @@
   */
   private boolean isOutOfLineFODescendant = false;
   
  -/** Id of this fo element or null if no id. */
  -protected String id = null;
  -
   /** Markers added to this element. */
   protected Map markers = null;
   
  @@ -135,19 +132,15 @@
* fo and sets the id attribute of this object.
*/
   private void setupID() throws SAXParseException {
  -Property prop = this.propertyList.get(PR_ID);
  -if (prop != null) {
  -String str = prop.getString();
  -if (str != null && !str.equals("")) {
  -Set idrefs = getFOEventHandler().getIDReferences();
  -if (!idrefs.contains(str)) {
  -id = str;
  -idrefs.add(id);
  -} else {
  -throw new SAXParseException("Property id \"" + str + 
  -"\" previously used; id values must be unique" +
  -" in document.", locator);
  -}
  +String str = getPropString(PR_ID);
  +if (str != null && !str.equals("")) {
  +Set idrefs = getFOEventHandler().getIDReferences();
  +if (!idrefs.contains(str)) {
  +idrefs.add(str);
  +} else {
  +throw new SAXParseException("Property id \"" + str + 
  +"\" previously used; id values must be unique" +
  +" in document.", locator);
   }
   }
   }
  @@ -347,16 +340,6 @@
   return ((FObj) parent).getLayoutDimension(key);
   }
   return new Integer(0);
  -}
  -
  -/**
  - * Get the id string for this formatting object.
  - * This will be unique for the fo document.
  - *
  - * @return the id string or null if not set
  - */
  -public String getID() {
  -return id;
   }
   
   /**
  
  
  
  1.41  +1 -2  xml-fop/src/java/org/apache/fop/fo/FObjMixed.java
  
  Index: FObjMixed.java
  ===
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/FObjMixed.java,v
  retrieving revision 1.40
  retrieving revision 1.41
  diff -u -r1.40 -r1.41
  --- FObjMixed.java12 Oct 2004 05:07:46 -  1.40
  +++ FObjMixed.java13 Oct 2004 00:31:46 -  1.41
  @@ -25,8 +25,7 @@
   
   /**
* Base class for representation of mixed content formatting objects
  - * and their processing
  - * @todo define what a "mixed content formatting object" is
  + * (i.e., those that can contain both child FO's and text nodes/PCDATA)
*/
   public class FObjMixed extends FObj {
   /** TextInfo for this object */
  
  
  
  1.26  +1 -1  
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.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- AbstractLayoutManager.java12 O

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

2004-10-19 Thread bckfnn
bckfnn  2004/10/19 14:41:46

  Modified:src/java/org/apache/fop/layoutmgr AbstractLayoutManager.java
  Log:
  Third phase of performance improvement.
  PR: 31699
  
  Revision  ChangesPath
  1.27  +10 -2 
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.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- AbstractLayoutManager.java13 Oct 2004 00:31:46 -  1.26
  +++ AbstractLayoutManager.java19 Oct 2004 21:41:46 -  1.27
  @@ -20,7 +20,6 @@
   
   import org.apache.fop.fo.FObj;
   import org.apache.fop.fo.FONode;
  -import org.apache.fop.apps.FOUserAgent;
   import org.apache.fop.area.Area;
   import org.apache.fop.area.Resolveable;
   import org.apache.fop.area.PageViewport;
  @@ -40,7 +39,6 @@
* The base class for all LayoutManagers.
*/
   public abstract class AbstractLayoutManager implements LayoutManager, Constants {
  -protected FOUserAgent userAgent;
   protected LayoutManager parentLM = null;
   protected List childLMs = new ArrayList(10);
   protected FObj fobj;
  @@ -351,6 +349,16 @@
* If the id string is not null then add the id to the current page.
*/
   protected void addID() {
  +if (foID != null) {
  +addIDToPage(foID);
  +}
  +}
  +
  +/**
  + * 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) {
   addIDToPage(foID);
   }
  
  
  

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



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

2004-12-21 Thread spepping
spepping2004/12/21 03:28:06

  Modified:src/java/org/apache/fop/fo FONode.java FObj.java
   src/java/org/apache/fop/fo/flow Marker.java
RetrieveMarker.java
   src/java/org/apache/fop/layoutmgr AbstractLayoutManager.java
  Log:
  Implemented cloning and reparenting of the subtree under a marker to
  the retrieving retrieve-marker. The FO nodes are cloned. The new
  subtree is attached to the RetrieveMarker object. The property
  lists are not cloned. The subtree of property lists is attached to the
  property list of the RetrieveMarker object. This is only needed for
  the binding of the FO nodes. After that a subsequent retrieve-marker
  may reparent the property lists.
  
  Removed Marker's reference to its property list. In Marker.endOfNode()
  the parent of the property lists of the direct children of marker is
  reset to null. FOText nodes are not mapped to the Marker's property
  list in Marker. This allows the Marker's property list and its
  ancestors to be GC'ed.
  
  FOText nodes use the parent FO node's property list or the
  RetrieveMarker's property list for binding.
  
  TODO: Block.handleWhiteSpace is not applied to text in retrieve-marker.
  TODO: White space treatment around retrieve-marker is incorrect.
  
  Revision  ChangesPath
  1.50  +29 -1 xml-fop/src/java/org/apache/fop/fo/FONode.java
  
  Index: FONode.java
  ===
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/FONode.java,v
  retrieving revision 1.49
  retrieving revision 1.50
  diff -u -r1.49 -r1.50
  --- FONode.java   28 Oct 2004 10:00:19 -  1.49
  +++ FONode.java   21 Dec 2004 11:28:05 -  1.50
  @@ -37,7 +37,7 @@
   /**
* base class for nodes in the XML tree
*/
  -public abstract class FONode {
  +public abstract class FONode implements Cloneable {
   
   protected static String FO_URI = FOElementMapping.URI;
   
  @@ -60,6 +60,34 @@
*/
   protected FONode(FONode parent) {
   this.parent = parent;
  +}
  +
  +/**
  + * Perform a shallow cloning operation,
  + * set its parent, and optionally clean the list of child nodes
  + * @param parent the intended parent of the clone
  + * @param removeChildren if true, clean the list of child nodes
  + * @return the cloned FO node
  + */
  +public FONode clone(FONode parent, boolean removeChildren)
  +throws FOPException {
  +FONode foNode = (FONode) clone();
  +foNode.parent = parent;
  +parent.addChildNode(foNode);
  +return foNode;
  +}
  +
  +/**
  + * Perform a shallow cloning operation
  + * 
  + * @see java.lang.Object#clone()
  + * @return the cloned object
  + */
  +protected Object clone() {
  +try {
  +return super.clone();
  +} catch (CloneNotSupportedException e) { }
  +return null;
   }
   
   /**
  
  
  
  1.87  +12 -0 xml-fop/src/java/org/apache/fop/fo/FObj.java
  
  Index: FObj.java
  ===
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/FObj.java,v
  retrieving revision 1.86
  retrieving revision 1.87
  diff -u -r1.86 -r1.87
  --- FObj.java 28 Oct 2004 10:00:19 -  1.86
  +++ FObj.java 21 Dec 2004 11:28:05 -  1.87
  @@ -86,6 +86,18 @@
   }
   
   /**
  + * @see org.apache.fop.fo.FONode#clone(FONode, boolean)
  + */
  +public FONode clone(FONode parent, boolean removeChildren)
  +throws FOPException {
  +FObj fobj = (FObj) super.clone(parent, removeChildren);
  +if (removeChildren) {
  +fobj.childNodes = null;
  +}
  +return fobj;
  +}
  +
  +/**
* @see org.apache.fop.fo.FONode#processNode
*/
   public void processNode(String elementName, Locator locator, 
  
  
  
  1.22  +21 -36xml-fop/src/java/org/apache/fop/fo/flow/Marker.java
  
  Index: Marker.java
  ===
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/Marker.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- Marker.java   7 Dec 2004 20:11:21 -   1.21
  +++ Marker.java   21 Dec 2004 11:28:05 -  1.22
  @@ -45,9 +45,8 @@
   private String markerClassName;
   // End of property values
   
  -private MarkerPropertyList propertyList;
   private PropertyListMaker savePropertyListMaker;
  -private HashMap children = new HashMap();
  +private HashMap descPLists = new HashMap();
   
   /**
* Create a marker fo.
  @@ -65,27 +64,16 @@
   }
   
   /**
  - * Rebind the marker and all the children using the specified 
  - * parentPropertyList which comes from the fo:retrieve-marker element.
  -  

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

2005-02-08 Thread jeremias
jeremias2005/02/08 01:17:50

  Modified:src/java/org/apache/fop/layoutmgr AbstractLayoutManager.java
  Log:
  moving retrieve-marker replacement into separate method to make preLoadList 
easier to read and understand.
  
  Revision  ChangesPath
  1.37  +27 -12
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.36
  retrieving revision 1.37
  diff -u -r1.36 -r1.37
  --- AbstractLayoutManager.java7 Feb 2005 11:01:36 -   1.36
  +++ AbstractLayoutManager.java8 Feb 2005 09:17:50 -   1.37
  @@ -394,6 +394,29 @@
   }
   
   /**
  + * 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
  + * FO node. null if the the replacement results in no nodes to be 
  + * processed.
  + */
  +private FONode handleRetrieveMarker(FONode foNode) {
  +if (foNode instanceof RetrieveMarker) {
  +RetrieveMarker rm = (RetrieveMarker) foNode;
  +Marker marker = retrieveMarker(rm.getRetrieveClassName(),
  +   rm.getRetrievePosition(),
  +   rm.getRetrieveBoundary());
  +if (marker == null) {
  +return null;
  +}
  +rm.bindMarker(marker);
  +return rm;
  +} else {
  +return foNode;
  +}
  +}
  +
  +/**
* Convenience method: preload a number of child LMs
* @param size the requested number of child LMs
* @return the list with the preloaded child LMs
  @@ -407,19 +430,11 @@
   Object theobj = fobjIter.next();
   if (theobj instanceof FONode) {
   FONode foNode = (FONode) theobj;
  -if (foNode instanceof RetrieveMarker) {
  -RetrieveMarker rm = (RetrieveMarker) foNode;
  -Marker marker = retrieveMarker(rm.getRetrieveClassName(),
  -   rm.getRetrievePosition(),
  -   rm.getRetrieveBoundary());
  -if (marker == null) {
  -continue;
  -}
  -rm.bindMarker(marker);
  -foNode = rm;
  +foNode = handleRetrieveMarker(foNode);
  +if (foNode != null) {
  +getAreaTreeHandler().getLayoutManagerMaker().
  +makeLayoutManagers(foNode, newLMs);
   }
  -getAreaTreeHandler().getLayoutManagerMaker().
  -makeLayoutManagers(foNode, newLMs);
   }
   }
   return newLMs;
  
  
  

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



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

2005-02-10 Thread jeremias
jeremias2005/02/10 06:18:39

  Modified:src/java/org/apache/fop/layoutmgr AbstractLayoutManager.java
  Log:
  Some LMs don't need the childLM List. So create only when necessary.
  
  Revision  ChangesPath
  1.38  +7 -1  
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.37
  retrieving revision 1.38
  diff -u -r1.37 -r1.38
  --- AbstractLayoutManager.java8 Feb 2005 09:17:50 -   1.37
  +++ AbstractLayoutManager.java10 Feb 2005 14:18:39 -  1.38
  @@ -41,7 +41,7 @@
*/
   public abstract class AbstractLayoutManager implements LayoutManager, 
Constants {
   protected LayoutManager parentLM = null;
  -protected List childLMs = new ArrayList(10);
  +protected List childLMs = null;
   protected ListIterator fobjIter = null;
   protected Map markers = null;
   
  @@ -453,6 +453,9 @@
* @see org.apache.fop.layoutmgr.LayoutManager#getChildLMs
*/
   public List getChildLMs() {
  +if (childLMs == null) {
  +childLMs = new java.util.ArrayList(10);
  +}
   return childLMs;
   }
   
  @@ -465,6 +468,9 @@
   }
   lm.setParent(this);
   lm.initialize();
  +if (childLMs == null) {
  +childLMs = new java.util.ArrayList(10);
  +}
   childLMs.add(lm);
   log.trace(this.getClass().getName()
 + ": Adding child LM " + lm.getClass().getName());
  
  
  

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



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

2004-10-02 Thread gmazza
gmazza  2004/10/02 05:39:10

  Modified:src/java/org/apache/fop/layoutmgr AbstractLayoutManager.java
ContentLayoutManager.java LayoutManager.java
PageSequenceLayoutManager.java
  Log:
  Removed no-longer-used getAreaTreeHandler() from LM's.
  
  Revision  ChangesPath
  1.24  +0 -6  
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.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- AbstractLayoutManager.java2 Oct 2004 04:34:13 -   1.23
  +++ AbstractLayoutManager.java2 Oct 2004 12:39:10 -   1.24
  @@ -21,7 +21,6 @@
   import org.apache.fop.fo.FObj;
   import org.apache.fop.apps.FOUserAgent;
   import org.apache.fop.area.Area;
  -import org.apache.fop.area.AreaTreeHandler;
   import org.apache.fop.area.Resolveable;
   import org.apache.fop.area.PageViewport;
   import org.apache.fop.fo.Constants;
  @@ -118,10 +117,6 @@
   return this.parentLM;
   }
   
  -public AreaTreeHandler getAreaTreeHandler() {
  -return getParent().getAreaTreeHandler();
  -}
  -
   // /**
   //  * Ask the parent LayoutManager to add the current (full) area to the
   //  * appropriate parent area.
  @@ -415,7 +410,6 @@
   if (fobjIter == null) {
   return null;
   }
  -AreaTreeHandler areaTreeHandler = getAreaTreeHandler();
   List newLMs = new ArrayList(size);
   while (fobjIter.hasNext() && newLMs.size() < size ) {
   Object theobj = fobjIter.next();
  
  
  
  1.14  +0 -5  
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.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- ContentLayoutManager.java 5 Sep 2004 18:16:32 -   1.13
  +++ ContentLayoutManager.java 2 Oct 2004 12:39:10 -   1.14
  @@ -22,7 +22,6 @@
   import org.apache.fop.apps.FOUserAgent;
   import org.apache.fop.fo.flow.Marker;
   import org.apache.fop.area.Area;
  -import org.apache.fop.area.AreaTreeHandler;
   import org.apache.fop.area.Resolveable;
   import org.apache.fop.area.PageViewport;
   
  @@ -180,10 +179,6 @@
   
   public LayoutManager getParent() {
   return this.parentLM;
  -}
  -
  -public AreaTreeHandler getAreaTreeHandler() {
  -return getParent().getAreaTreeHandler();
   }
   
   /** @see org.apache.fop.layoutmgr.LayoutManager */
  
  
  
  1.13  +0 -7  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.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- LayoutManager.java7 Sep 2004 20:47:11 -   1.12
  +++ LayoutManager.java2 Oct 2004 12:39:10 -   1.13
  @@ -28,7 +28,6 @@
   import org.apache.fop.area.Resolveable;
   import org.apache.fop.area.PageViewport;
   import org.apache.fop.fo.FObj;
  -import org.apache.fop.area.AreaTreeHandler;
   
   /**
* The interface for all LayoutManagers.
  @@ -57,12 +56,6 @@
* @return the parent layout manager.
*/
   LayoutManager getParent();
  -
  -/**
  - * Get the AreaTreeHandler object that is activating the LM Tree
  - * @return the AreaTreeHandler object
  - */
  -AreaTreeHandler getAreaTreeHandler();
   
   /**
* Initialize this layout manager.
  
  
  
  1.4   +1 -8  
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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- PageSequenceLayoutManager.java27 Sep 2004 10:18:11 -  1.3
  +++ PageSequenceLayoutManager.java2 Oct 2004 12:39:10 -   1.4
  @@ -918,11 +918,4 @@
   staticContentLMs.put(sc.getPropString(PR_FLOW_NAME), lm);
   return lm;
   }
  -
  -/**
  - * @return the apps.FOTreeHandler object controlling this generation
  - */
  -public AreaTreeHandler getAreaTreeHandler() {
  -return areaTreeHandler;
  -}
   }
  
  
  

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

cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr AbstractLayoutManager.java PageSequenceLayoutManager.java BlockLayoutManager.java RetrieveMarkerLayoutManager.java

2004-12-07 Thread spepping
spepping2004/12/07 12:11:22

  Modified:src/java/org/apache/fop/fo/flow Marker.java
RetrieveMarker.java
   src/java/org/apache/fop/layoutmgr AbstractLayoutManager.java
PageSequenceLayoutManager.java
BlockLayoutManager.java
  Removed: src/java/org/apache/fop/layoutmgr
RetrieveMarkerLayoutManager.java
  Log:
  Removed RetrieveMarkerLM. The LMs of the marker children are attached
  in the LM tree as the direct children of the LM of the parent of the
  RetrieveMarker. This patch solves bug 32253.
  
  Revision  ChangesPath
  1.21  +19 -1 xml-fop/src/java/org/apache/fop/fo/flow/Marker.java
  
  Index: Marker.java
  ===
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/Marker.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- Marker.java   30 Nov 2004 20:20:59 -  1.20
  +++ Marker.java   7 Dec 2004 20:11:21 -   1.21
  @@ -20,6 +20,9 @@
   
   import java.util.HashMap;
   import java.util.Iterator;
  +import java.util.List;
  +import java.util.ListIterator;
  +
   
   import org.xml.sax.Locator;
   
  @@ -70,7 +73,7 @@
   // Set a new parent property list and bind all the children again.
   propertyList.setParentPropertyList(parentPropertyList);
   for (Iterator i = children.keySet().iterator(); i.hasNext(); ) {
  -Object child = i.next();
  +FONode child = (FONode) i.next();
   PropertyList childList = (PropertyList) children.get(child);
   if (child instanceof FObj) {
   ((FObj) child).bind(childList);
  @@ -123,6 +126,21 @@
   throws ValidationException {
   if (!isBlockOrInlineItem(nsURI, localName)) {
   invalidChildError(loc, nsURI, localName);
  +}
  +}
  +
  +/**
  + * @see org.apache.fop.fo.FONode#addLayoutManager(List)
  + * @todo remove null check when vCN() & endOfNode() implemented
  + */
  +public void addLayoutManager(List list) {
  +ListIterator baseIter = getChildNodes();
  +if (baseIter == null) {
  +return;
  +}
  +while (baseIter.hasNext()) {
  +FONode child = (FONode) baseIter.next();
  +child.addLayoutManager(list);
   }
   }
   
  
  
  
  1.24  +11 -8 
xml-fop/src/java/org/apache/fop/fo/flow/RetrieveMarker.java
  
  Index: RetrieveMarker.java
  ===
  RCS file: 
/home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/RetrieveMarker.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- RetrieveMarker.java   28 Oct 2004 10:00:21 -  1.23
  +++ RetrieveMarker.java   7 Dec 2004 20:11:21 -   1.24
  @@ -23,6 +23,8 @@
   
   import org.xml.sax.Locator;
   
  +import org.apache.commons.logging.Log;
  +
   import org.apache.fop.apps.FOPException;
   import org.apache.fop.fo.FOEventHandler;
   import org.apache.fop.fo.FONode;
  @@ -30,7 +32,7 @@
   import org.apache.fop.fo.PropertyList;
   import org.apache.fop.fo.StaticPropertyList;
   import org.apache.fop.fo.ValidationException;
  -import org.apache.fop.layoutmgr.RetrieveMarkerLayoutManager;
  +import org.apache.fop.layoutmgr.LayoutManager;
   
   
   /**
  @@ -108,13 +110,14 @@
   return retrieveBoundary;
   }
   
  -
  -/**
  - * @see org.apache.fop.fo.FONode#addLayoutManager(List)
  - */
  -public void addLayoutManager(List list) {
  -RetrieveMarkerLayoutManager lm = new 
RetrieveMarkerLayoutManager(this);
  -list.add(lm);
  +public void bindMarker(Marker marker) {
  +// assert(marker != null);
  +try {
  +marker.rebind(getPropertyList());
  +} catch (FOPException exc) {
  +Log log = getLogger();
  +log.error("fo:retrieve-marker unable to rebind property values", 
exc);
  +}
   }
   
   /**
  
  
  
  1.32  +12 -0 
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.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- AbstractLayoutManager.java13 Nov 2004 20:37:17 -  1.31
  +++ AbstractLayoutManager.java7 Dec 2004 20:11:21 -   1.32
  @@ -24,6 +24,7 @@
   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;
   import org.apache.fop.fo.flow.Marker;
   
   import org.apache.commons.logging.Log;
  @@ -373,6 +374

cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr AbstractLayoutManager.java ContentLayoutManager.java LMiter.java LayoutManager.java PageLayoutManager.java

2004-06-12 Thread gmazza
gmazza  2004/06/12 18:11:49

  Modified:src/java/org/apache/fop/apps Document.java
   src/java/org/apache/fop/fo FOTreeHandler.java
   src/java/org/apache/fop/layoutmgr AbstractLayoutManager.java
ContentLayoutManager.java LMiter.java
LayoutManager.java PageLayoutManager.java
  Log:
  Moved AddLMVisitor accessors into FOTreeHandler.
  
  Revision  ChangesPath
  1.17  +1 -28 xml-fop/src/java/org/apache/fop/apps/Document.java
  
  Index: Document.java
  ===
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/apps/Document.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- Document.java 11 Jun 2004 17:18:51 -  1.16
  +++ Document.java 13 Jun 2004 01:11:49 -  1.17
  @@ -32,8 +32,6 @@
   import org.apache.fop.fo.FOTreeControl;
   import org.apache.fop.fo.extensions.Bookmarks;
   import org.apache.fop.fonts.FontInfo;
  -import org.apache.fop.layoutmgr.AddLMVisitor;
  -
   
   import org.apache.commons.logging.Log;
   
  @@ -60,10 +58,6 @@
   
   private Bookmarks bookmarks = null;
   
  -/** Useful only for allowing subclasses of AddLMVisitor to be set by those
  - extending FOP **/
  - private AddLMVisitor addLMVisitor = null;
  -
   /**
* The current set of id's in the FO tree.
* This is used so we know if the FO tree contains duplicates.
  @@ -142,25 +136,4 @@
   return foInputHandler;
   }
   
  -/**
  - * Public accessor to set the AddLMVisitor object that should be used.
  - * This allows subclasses of AddLMVisitor to be used, which can be useful
  - * for extensions to the FO Tree.
  - * @param addLMVisitor the AddLMVisitor object that should be used.
  - */
  -public void setAddLMVisitor(AddLMVisitor addLMVisitor) {
  -this.addLMVisitor = addLMVisitor;
  -}
  -
  -/**
  - * Public accessor to get the AddLMVisitor object that should be used.
  - * @return the AddLMVisitor object that should be used.
  - */
  -public AddLMVisitor getAddLMVisitor() {
  -if (this.addLMVisitor == null) {
  -this.addLMVisitor = new AddLMVisitor();
  -}
  -return this.addLMVisitor;
  -}
  -
   }
  
  
  
  1.17  +28 -2 xml-fop/src/java/org/apache/fop/fo/FOTreeHandler.java
  
  Index: FOTreeHandler.java
  ===
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/FOTreeHandler.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- FOTreeHandler.java11 Jun 2004 17:18:51 -  1.16
  +++ FOTreeHandler.java13 Jun 2004 01:11:49 -  1.17
  @@ -50,6 +50,7 @@
   import org.apache.fop.fo.flow.TableRow;
   import org.apache.fop.fo.pagination.Flow;
   import org.apache.fop.fo.pagination.PageSequence;
  +import org.apache.fop.layoutmgr.AddLMVisitor;
   import org.apache.fop.layoutmgr.ContentLayoutManager;
   import org.apache.fop.layoutmgr.InlineStackingLayoutManager;
   import org.apache.fop.layoutmgr.LMiter;
  @@ -90,6 +91,10 @@
*/
   private long startTime;
   
  +/** Useful only for allowing subclasses of AddLMVisitor to be set by those
  + extending FOP **/
  +private AddLMVisitor addLMVisitor = null;
  +
   /**
* Main constructor
* @param foTreeControl the FOTreeControl implementation that governs this
  @@ -504,7 +509,7 @@
   
   // This will layout pages and add them to the area tree
   PageLayoutManager pageLM = new PageLayoutManager(areaTree, pageSeq, 
  -getDocument());
  +this);
   pageLM.setPageCounting(pageSeq.getCurrentPageNumber(),
  pageSeq.getPageNumberGenerator());
   
  @@ -550,6 +555,27 @@
   clm.fillArea(lm);
   
   return title;
  +}
  +
  +/**
  + * Public accessor to set the AddLMVisitor object that should be used.
  + * This allows subclasses of AddLMVisitor to be used, which can be useful
  + * for extensions to the FO Tree.
  + * @param addLMVisitor the AddLMVisitor object that should be used.
  + */
  +public void setAddLMVisitor(AddLMVisitor addLMVisitor) {
  +this.addLMVisitor = addLMVisitor;
  +}
  +
  +/**
  + * Public accessor to get the AddLMVisitor object that should be used.
  + * @return the AddLMVisitor object that should be used.
  + */
  +public AddLMVisitor getAddLMVisitor() {
  +if (this.addLMVisitor == null) {
  +this.addLMVisitor = new AddLMVisitor();
  +}
  +return this.addLMVisitor;
   }
   
   /**
  
  
  
  1.16  +4 -4  
xml-fop/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java
  
  Index: AbstractLayoutManager.java
  ==

cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr AbstractLayoutManager.java ContentLayoutManager.java LMiter.java LayoutManager.java PageLayoutManager.java

2004-07-12 Thread gmazza
gmazza  2004/07/12 17:16:22

  Modified:src/java/org/apache/fop/apps Driver.java
   src/java/org/apache/fop/area/extensions BookmarkData.java
   src/java/org/apache/fop/fo FOInputHandler.java
   src/java/org/apache/fop/layoutmgr AbstractLayoutManager.java
ContentLayoutManager.java LMiter.java
LayoutManager.java PageLayoutManager.java
  Added:   src/java/org/apache/fop/area AreaTreeHandler.java
  Removed: src/java/org/apache/fop/area AreaTree.java
   src/java/org/apache/fop/fo FOTreeHandler.java
  Log:
  1.) Combined the AreaTree and FOTreeHandler into a new AreaTreeHandler
  object.  FOTreeHandler was primarily acting as an AreaTreeHandler,
  and AreaTree had a 1-to-1 relationship with it.  Comments most welcome.
  
  2.) Created convenience methods in FOInputHandler for those subclasses
  which do not handle certain signals/events called from the formatting
  objects (i.e., AreaTreeHandler).
  
  Revision  ChangesPath
  1.82  +3 -3  xml-fop/src/java/org/apache/fop/apps/Driver.java
  
  Index: Driver.java
  ===
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/apps/Driver.java,v
  retrieving revision 1.81
  retrieving revision 1.82
  diff -u -r1.81 -r1.82
  --- Driver.java   9 Jul 2004 01:48:58 -   1.81
  +++ Driver.java   13 Jul 2004 00:16:22 -  1.82
  @@ -34,7 +34,7 @@
   import org.apache.fop.fo.ElementMapping;
   import org.apache.fop.fo.FOTreeBuilder;
   import org.apache.fop.fo.FOInputHandler;
  -import org.apache.fop.fo.FOTreeHandler;
  +import org.apache.fop.area.AreaTreeHandler;
   import org.apache.fop.render.awt.AWTRenderer;
   import org.apache.fop.render.mif.MIFHandler;
   import org.apache.fop.render.rtf.RTFHandler;
  @@ -314,7 +314,7 @@
   "Renderer must be set using setRenderer(int renderType)");
   }
   
  -foInputHandler = new FOTreeHandler(foUserAgent, rendererType, 
  +foInputHandler = new AreaTreeHandler(foUserAgent, rendererType, 
   stream);
   }
   
  
  
  
  1.1  xml-fop/src/java/org/apache/fop/area/AreaTreeHandler.java
  
  Index: AreaTreeHandler.java
  ===
  /*
   * Copyright 1999-2004 The Apache Software Foundation.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   * 
   *  http://www.apache.org/licenses/LICENSE-2.0
   * 
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  
  /* $Id: AreaTreeHandler.java,v 1.1 2004/07/13 00:16:22 gmazza Exp $ */
  package org.apache.fop.area;
  
  // Java
  import java.io.OutputStream;
  import java.util.ArrayList;
  import java.util.List;
  import java.util.Map;
  import java.util.HashMap;
  import java.util.Set;
  import java.util.HashSet;
  import java.util.Iterator;
  
  // XML
  import org.xml.sax.SAXException;
  
  // Apache
  import org.apache.fop.apps.FOPException;
  import org.apache.fop.apps.FOUserAgent;
  import org.apache.fop.area.extensions.BookmarkData;
  import org.apache.fop.fo.FOInputHandler;
  import org.apache.fop.fo.extensions.Outline;
  import org.apache.fop.fo.extensions.Bookmarks;
  import org.apache.fop.fo.pagination.PageSequence;
  import org.apache.fop.fonts.FontInfo;
  import org.apache.fop.layoutmgr.AddLMVisitor;
  import org.apache.fop.layoutmgr.ContentLayoutManager;
  import org.apache.fop.layoutmgr.InlineStackingLayoutManager;
  import org.apache.fop.layoutmgr.LMiter;
  import org.apache.fop.layoutmgr.PageLayoutManager;
  import org.apache.commons.logging.Log;
  import org.apache.commons.logging.LogFactory;
  
  // Java
  import java.io.OutputStream;
  import java.util.HashSet;
  import java.util.Iterator;
  
  /**
   * Area tree handler for formatting objects.
   *
   * Concepts:
   * The area tree is to be as small as possible. With minimal classes
   * and data to fully represent an area tree for formatting objects.
   * The area tree needs to be simple to render and follow the spec
   * closely.
   * This area tree has the concept of page sequences.
   * Where ever possible information is discarded or optimized to
   * keep memory use low. The data is also organized to make it
   * possible for renderers to minimize their output.
   * A page can be saved if not fully resolved and once rendered
   * a page contains only size and id reference information.
   * The area tree pages are organized in a model that depe

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

2005-02-16 Thread gmazza
gmazza  2005/02/16 16:27:54

  Modified:src/java/org/apache/fop/area AreaTreeHandler.java
   src/java/org/apache/fop/fo/pagination PageSequence.java
Root.java
   src/java/org/apache/fop/layoutmgr AbstractLayoutManager.java
ContentLayoutManager.java LayoutManager.java
PageNumberLayoutManager.java
PageSequenceLayoutManager.java
  Log:
  Cleanup of page number handling throughout application.  Removed old code
  from PageSequence.java.
  
  Revision  ChangesPath
  1.34  +2 -2  xml-fop/src/java/org/apache/fop/area/AreaTreeHandler.java
  
  Index: AreaTreeHandler.java
  ===
  RCS file: 
/home/cvs/xml-fop/src/java/org/apache/fop/area/AreaTreeHandler.java,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- AreaTreeHandler.java  6 Feb 2005 08:14:07 -   1.33
  +++ AreaTreeHandler.java  17 Feb 2005 00:27:53 -  1.34
  @@ -264,7 +264,7 @@
   long memoryNow = runtime.totalMemory() - runtime.freeMemory();
   long memoryUsed = (memoryNow - initialMemory) / 1024L;
   long timeUsed = System.currentTimeMillis() - startTime;
  -int pageCount = rootFObj.getRunningPageNumberCounter();
  +int pageCount = rootFObj.getTotalPagesGenerated();
   log.debug("Initial heap size: " + (initialMemory / 1024L) + 
"Kb");
   log.debug("Current heap size: " + (memoryNow / 1024L) + "Kb");
   log.debug("Total memory used: " + memoryUsed + "Kb");
  
  
  
  1.56  +29 -245   
xml-fop/src/java/org/apache/fop/fo/pagination/PageSequence.java
  
  Index: PageSequence.java
  ===
  RCS file: 
/home/cvs/xml-fop/src/java/org/apache/fop/fo/pagination/PageSequence.java,v
  retrieving revision 1.55
  retrieving revision 1.56
  diff -u -r1.55 -r1.56
  --- PageSequence.java 12 Feb 2005 22:32:36 -  1.55
  +++ PageSequence.java 17 Feb 2005 00:27:54 -  1.56
  @@ -49,11 +49,6 @@
   private String masterReference;
   // End of property values
   
  -//
  -// initial-page-number types
  -//
  -public static final int EXPLICIT = 0;
  -
   /**
* The parent root object
*/
  @@ -76,33 +71,13 @@
   
   //  private boolean isFlowSet = false;
   
  -// for structure handler
  -private boolean sequenceStarted = false;
  -
  -//
  -// state attributes used during layout
  -//
  -
   // page number and related formatting variables
  -public int currentPageNumber = 0;
  +public int startingPageNumber = 0;
   private int explicitFirstNumber = 0; // explicitly specified
  -public int firstPageNumber = 0; // actual
   private PageNumberGenerator pageNumberGenerator;
  -
  -private int pageCount = 0;
   private boolean isForcing = false;
   
   /**
  - * specifies page numbering type (auto|auto-even|auto-odd|explicit)
  - */
  -public int pageNumberType;
  -
  -/**
  - * used to determine whether to calculate auto, auto-even, auto-odd
  - */
  -private boolean thisIsFirstPage;
  -
  -/**
* The currentSimplePageMaster is either the page master for the
* whole page sequence if master-reference refers to a 
simple-page-master,
* or the simple page master produced by the page sequence master 
otherwise.
  @@ -155,18 +130,6 @@
   layoutMasterSet = root.getLayoutMasterSet();
   flowMap = new HashMap();
   
  -// we are now on the first page of the page sequence
  -thisIsFirstPage = true;
  -
  -if (initialPageNumber.getEnum() != 0) {
  -// auto | auto-odd | auto-even.
  -pageNumberType = initialPageNumber.getEnum();
  -} else {
  -pageNumberType = EXPLICIT;
  -int pageStart = initialPageNumber.getValue();
  -this.explicitFirstNumber = (pageStart > 0) ? pageStart : 1;
  -}
  -
   this.simplePageMaster =
   this.layoutMasterSet.getSimplePageMaster(masterReference);
   if (this.simplePageMaster == null) {
  @@ -186,9 +149,8 @@
   new PageNumberGenerator(format, groupingSeparator, groupingSize, 
letterValue);
   
   checkId(id);
  -//call startStructuredPageSequence to ensure, that startPageSequence 
is called
  -//before startFlow.
  -startStructuredPageSequence();
  +initPageNumber();
  +getFOEventHandler().startPageSequence(this);
   }
   
   /**
  @@ -248,13 +210,11 @@
   } else if (childId == FO_FLOW) {
   this.mainFlow = (Flow) child;
   addFlow(mainFlow);
  -startStructuredPageSequence();
   super.addChildNode(child); // For getC

cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr AbstractLayoutManager.java ContentLayoutManager.java LMiter.java LayoutManager.java PageLayoutManager.java LayoutManagerLS.java

2004-05-18 Thread gmazza
gmazza  2004/05/18 04:42:08

  Modified:src/java/org/apache/fop/apps Document.java Driver.java
   src/java/org/apache/fop/layoutmgr AbstractLayoutManager.java
ContentLayoutManager.java LMiter.java
LayoutManager.java PageLayoutManager.java
  Removed: src/java/org/apache/fop/layout LayoutStrategy.java
   src/java/org/apache/fop/layoutmgr LayoutManagerLS.java
  Log:
  Folded the layout strategy into apps.Document.
  
  Revision  ChangesPath
  1.14  +114 -29   xml-fop/src/java/org/apache/fop/apps/Document.java
  
  Index: Document.java
  ===
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/apps/Document.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- Document.java 22 Apr 2004 21:38:39 -  1.13
  +++ Document.java 18 May 2004 11:42:07 -  1.14
  @@ -24,22 +24,25 @@
   import java.util.Set;
   import java.util.HashSet;
   
  -
   // FOP
  -import org.apache.fop.apps.FOUserAgent;
  -
   import org.apache.fop.area.AreaTree;
   import org.apache.fop.area.AreaTreeControl;
   import org.apache.fop.area.AreaTreeModel;
  +import org.apache.fop.area.Title;
   
  -import org.apache.fop.fo.extensions.Bookmarks;
   import org.apache.fop.fo.FOInputHandler;
   import org.apache.fop.fo.FOTreeControl;
   import org.apache.fop.fo.FOTreeEvent;
   import org.apache.fop.fo.FOTreeListener;
  +import org.apache.fop.fo.extensions.Bookmarks;
   import org.apache.fop.fo.pagination.PageSequence;
   import org.apache.fop.fonts.FontInfo;
  -import org.apache.fop.layout.LayoutStrategy;
  +import org.apache.fop.layoutmgr.AddLMVisitor;
  +import org.apache.fop.layoutmgr.ContentLayoutManager;
  +import org.apache.fop.layoutmgr.InlineStackingLayoutManager;
  +import org.apache.fop.layoutmgr.LMiter;
  +import org.apache.fop.layoutmgr.PageLayoutManager;
  +
   
   import org.apache.commons.logging.Log;
   
  @@ -59,13 +62,6 @@
   /** The Font information relevant for this document */
   private FontInfo fontInfo;
   
  -/**
  - * the LayoutStrategy to be used to process this document
  - * TODO: this actually belongs in the RenderContext class, when it is
  - * created
  - */
  -private LayoutStrategy layoutStrategy = null;
  -
   /** The current AreaTree for the PageSequence being rendered. */
   public AreaTree areaTree;
   
  @@ -74,6 +70,10 @@
   
   private Bookmarks bookmarks = null;
   
  +/** Useful only for allowing subclasses of AddLMVisitor to be set by those
  + extending FOP **/
  + private AddLMVisitor addLMVisitor = null;
  +
   /**
* The current set of id's in the FO tree.
* This is used so we know if the FO tree contains duplicates.
  @@ -104,21 +104,6 @@
   }
   
   /**
  - * Set the LayoutStrategy to be used to process this Document
  - * @param ls the LayoutStrategy object to be used to process this Document
  - */
  -public void setLayoutStrategy(LayoutStrategy ls) {
  -this.layoutStrategy = ls;
  -}
  -
  -/**
  - * @return this Document's LayoutStrategy object
  - */
  -public LayoutStrategy getLayoutStrategy () {
  -return layoutStrategy;
  -}
  -
  -/**
* Public accessor for the parent Driver of this Document
* @return the parent Driver for this Document
*/
  @@ -135,7 +120,7 @@
   public void foPageSequenceComplete (FOTreeEvent event) throws FOPException {
   PageSequence pageSeq = event.getPageSequence();
   areaTree.addBookmarksToAreaTree();
  -layoutStrategy.format(pageSeq, areaTree);
  +format(pageSeq, areaTree);
   }
   
   /**
  @@ -195,4 +180,104 @@
   return foInputHandler;
   }
   
  +/**
  + * Runs the formatting of this page sequence into the given area tree
  + *
  + * @param pageSeq the PageSequence to be formatted
  + * @param areaTree the area tree to format this page sequence into
  + * @throws FOPException if there is an error formatting the contents
  + */
  +public void format(PageSequence pageSeq, AreaTree areaTree) throws FOPException 
{
  +Title title = null;
  +if (pageSeq.getTitleFO() != null) {
  +title = getTitleArea(pageSeq.getTitleFO());
  +}
  +areaTree.startPageSequence(title);
  +// Make a new PageLayoutManager and a FlowLayoutManager
  +// Run the PLM in a thread
  +// Wait for them to finish.
  +
  +// If no main flow, nothing to layout!
  +if (pageSeq.getMainFlow() == null) {
  +return;
  +}
  +
  +// Initialize if already used?
  +//this.layoutMasterSet.resetPageMasters();
  +if (pageSeq.getPageSequenceMaster() != null) {
  +pageSeq.getPageSequenceMaster().reset();
  

cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr AbstractLayoutManager.java BlockContainerLayoutManager.java BlockLayoutManager.java ContentLayoutManager.java LayoutManager.java PageSequenceLayoutManager.java

2005-02-20 Thread spepping
spepping2005/02/20 11:50:47

  Modified:src/java/org/apache/fop/area PageViewport.java
   src/java/org/apache/fop/layoutmgr AbstractLayoutManager.java
BlockContainerLayoutManager.java
BlockLayoutManager.java ContentLayoutManager.java
LayoutManager.java PageSequenceLayoutManager.java
  Log:
  Corrected the logic of adding markers. LayoutManagers are responsible
  for correctly setting is-first and is-last on the BreakPoss and from
  there in the arguments of the addMarkers method. Implemented this for
  BlockLM. Also made a small change in the retrieval of markers from
  preceding pages.
  
  Revision  ChangesPath
  1.12  +47 -20xml-fop/src/java/org/apache/fop/area/PageViewport.java
  
  Index: PageViewport.java
  ===
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/area/PageViewport.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- PageViewport.java 6 Feb 2005 20:48:47 -   1.11
  +++ PageViewport.java 20 Feb 2005 19:50:47 -  1.12
  @@ -1,5 +1,5 @@
   /*
  - * Copyright 1999-2004 The Apache Software Foundation.
  + * Copyright 1999-2005 The Apache Software Foundation.
* 
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
  @@ -15,7 +15,7 @@
*/
   
   /* $Id$ */
  - 
  +
   package org.apache.fop.area;
   
   import java.awt.geom.Rectangle2D;
  @@ -27,6 +27,9 @@
   import java.util.HashMap;
   import java.util.Iterator;
   
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogFactory;
  +
   import org.apache.fop.fo.Constants;
   
   /**
  @@ -38,7 +41,7 @@
* The page (reference area) is then rendered inside the page object
*/
   public class PageViewport implements Resolvable, Cloneable {
  -
  +
   private Page page;
   private Rectangle2D viewArea;
   private boolean clip = false;
  @@ -51,7 +54,7 @@
   // once an idref is resolved it is removed
   // when this is empty the page can be rendered
   private HashMap unresolvedIDRefs = new HashMap();
  -
  +
   private Map pendingResolved = null;
   
   // hashmap of markers for this page
  @@ -63,6 +66,11 @@
   private Map markerLastAny = null;
   
   /**
  + * logging instance
  + */
  +protected static Log log = LogFactory.getLog(PageViewport.class);
  +
  +/**
* Create a page viewport.
* @param p the page reference area that holds the contents
* @param bounds the bounds of this viewport
  @@ -206,11 +214,14 @@
* Should this logic be placed in the Page layout manager.
*
* @param marks the map of markers to add
  - * @param start if the area being added is starting or ending
  - * @param isfirst isfirst or islast flag
  - */
  -public void addMarkers(Map marks, boolean start, boolean isfirst) {
  -if (start) {
  + * @param starting if the area being added is starting or ending
  + * @param isfirst if the area being added has is-first trait
  + * @param islast if the area being added has is-last trait
  + */
  +public void addMarkers(Map marks, boolean starting,
  +boolean isfirst, boolean islast) {
  +// at the start of the area, register is-first and any areas
  +if (starting) {
   if (isfirst) {
   if (markerFirstStart == null) {
   markerFirstStart = new HashMap();
  @@ -218,47 +229,54 @@
   if (markerFirstAny == null) {
   markerFirstAny = new HashMap();
   }
  -// only put in new values, leave current
  +// first on page: only put in new values, leave current
   for (Iterator iter = marks.keySet().iterator(); 
iter.hasNext();) {
   Object key = iter.next();
   if (!markerFirstStart.containsKey(key)) {
   markerFirstStart.put(key, marks.get(key));
  +log.trace("page " + pageNumberString + ": " + 
"Adding marker " + key + " to FirstStart");
   }
   if (!markerFirstAny.containsKey(key)) {
   markerFirstAny.put(key, marks.get(key));
  +log.trace("page " + pageNumberString + ": " + 
"Adding marker " + key + " to FirstAny");
   }
   }
   if (markerLastStart == null) {
   markerLastStart = new HashMap();
   }
  -// replace all
  +// last on page: replace all
   markerLastStart.putAll(marks);
  -
  +log.trace("page " + pageNumberString + ": " + "Adding al

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

2004-10-23 Thread gmazza
gmazza  2004/10/23 17:03:50

  Modified:src/java/org/apache/fop/apps FOUserAgent.java
   src/java/org/apache/fop/area AreaTreeHandler.java
AreaTreeModel.java LinkResolver.java
PageViewport.java RenderPagesModel.java
StorePagesModel.java TreeExt.java
   src/java/org/apache/fop/area/extensions BookmarkData.java
   src/java/org/apache/fop/area/inline
UnresolvedPageNumber.java
   src/java/org/apache/fop/fo FObj.java
   src/java/org/apache/fop/layoutmgr AbstractLayoutManager.java
BasicLinkLayoutManager.java
ContentLayoutManager.java LayoutManager.java
LineLayoutManager.java
PageNumberCitationLayoutManager.java
PageSequenceLayoutManager.java
  Added:   src/java/org/apache/fop/area Resolvable.java
  Removed: src/java/org/apache/fop/area Resolveable.java
  Log:
  1.) Rename of interface Resolveable to Resolvable.  
(http://dictionary.reference.com/search?q=resolvable)
  2.) Reordering of methods in AreaTreeHandler, removal of unneeded TreeExt array.
  3.) Switch from AreaTreeModel.addExtension() to .handleExtension().
  4.) Removal of unneeded TreeExt.getName() (unused), getMimeType() (implementation
  of an Area Tree extension up to each renderer), and isResolvable() (code changed to
  use instanceof operator instead).
  5.) Couple of minor layout bugs fixed.
  
  Revision  ChangesPath
  1.19  +3 -3  xml-fop/src/java/org/apache/fop/apps/FOUserAgent.java
  
  Index: FOUserAgent.java
  ===
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/apps/FOUserAgent.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- FOUserAgent.java  10 Oct 2004 12:24:03 -  1.18
  +++ FOUserAgent.java  24 Oct 2004 00:03:49 -  1.19
  @@ -57,8 +57,8 @@
* eg. bookmarks will be held in a special hierarchical area representing
* the title and bookmark structure
* 
  - * These areas may contain resolveable areas that will be processed
  - * with other resolveable areas
  + * These areas may contain resolvable areas that will be processed
  + * with other resolvable areas
*/
   public class FOUserAgent {
   
  
  
  
  1.14  +56 -59xml-fop/src/java/org/apache/fop/area/AreaTreeHandler.java
  
  Index: AreaTreeHandler.java
  ===
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/area/AreaTreeHandler.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- AreaTreeHandler.java  4 Oct 2004 00:59:38 -   1.13
  +++ AreaTreeHandler.java  24 Oct 2004 00:03:49 -  1.14
  @@ -86,8 +86,6 @@
   // list of id's yet to be resolved and arraylists of pages
   private Map resolve = new HashMap();
   
  -private List treeExtensions = new ArrayList();
  -
   private static Log log = LogFactory.getLog(AreaTreeHandler.class);
   
   /**
  @@ -136,7 +134,7 @@
   Set todo = (Set)resolve.get(id);
   if (todo != null) {
   for (Iterator iter = todo.iterator(); iter.hasNext();) {
  -Resolveable res = (Resolveable)iter.next();
  +Resolvable res = (Resolvable)iter.next();
   res.resolve(id, list);
   }
   resolve.remove(id);
  @@ -155,9 +153,9 @@
   /**
* Add an unresolved object with a given id.
* @param id the id reference that needs resolving
  - * @param res the Resolveable object to resolve
  + * @param res the Resolvable object to resolve
*/
  -public void addUnresolvedID(String id, Resolveable res) {
  +public void addUnresolvedID(String id, Resolvable res) {
   Set todo = (Set)resolve.get(id);
   if (todo == null) {
   todo = new HashSet();
  @@ -167,34 +165,6 @@
   }
   
   /**
  - * Add a tree extension.
  - * This checks if the extension is resolveable and attempts
  - * to resolve or add the resolveable ids for later resolution.
  - * @param ext the tree extension to add.
  - */
  -private void addTreeExtension(TreeExt ext) {
  -treeExtensions.add(ext);
  -if (ext.isResolveable()) {
  -Resolveable res = (Resolveable)ext;
  -String[] ids = res.getIDs();
  -for (int count = 0; count < ids.length; count++) {
  -if (idLocations.containsKey(ids[count])) {
  -res.resolve(ids[count], (List)idLocations.get(ids[count]));
  -} else {
  -Set todo = (Set)resolve.get(ids[count]);
  -if (todo == null) {
  -todo = new HashSet(