aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/fo/FOTreeBuilderContext.java
diff options
context:
space:
mode:
authorAdrian Cumiskey <acumiskey@apache.org>2008-06-23 09:46:41 +0000
committerAdrian Cumiskey <acumiskey@apache.org>2008-06-23 09:46:41 +0000
commit2f451f9c4dae507df76e77bc13e0839c98724fd0 (patch)
tree1c82c51e1a4cf8f89a9e587179a0b91dc1a6b60c /src/java/org/apache/fop/fo/FOTreeBuilderContext.java
parent08f0da8adadb9fda358992ad204948570ad41d11 (diff)
downloadxmlgraphics-fop-2f451f9c4dae507df76e77bc13e0839c98724fd0.tar.gz
xmlgraphics-fop-2f451f9c4dae507df76e77bc13e0839c98724fd0.zip
Merged revisions 669423,669436,669835,670217,670222,670323,670325,670332,670335-670336,670341,670344,670401,670409,670411-670412,670422-670424,670492 via svnmerge from
https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk ........ r669423 | jeremias | 2008-06-19 09:25:46 +0100 (Thu, 19 Jun 2008) | 1 line Simplifications and a Checkstyle fix. ........ r669436 | jeremias | 2008-06-19 10:46:12 +0100 (Thu, 19 Jun 2008) | 2 lines Separation of concerns: Split FOEventHandler into FOEventHandler and FOTreeBuilderContext. The latter contains stuff only used at tree-building stage. FOEventHandler is oriented towards output. ........ r669835 | acumiskey | 2008-06-20 10:18:56 +0100 (Fri, 20 Jun 2008) | 1 line Strict/loose validation of <fo:table-footer/> ordering somehow got lost in processing feedback branch merge. ........ r670217 | acumiskey | 2008-06-21 17:10:03 +0100 (Sat, 21 Jun 2008) | 1 line Moved the contents of TableBody into a new abstract base class TablePart, which is now subclassed by TableBody, TableHeader and TableFooter. ........ r670222 | acumiskey | 2008-06-21 17:28:56 +0100 (Sat, 21 Jun 2008) | 1 line Moved the contents of TableBody into a new abstract base class TablePart, which is now subclassed by TableBody, TableHeader and TableFooter. ........ r670323 | adelmelle | 2008-06-22 10:07:47 +0100 (Sun, 22 Jun 2008) | 1 line Addition to r670217 ........ r670325 | adelmelle | 2008-06-22 10:28:56 +0100 (Sun, 22 Jun 2008) | 1 line Minor javadoc correction ........ r670332 | adelmelle | 2008-06-22 11:21:03 +0100 (Sun, 22 Jun 2008) | 1 line Minor tweak: avoid warning when running through Saxon ........ r670335 | adelmelle | 2008-06-22 11:53:51 +0100 (Sun, 22 Jun 2008) | 1 line Avoid StackOverflow on TableColumn.toString() during debugging. ........ r670336 | adelmelle | 2008-06-22 12:01:27 +0100 (Sun, 22 Jun 2008) | 1 line Minor tweak: use XG Commons version of the interface ........ r670341 | adelmelle | 2008-06-22 12:18:03 +0100 (Sun, 22 Jun 2008) | 2 lines Changed FONode.addCharacters() signature to match the characters() event (use 'length' as a parameter instead of 'end') ........ r670344 | adelmelle | 2008-06-22 12:28:06 +0100 (Sun, 22 Jun 2008) | 1 line Changed signature for static handleWhiteSpaceFor(), and used internally to make the code a bit more compact ........ r670401 | adelmelle | 2008-06-22 20:19:17 +0100 (Sun, 22 Jun 2008) | 1 line Correction: characters() expects a 'length' not an 'endIndex' ........ r670409 | adelmelle | 2008-06-22 21:18:27 +0100 (Sun, 22 Jun 2008) | 1 line Very minor tweak: simplify conditional ........ r670411 | adelmelle | 2008-06-22 21:38:28 +0100 (Sun, 22 Jun 2008) | 2 lines Deleted deprecated interface; unused after r670336 ........ r670412 | adelmelle | 2008-06-22 21:57:43 +0100 (Sun, 22 Jun 2008) | 6 lines Partial fix of FOEventHandler call sequence (see also Bugzilla #45237): call startOfNode() after addChildNode() moved initialization for tableFOs to processNode() moved finishing code to a finalizeNode() method (which is now also used by AbstractRetrieveMarker) restored protected status of startOfNode()/endOfNode() in fo.flow.table package ........ r670422 | adelmelle | 2008-06-22 23:10:55 +0100 (Sun, 22 Jun 2008) | 4 lines Switch FOText to use a java.nio.CharBuffer, and implement the CharSequence interface. TextLayoutManager no longer duplicates the char array, operates on the FOText (charAt(i)) Additionally: endOfNode() for FOText and Character deferred until after white-space handling. ........ r670423 | adelmelle | 2008-06-22 23:17:00 +0100 (Sun, 22 Jun 2008) | 1 line Added missing file from r670422 ........ r670424 | adelmelle | 2008-06-22 23:18:53 +0100 (Sun, 22 Jun 2008) | 1 line Another missing file... ........ r670492 | lfurini | 2008-06-23 10:24:14 +0100 (Mon, 23 Jun 2008) | 2 lines Added support for non-zero borders and padding on page regions. Testcase included, now disabled because it is supposed to run with relaxed validation switched on. ........ git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_AFPGOCAResources@670500 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/fo/FOTreeBuilderContext.java')
-rw-r--r--src/java/org/apache/fop/fo/FOTreeBuilderContext.java107
1 files changed, 107 insertions, 0 deletions
diff --git a/src/java/org/apache/fop/fo/FOTreeBuilderContext.java b/src/java/org/apache/fop/fo/FOTreeBuilderContext.java
new file mode 100644
index 000000000..0cbdd7797
--- /dev/null
+++ b/src/java/org/apache/fop/fo/FOTreeBuilderContext.java
@@ -0,0 +1,107 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* $Id$ */
+
+package org.apache.fop.fo;
+
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * Context class providing information needed while building the FO tree.
+ */
+public class FOTreeBuilderContext {
+
+ /**
+ * The current set of id's in the FO tree.
+ * This is used so we know if the FO tree contains duplicates.
+ */
+ private Set idReferences = new HashSet();
+
+ /**
+ * The property list maker.
+ */
+ protected PropertyListMaker propertyListMaker;
+
+ /**
+ * The XMLWhitespaceHandler for this tree
+ */
+ protected XMLWhiteSpaceHandler whiteSpaceHandler = new XMLWhiteSpaceHandler();
+
+ /**
+ * Indicates whether processing descendants of a marker
+ */
+ private boolean inMarker = false;
+
+ /**
+ * Returns the set of ID references.
+ * @return the ID references
+ */
+ public Set getIDReferences() {
+ return idReferences;
+ }
+
+ /**
+ * Return the propertyListMaker.
+ *
+ * @return the currently active {@link PropertyListMaker}
+ */
+ public PropertyListMaker getPropertyListMaker() {
+ return propertyListMaker;
+ }
+
+ /**
+ * Set a new propertyListMaker.
+ *
+ * @param propertyListMaker the new {@link PropertyListMaker} to use
+ */
+ public void setPropertyListMaker(PropertyListMaker propertyListMaker) {
+ this.propertyListMaker = propertyListMaker;
+ }
+
+ /**
+ * Return the XMLWhiteSpaceHandler
+ * @return the whiteSpaceHandler
+ */
+ public XMLWhiteSpaceHandler getXMLWhiteSpaceHandler() {
+ return whiteSpaceHandler;
+ }
+
+ /**
+ * Switch to or from marker context
+ * (used by FOTreeBuilder when processing
+ * a marker)
+ *
+ * @param inMarker true if a marker is being processed;
+ * false otherwise
+ *
+ */
+ protected void switchMarkerContext(boolean inMarker) {
+ this.inMarker = inMarker;
+ }
+
+ /**
+ * Check whether in marker context
+ *
+ * @return true if a marker is being processed
+ */
+ protected boolean inMarker() {
+ return this.inMarker;
+ }
+
+}