diff options
author | arved <arved@unknown> | 2001-07-23 02:00:37 +0000 |
---|---|---|
committer | arved <arved@unknown> | 2001-07-23 02:00:37 +0000 |
commit | 4ca428ec7c83c577c98df603e389f1745689fd68 (patch) | |
tree | c1208979bf56773ad78d3490acf91432f93d68f4 /src/org/apache/fop/layout | |
parent | b481a6cbf8d3d9994550ee2cf699699b501449e7 (diff) | |
download | xmlgraphics-fop-4ca428ec7c83c577c98df603e389f1745689fd68.tar.gz xmlgraphics-fop-4ca428ec7c83c577c98df603e389f1745689fd68.zip |
AHS: continued work on fo:marker support
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@194364 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/org/apache/fop/layout')
-rw-r--r-- | src/org/apache/fop/layout/AreaTree.java | 39 | ||||
-rw-r--r-- | src/org/apache/fop/layout/Page.java | 15 |
2 files changed, 54 insertions, 0 deletions
diff --git a/src/org/apache/fop/layout/AreaTree.java b/src/org/apache/fop/layout/AreaTree.java index a0195082d..315230d9f 100644 --- a/src/org/apache/fop/layout/AreaTree.java +++ b/src/org/apache/fop/layout/AreaTree.java @@ -13,6 +13,7 @@ import org.apache.fop.svg.*; 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 @@ public class AreaTree { 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; + } } diff --git a/src/org/apache/fop/layout/Page.java b/src/org/apache/fop/layout/Page.java index 73c5b1ce6..0b837317f 100644 --- a/src/org/apache/fop/layout/Page.java +++ b/src/org/apache/fop/layout/Page.java @@ -11,6 +11,7 @@ import org.apache.fop.render.Renderer; import org.apache.fop.fo.flow.*; import org.apache.fop.fo.*; import org.apache.fop.apps.*; +import org.apache.fop.fo.pagination.PageSequence; // Java import java.util.Vector; @@ -29,6 +30,8 @@ public class Page { private AreaTree areaTree; + private PageSequence pageSequence; + protected int pageNumber = 0; protected String formattedPageNumber; @@ -47,6 +50,18 @@ public class Page { markers = new Vector(); } + public void setPageSequence(PageSequence pageSequence) { + this.pageSequence = pageSequence; + } + + public PageSequence getPageSequence() { + return pageSequence; + } + + public AreaTree getAreaTree() { + return areaTree; + } + public void setNumber(int number) { this.pageNumber = number; } |