aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/area/RegionReference.java
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2006-01-17 11:07:10 +0000
committerJeremias Maerki <jeremias@apache.org>2006-01-17 11:07:10 +0000
commitc7d04323247a0d75f773c6fbe00cc1d68844a2e5 (patch)
tree7f1a575839a1e3fa35417ee97652350e0ff3bd4e /src/java/org/apache/fop/area/RegionReference.java
parentf56c315df5921953702f6ab9c2a331ff7c0caa0f (diff)
downloadxmlgraphics-fop-c7d04323247a0d75f773c6fbe00cc1d68844a2e5.tar.gz
xmlgraphics-fop-c7d04323247a0d75f773c6fbe00cc1d68844a2e5.zip
New feature: "Intermediate format" (IF). The IF is basically the XML dialect written by the area tree renderer (XMLRenderer). A new parser for this format allows reparsing a serialized and possibly modified area tree and rendering it to the final target format. More details on the Wiki at http://wiki.apache.org/xmlgraphics-fop/AreaTreeIntermediateXml. No advanced features have been implemented, yet, only the basic functionality. The whole change should be fully backwards-compatible WRT the outer FOP API except maybe for FOTreeBuilder.addElementMapping(), and the area tree XML which got small changes.
The area tree has been cleaned up. The serializability has been restored. The CachedRenderPagesModel works again and can, in certain situations, decrease the maximum amount of memory held at one point in time. Some adjustments were necessary in the area tree to help the work of the AreaTreeParser. The AreaTreeParser is new and is responsible for parsing area tree XML files and adding pages to a RenderPagesModel instance. It is SAX-based and should be pretty efficient. XMLUnit (http://xmlunit.sourceforge.net, BSD license) is a new dependency for the test code. It is used to verify the correctness of the intermediate format code. It doesn't have to be installed for the build to run through, though. ElementMapping got a new method getDOMImplementation() which provides the DOMImplementation used to handle a subdocument of a particular namespace. For example, SVG uses Batik's SVG DOM. The AreaTreeParser needs that to properly recreate foreign objects because it can't use the mechanism of the FO tree. The default implementation returns null. The ElementMapping instances are no longer maintained by the FOTreeBuilder, but by the newly created ElementMappingRegistry class. It is expected that the instance of this class is moved from the FOTreeBuilder and the AreaTreeParser's Handler class to the "environment class" once it is created to cut down on the startup time for each processed document. The XMLRenderer has been slightly modified to improve the serialization/deserialization qualities of the area tree XML format. The XMLRenderer can now mimic another renderer (see mimicRenderer(Renderer)) in order to use its font setup. That way it is made certain that the reparsed area tree will render to the final target format exactly as expected. Fixed a bug in the XMLHandlerRegistry which did not always return the right XMLHandler for every situation. Added a DefaultErrorListener to the util package. I've had problems with Xalan-J swallowing exceptions with its default ErrorListener, so I added a simple one for convenience and use in AreaTreeParser. Example code for working with the AreaTreeParser can be found in examples/embedding. Documentation will follow. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@369753 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/area/RegionReference.java')
-rw-r--r--src/java/org/apache/fop/area/RegionReference.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/java/org/apache/fop/area/RegionReference.java b/src/java/org/apache/fop/area/RegionReference.java
index b643db4dc..eb85fc4b8 100644
--- a/src/java/org/apache/fop/area/RegionReference.java
+++ b/src/java/org/apache/fop/area/RegionReference.java
@@ -1,5 +1,5 @@
/*
- * Copyright 1999-2005 The Apache Software Foundation.
+ * Copyright 1999-2006 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -67,6 +67,11 @@ public class RegionReference extends Area implements Cloneable {
regionViewport = parent;
}
+ /** @see org.apache.fop.area.Area#addChildArea(org.apache.fop.area.Area) */
+ public void addChildArea(Area child) {
+ blocks.add(child);
+ }
+
/**
* Set the Coordinate Transformation Matrix which transforms content
* coordinates in this region reference area which are specified in
@@ -125,7 +130,7 @@ public class RegionReference extends Area implements Cloneable {
* @param block the block area to add
*/
public void addBlock(Block block) {
- blocks.add(block);
+ addChildArea(block);
}
/**