aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKeiron Liddle <keiron@apache.org>2003-02-19 05:43:24 +0000
committerKeiron Liddle <keiron@apache.org>2003-02-19 05:43:24 +0000
commit2376cbe94f417b0216ab13b40d9ac7e2826359bf (patch)
tree4ab811671b2d5e56e81c89ffc9b4c13cae505f45
parente044ea8ecdd250b88add96abd6b6c4fc67ae9a6b (diff)
downloadxmlgraphics-fop-2376cbe94f417b0216ab13b40d9ac7e2826359bf.tar.gz
xmlgraphics-fop-2376cbe94f417b0216ab13b40d9ac7e2826359bf.zip
place markers on page viewport
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@195970 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--src/org/apache/fop/area/Page.java5
-rw-r--r--src/org/apache/fop/area/PageViewport.java31
2 files changed, 31 insertions, 5 deletions
diff --git a/src/org/apache/fop/area/Page.java b/src/org/apache/fop/area/Page.java
index 4e636e4f8..f8ac4fcd6 100644
--- a/src/org/apache/fop/area/Page.java
+++ b/src/org/apache/fop/area/Page.java
@@ -29,11 +29,6 @@ public class Page implements Serializable, Cloneable {
private RegionViewport regionEnd = null;
private RegionViewport regionAfter = null;
- // hashmap of markers for this page
- // start and end are added by the fo that contains the markers
- private Map markerStart = null;
- private Map markerEnd = null;
-
// temporary map of unresolved objects used when serializing the page
private Map unresolved = null;
diff --git a/src/org/apache/fop/area/PageViewport.java b/src/org/apache/fop/area/PageViewport.java
index c74e47c6f..a63f963c1 100644
--- a/src/org/apache/fop/area/PageViewport.java
+++ b/src/org/apache/fop/area/PageViewport.java
@@ -41,6 +41,11 @@ public class PageViewport implements Resolveable, Cloneable {
private Map pendingResolved = null;
+ // hashmap of markers for this page
+ // start and end are added by the fo that contains the markers
+ private Map markerStart = null;
+ private Map markerEnd = null;
+
/**
* Create a page viewport.
* @param p the page reference area that holds the contents
@@ -171,6 +176,32 @@ public class PageViewport implements Resolveable, Cloneable {
}
/**
+ * Add the start markers for this page.
+ *
+ * @param marks the map of start markers to add
+ */
+ public void addMarkers(Map marks, boolean start) {
+ if (start) {
+ if (markerStart == null) {
+ markerStart = new HashMap();
+ }
+ markerStart.putAll(marks);
+ } else {
+ if (markerEnd == null) {
+ markerEnd = new HashMap();
+ }
+ markerEnd.putAll(marks);
+ }
+ }
+
+ public Object getMarker(String name, int pos) {
+ if (markerStart != null) {
+ return markerStart.get(name);
+ }
+ return null;
+ }
+
+ /**
* Save the page contents to an object stream.
* The map of unresolved references are set on the page so that
* the resolvers can be properly serialized and reloaded.