From 2376cbe94f417b0216ab13b40d9ac7e2826359bf Mon Sep 17 00:00:00 2001 From: Keiron Liddle Date: Wed, 19 Feb 2003 05:43:24 +0000 Subject: [PATCH] place markers on page viewport git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@195970 13f79535-47bb-0310-9956-ffa450edef68 --- src/org/apache/fop/area/Page.java | 5 ---- src/org/apache/fop/area/PageViewport.java | 31 +++++++++++++++++++++++ 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 @@ -170,6 +175,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 -- 2.39.5