aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGlen Mazza <gmazza@apache.org>2004-12-16 01:03:04 +0000
committerGlen Mazza <gmazza@apache.org>2004-12-16 01:03:04 +0000
commitbcaac1ac742590c379ba4ac3fdbf9d92779ff679 (patch)
treefe2a54811aa7f24da35d1c508c4781baacf15f42 /src
parent4f3152f59a020eda3dae7c56fa68c2063eeb084e (diff)
downloadxmlgraphics-fop-bcaac1ac742590c379ba4ac3fdbf9d92779ff679.tar.gz
xmlgraphics-fop-bcaac1ac742590c379ba4ac3fdbf9d92779ff679.zip
PR:
Obtained from: Submitted by: Reviewed by: Removed Runnable interface from PSLM; new method "activateLayout()" combines former run() and doLayout() methods in PSLM. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@198201 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r--src/java/org/apache/fop/area/AreaTreeHandler.java2
-rw-r--r--src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java41
2 files changed, 15 insertions, 28 deletions
diff --git a/src/java/org/apache/fop/area/AreaTreeHandler.java b/src/java/org/apache/fop/area/AreaTreeHandler.java
index 186ae558f..86611034c 100644
--- a/src/java/org/apache/fop/area/AreaTreeHandler.java
+++ b/src/java/org/apache/fop/area/AreaTreeHandler.java
@@ -236,7 +236,7 @@ public class AreaTreeHandler extends FOEventHandler {
if (pageSequence.getMainFlow() != null) {
PageSequenceLayoutManager pageSLM
= new PageSequenceLayoutManager(this, pageSequence);
- pageSLM.run();
+ pageSLM.activateLayout();
pageSequence.setCurrentPageNumber(pageSLM.getPageCount());
}
}
diff --git a/src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java b/src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java
index bdd43c94e..4ac067b08 100644
--- a/src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java
@@ -66,7 +66,7 @@ import org.apache.fop.traits.MinOptMax;
* LayoutManager for a PageSequence and its flow.
* It manages all page-related layout.
*/
-public class PageSequenceLayoutManager extends AbstractLayoutManager implements Runnable {
+public class PageSequenceLayoutManager extends AbstractLayoutManager {
private PageSequence fobj;
private static class BlockBreakPosition extends LeafPosition {
@@ -155,30 +155,6 @@ public class PageSequenceLayoutManager extends AbstractLayoutManager implements
}
/**
- * The layout process is designed to be able to be run in a thread.
- * In theory it can run at the same
- * time as FO tree generation, once the layout-master-set has been read.
- * We can arrange it so that the iterator over the fobj children waits
- * until the next child is available.
- * As it produces pages, it adds them to the AreaTree, where the
- * rendering process can also run in a parallel thread.
- */
- public void run() {
- fobj.initPageNumber();
- setPageCounting(fobj.getCurrentPageNumber(),
- fobj.getPageNumberGenerator());
-
- LineArea title = null;
- if (fobj.getTitleFO() != null) {
- title = getTitleArea(fobj.getTitleFO());
- }
-
- areaTreeModel.startPageSequence(title);
- doLayout();
- flush();
- }
-
- /**
* Get the page count.
* Used to get the last page number for reference for
* the next page sequence.
@@ -211,13 +187,23 @@ public class PageSequenceLayoutManager extends AbstractLayoutManager implements
}
/**
- * Do the layout of this page sequence.
+ * Start the layout of this page sequence.
* This completes the layout of the page sequence
* which creates and adds all the pages to the area tree.
*/
- protected void doLayout() {
+ public void activateLayout() {
+ fobj.initPageNumber();
+ setPageCounting(fobj.getCurrentPageNumber(),
+ fobj.getPageNumberGenerator());
+ LineArea title = null;
+ if (fobj.getTitleFO() != null) {
+ title = getTitleArea(fobj.getTitleFO());
+ }
+
+ areaTreeModel.startPageSequence(title);
log.debug("Starting layout");
+
// this should be done another way
makeNewPage(false, false);
createBodyMainReferenceArea();
@@ -239,6 +225,7 @@ public class PageSequenceLayoutManager extends AbstractLayoutManager implements
}
pageCount--;
log.debug("Ending layout");
+ flush();
}
/**