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 ar...@apache.org on 2001/07/23 04:00:03 UTC

cvs commit: xml-fop/src/org/apache/fop/layout AreaTree.java

arved       01/07/22 19:00:03

  Modified:    src/org/apache/fop/layout AreaTree.java
  Log:
  AHS: continued work on fo:marker support
  
  Revision  Changes    Path
  1.9       +41 -2     xml-fop/src/org/apache/fop/layout/AreaTree.java
  
  Index: AreaTree.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/layout/AreaTree.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- AreaTree.java	2001/06/12 11:37:36	1.8
  +++ AreaTree.java	2001/07/23 02:00:03	1.9
  @@ -1,4 +1,4 @@
  -/* $Id: AreaTree.java,v 1.8 2001/06/12 11:37:36 keiron Exp $
  +/* $Id: AreaTree.java,v 1.9 2001/07/23 02:00:03 arved 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.
  @@ -13,6 +13,7 @@
   import org.apache.fop.render.Renderer;
   import org.apache.fop.datatypes.IDReferences;
   import org.apache.fop.extensions.ExtensionObj;
  +import org.apache.fop.fo.pagination.PageSequence;
   
   // Java
   import java.io.IOException;
  @@ -67,5 +68,43 @@
   	return rootExtensions;
       }
       
  -
  +	public Page getNextPage(Page current, boolean isWithinPageSequence,	
  +		boolean isFirstCall) {
  +		Page nextPage = null;
  +		int pageIndex = 0;
  +		if (isFirstCall)
  +			pageIndex = pageList.size();
  +		else
  +			pageIndex = pageList.indexOf(current);
  +		if ((pageIndex + 1) < pageList.size()) {
  +			nextPage = (Page)pageList.elementAt(pageIndex + 1);
  +			if (isWithinPageSequence && !nextPage.getPageSequence().equals(current.getPageSequence())) {
  +				nextPage = null;
  +			}
  +		}
  +		return nextPage;
  +	}
  +
  +	public Page getPreviousPage(Page current, boolean isWithinPageSequence,
  +		boolean isFirstCall) {
  +		Page previousPage = null;
  +		int pageIndex = 0;
  +		if (isFirstCall)
  +			pageIndex = pageList.size();
  +		else
  +			pageIndex = pageList.indexOf(current);
  +		// System.out.println("Page index = " + pageIndex);
  +		if ((pageIndex - 1) >= 0) {
  +			previousPage = (Page)pageList.elementAt(pageIndex - 1);
  +			PageSequence currentPS = current.getPageSequence();
  +			// System.out.println("Current PS = '" + currentPS + "'");
  +			PageSequence previousPS = previousPage.getPageSequence();
  +			// System.out.println("Previous PS = '" + previousPS + "'");
  +			if (isWithinPageSequence && !previousPS.equals(currentPS)) {
  +				// System.out.println("Outside page sequence");
  +				previousPage = null;
  +			}
  +		}
  +		return previousPage;
  +	}
   }
  
  
  

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