aboutsummaryrefslogtreecommitdiffstats
path: root/src/org/apache/fop/area/AreaTree.java
diff options
context:
space:
mode:
authorKeiron Liddle <keiron@apache.org>2002-05-17 14:47:13 +0000
committerKeiron Liddle <keiron@apache.org>2002-05-17 14:47:13 +0000
commit419405d1934e8a9b7ba9cc9e44fb967c39cafa19 (patch)
tree56be2377226eb9aea407f7487e516b40a2a6462f /src/org/apache/fop/area/AreaTree.java
parent7be7b7e54762346f41ab92f4b92bae326811df95 (diff)
downloadxmlgraphics-fop-419405d1934e8a9b7ba9cc9e44fb967c39cafa19.tar.gz
xmlgraphics-fop-419405d1934e8a9b7ba9cc9e44fb967c39cafa19.zip
cleaned up bookmark extension a bit
make multi page sequences work properly git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@194825 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/org/apache/fop/area/AreaTree.java')
-rw-r--r--src/org/apache/fop/area/AreaTree.java35
1 files changed, 34 insertions, 1 deletions
diff --git a/src/org/apache/fop/area/AreaTree.java b/src/org/apache/fop/area/AreaTree.java
index 67b6ecdd6..387646815 100644
--- a/src/org/apache/fop/area/AreaTree.java
+++ b/src/org/apache/fop/area/AreaTree.java
@@ -10,6 +10,7 @@ package org.apache.fop.area;
import org.apache.fop.render.Renderer;
import java.util.ArrayList;
+import java.util.HashMap;
/**
* Area tree for formatting objects.
@@ -33,6 +34,12 @@ public class AreaTree {
// in different situations
AreaTreeModel model;
+ // hashmap of arraylists containing pages with id area
+ HashMap idLocations = new HashMap();
+ // list of id's yet to be resolved and arraylists of pages
+ HashMap resolve = new HashMap();
+ ArrayList treeExtensions = new ArrayList();
+
public RenderPagesModel createRenderPagesModel(Renderer rend) {
return new RenderPagesModel(rend);
}
@@ -53,6 +60,28 @@ public class AreaTree {
model.addPage(page);
}
+ public void addTreeExtension(TreeExt ext) {
+ treeExtensions.add(ext);
+ if(ext.isResolveable()) {
+ Resolveable res = (Resolveable)ext;
+ String[] ids = res.getIDs();
+ for(int count = 0; count < ids.length; count++) {
+ if(idLocations.containsKey(ids[count])) {
+ res.resolve(ids[count], (ArrayList)idLocations.get(ids[count]));
+ } else {
+ ArrayList todo = (ArrayList)resolve.get(ids[count]);
+ if(todo == null) {
+ todo = new ArrayList();
+ todo.add(ext);
+ resolve.put(ids[count], todo);
+ } else {
+ todo.add(ext);
+ }
+ }
+ }
+ }
+ }
+
// this is the model for the area tree object
public static abstract class AreaTreeModel {
public abstract void startPageSequence(Title title);
@@ -119,7 +148,11 @@ public class AreaTree {
public void addPage(PageViewport page) {
super.addPage(page);
// if page finished
- //renderer.renderPage(page);
+ try {
+ renderer.renderPage(page);
+ } catch(Exception e) {
+ // use error handler to handle this FOP or IO Exception
+ }
page.clear();
// else prepare
//renderer.preparePage(page);