aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/area
diff options
context:
space:
mode:
authorGlen Mazza <gmazza@apache.org>2005-02-10 17:08:24 +0000
committerGlen Mazza <gmazza@apache.org>2005-02-10 17:08:24 +0000
commit586fbcfa7eb1b846cc12d1218b61e2d9300dd54b (patch)
tree3b19b7b76588701dd2840fab58663df6daab34a4 /src/java/org/apache/fop/area
parent1b4f4bca2eeff6d23ebe29c676e50eccf898c15d (diff)
downloadxmlgraphics-fop-586fbcfa7eb1b846cc12d1218b61e2d9300dd54b.tar.gz
xmlgraphics-fop-586fbcfa7eb1b846cc12d1218b61e2d9300dd54b.zip
PR:
Obtained from: Submitted by: Reviewed by: Some simplification to StorePagesModel, removal of not very informative comment in PSLM. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@198415 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/area')
-rw-r--r--src/java/org/apache/fop/area/RenderPagesModel.java5
-rw-r--r--src/java/org/apache/fop/area/StorePagesModel.java46
2 files changed, 14 insertions, 37 deletions
diff --git a/src/java/org/apache/fop/area/RenderPagesModel.java b/src/java/org/apache/fop/area/RenderPagesModel.java
index b16a1c71a..f32364bd2 100644
--- a/src/java/org/apache/fop/area/RenderPagesModel.java
+++ b/src/java/org/apache/fop/area/RenderPagesModel.java
@@ -67,6 +67,7 @@ public class RenderPagesModel extends StorePagesModel {
public RenderPagesModel (FOUserAgent userAgent, int renderType,
FontInfo fontInfo, OutputStream stream) throws FOPException {
+ super();
renderer = RendererFactory.createRenderer(userAgent, renderType);
try {
@@ -220,12 +221,12 @@ public class RenderPagesModel extends StorePagesModel {
processOffDocumentItems(pendingODI);
pendingODI.clear();
processOffDocumentItems(endDocODI);
-
+
try {
renderer.stopRenderer();
} catch (IOException ex) {
throw new SAXException(ex);
- }
+ }
}
}
diff --git a/src/java/org/apache/fop/area/StorePagesModel.java b/src/java/org/apache/fop/area/StorePagesModel.java
index 922e29441..90491b77e 100644
--- a/src/java/org/apache/fop/area/StorePagesModel.java
+++ b/src/java/org/apache/fop/area/StorePagesModel.java
@@ -34,8 +34,8 @@ import org.apache.commons.logging.LogFactory;
* The pages are stored and can be retrieved in any order.
*/
public class StorePagesModel extends AreaTreeModel {
- private List pageSequence = null;
- private List currSequence;
+ private List pageSequenceList = null;
+ private List currentPageSequencePageList;
private List offDocumentItems = new java.util.ArrayList();
protected static Log log = LogFactory.getLog(StorePagesModel.class);
@@ -44,6 +44,7 @@ public class StorePagesModel extends AreaTreeModel {
* Create a new store pages model
*/
public StorePagesModel() {
+ pageSequenceList = new java.util.ArrayList();
}
/**
@@ -52,11 +53,8 @@ public class StorePagesModel extends AreaTreeModel {
* @param title the title of the page sequence.
*/
public void startPageSequence(LineArea title) {
- if (pageSequence == null) {
- pageSequence = new java.util.ArrayList();
- }
- currSequence = new java.util.ArrayList();
- pageSequence.add(currSequence);
+ currentPageSequencePageList = new java.util.ArrayList();
+ pageSequenceList.add(currentPageSequencePageList);
}
/**
@@ -64,7 +62,7 @@ public class StorePagesModel extends AreaTreeModel {
* @param page the page to add to the current page sequence
*/
public void addPage(PageViewport page) {
- currSequence.add(page);
+ currentPageSequencePageList.add(page);
}
/**
@@ -72,7 +70,7 @@ public class StorePagesModel extends AreaTreeModel {
* @return the number of page sequences in the document.
*/
public int getPageSequenceCount() {
- return pageSequence.size();
+ return pageSequenceList.size();
}
/**
@@ -81,7 +79,7 @@ public class StorePagesModel extends AreaTreeModel {
* @return returns the number of pages in a page sequence
*/
public int getPageCount(int seq) {
- List sequence = (List) pageSequence.get(seq - 1);
+ List sequence = (List) pageSequenceList.get(seq - 1);
return sequence.size();
}
@@ -92,7 +90,7 @@ public class StorePagesModel extends AreaTreeModel {
* @return the PageViewport for the particular page
*/
public PageViewport getPage(int seq, int count) {
- List sequence = (List) pageSequence.get(seq - 1);
+ List sequence = (List) pageSequenceList.get(seq - 1);
return (PageViewport) sequence.get(count);
}
@@ -100,36 +98,14 @@ public class StorePagesModel extends AreaTreeModel {
* @see org.apache.fop.area.AreaTreeModel#handleOffDocumentItem(OffDocumentItem)
*/
public void handleOffDocumentItem(OffDocumentItem ext) {
- int seq, page;
- switch(ext.getWhenToProcess()) {
- case OffDocumentItem.IMMEDIATELY:
- seq = pageSequence == null ? 0 : pageSequence.size();
- page = currSequence == null ? 0 : currSequence.size();
- break;
- case OffDocumentItem.AFTER_PAGE:
- break;
- case OffDocumentItem.END_OF_DOC:
- break;
- }
offDocumentItems.add(ext);
}
/**
- * Get the list of OffDocumentItems that apply at a particular
- * position in the document.
- * @param seq the page sequence number
- * @param count the page count in the sequence
+ * Get the list of OffDocumentItems for this StorePagesModel.
* @return the list of OffDocumentItems
*/
- public List getOffDocumentItems(int seq, int count) {
- return null;
- }
-
- /**
- * Get the end of document OffDocumentItems for this store pages model.
- * @return the list of end OffDocumentItems
- */
- public List getEndOffDocumentItems() {
+ public List getOffDocumentItems() {
return offDocumentItems;
}