aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/fo
diff options
context:
space:
mode:
authorWilliam Victor Mote <vmote@apache.org>2003-08-20 17:25:44 +0000
committerWilliam Victor Mote <vmote@apache.org>2003-08-20 17:25:44 +0000
commitea3eecb3912a99ded8f3de76bf2e15cc2f4e58cf (patch)
tree9e30202c785eac36bb29650783bc775987627a74 /src/java/org/apache/fop/fo
parentb15c07b568d05a40271912074931dee9230754b6 (diff)
downloadxmlgraphics-fop-ea3eecb3912a99ded8f3de76bf2e15cc2f4e58cf.tar.gz
xmlgraphics-fop-ea3eecb3912a99ded8f3de76bf2e15cc2f4e58cf.zip
move startup of laying out a PageSequence from PageSequence.format() and Document.foPageSequenceComplete to the LayoutStrategy implementation (layoutmgr/LayoutManagerLS)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@196815 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/fo')
-rw-r--r--src/java/org/apache/fop/fo/pagination/PageSequence.java72
-rw-r--r--src/java/org/apache/fop/fo/pagination/Root.java2
2 files changed, 21 insertions, 53 deletions
diff --git a/src/java/org/apache/fop/fo/pagination/PageSequence.java b/src/java/org/apache/fop/fo/pagination/PageSequence.java
index 8ee2a86c5..6de86c768 100644
--- a/src/java/org/apache/fop/fo/pagination/PageSequence.java
+++ b/src/java/org/apache/fop/fo/pagination/PageSequence.java
@@ -358,59 +358,9 @@ public class PageSequence extends FObj {
}
/**
- * Runs the formatting of this page sequence into the given area tree
- *
- * @param areaTree the area tree to format this page sequence into
- * @throws FOPException if there is an error formatting the contents
- */
- public void format(AreaTree areaTree) throws FOPException {
- // 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 (this.mainFlow == null) {
- return;
- }
-
- // Initialize if already used?
- // this.layoutMasterSet.resetPageMasters();
- if (pageSequenceMaster != null) {
- pageSequenceMaster.reset();
- }
-
- int firstAvailPageNumber = 0;
- initPageNumber();
-
- // This will layout pages and add them to the area tree
- PageLayoutManager pageLM = new PageLayoutManager(areaTree, this);
- pageLM.setUserAgent(getUserAgent());
- pageLM.setFObj(this);
- pageLM.setPageCounting(currentPageNumber, pageNumberGenerator);
-
- // For now, skip the threading and just call run directly.
- pageLM.run();
-
- // Thread layoutThread = new Thread(pageLM);
-// layoutThread.start();
-// log.debug("Layout thread started");
-
-// // wait on both managers
-// try {
-// layoutThread.join();
-// log.debug("Layout thread done");
-// } catch (InterruptedException ie) {
-// log.error("PageSequence.format() interrupted waiting on layout");
-// }
- this.currentPageNumber = pageLM.getPageCount();
- // Tell the root the last page number we created.
- this.root.setRunningPageNumberCounter(this.currentPageNumber);
- }
-
- /**
* Initialize the current page number for the start of the page sequence.
*/
- private void initPageNumber() {
+ public void initPageNumber() {
this.currentPageNumber = this.root.getRunningPageNumberCounter() + 1;
if (this.pageNumberType == AUTO_ODD) {
@@ -826,5 +776,23 @@ public class PageSequence extends FObj {
fotv.serveVisitor(this);
}
-}
+ public Flow getMainFlow() {
+ return mainFlow;
+ }
+
+ public PageSequenceMaster getPageSequenceMaster() {
+ return pageSequenceMaster;
+ }
+
+ public PageNumberGenerator getPageNumberGenerator() {
+ return pageNumberGenerator;
+ }
+ public void setCurrentPageNumber(int currentPageNumber) {
+ this.currentPageNumber = currentPageNumber;
+ }
+
+ public Root getRoot() {
+ return root;
+ }
+}
diff --git a/src/java/org/apache/fop/fo/pagination/Root.java b/src/java/org/apache/fop/fo/pagination/Root.java
index 139cbd414..415c3de4e 100644
--- a/src/java/org/apache/fop/fo/pagination/Root.java
+++ b/src/java/org/apache/fop/fo/pagination/Root.java
@@ -97,7 +97,7 @@ public class Root extends FObj {
* Sets the overall page number counter.
* @param count the new page count
*/
- protected void setRunningPageNumberCounter(int count) {
+ public void setRunningPageNumberCounter(int count) {
this.runningPageNumberCounter = count;
}