aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/fo/pagination/Root.java
diff options
context:
space:
mode:
authorVincent Hennebert <vhennebert@apache.org>2011-11-24 17:15:28 +0000
committerVincent Hennebert <vhennebert@apache.org>2011-11-24 17:15:28 +0000
commitc6fb066a02573904f7ca404605f14c800adf80c5 (patch)
treed73a722e23ae74124b1bcb691d0e6f0b2f0af32f /src/java/org/apache/fop/fo/pagination/Root.java
parentb073a605e44760bcb7add72968a3a2f78cf06d97 (diff)
downloadxmlgraphics-fop-c6fb066a02573904f7ca404605f14c800adf80c5.tar.gz
xmlgraphics-fop-c6fb066a02573904f7ca404605f14c800adf80c5.zip
Removed the DOM representation of the structure tree.
The structure tree is now directly converted into corresponding PDF objects. When going the IF route, the structure tree is stored in the form of SAX events that will be re-played when it's time to stream them into the output. This may still change. * Extracted RFC3066 methods from XMLUtil into new LanguageTags class that can be re-used in a non-XML context. * Dropped support for accessibility in the old Area Tree XML. * Added support for the xml:lang property on fo:root, so that the global language can be set for the document without retrieving the language from the first page-sequence. * Renamed StructureTreeBuilder into more appropriate StructureTreeEventHandler (same for applicable sub-classes) * Renamed StructureTreeBuildingFOEventHandler into FO2StructureTreeConverter and added test case * Added test cases for classes in the StructureTreeEventHandler hierarchy git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_ImproveAccessibility@1205935 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/fo/pagination/Root.java')
-rw-r--r--src/java/org/apache/fop/fo/pagination/Root.java26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/java/org/apache/fop/fo/pagination/Root.java b/src/java/org/apache/fop/fo/pagination/Root.java
index c670d6e42..6df6e9537 100644
--- a/src/java/org/apache/fop/fo/pagination/Root.java
+++ b/src/java/org/apache/fop/fo/pagination/Root.java
@@ -21,6 +21,7 @@ package org.apache.fop.fo.pagination;
// java
import java.util.List;
+import java.util.Locale;
import org.xml.sax.Locator;
@@ -52,6 +53,7 @@ public class Root extends FObj implements CommonAccessibilityHolder {
private BookmarkTree bookmarkTree = null;
private List<Destination> destinationList;
private List<PageSequence> pageSequences;
+ private Locale locale;
// temporary until above list populated
private boolean pageSequenceFound = false;
@@ -88,6 +90,24 @@ public class Root extends FObj implements CommonAccessibilityHolder {
super.bind(pList);
commonAccessibility = CommonAccessibility.getInstance(pList);
mediaUsage = pList.get(PR_MEDIA_USAGE).getEnum();
+ String language = pList.get(PR_LANGUAGE).getString();
+ String country = pList.get(PR_COUNTRY).getString();
+ if (isLocalePropertySet(language)) {
+ if (isLocalePropertySet(country)) {
+ locale = new Locale(language, country);
+ } else {
+ locale = new Locale(language);
+ }
+ }
+ }
+
+ private boolean isLocalePropertySet(String property) {
+ return property != null && !property.equals("none");
+ }
+
+ /** {@inheritDoc} */
+ protected void startOfNode() throws FOPException {
+ foEventHandler.startRoot(this);
}
/** {@inheritDoc} */
@@ -96,6 +116,7 @@ public class Root extends FObj implements CommonAccessibilityHolder {
missingChildElementError("(layout-master-set, declarations?, "
+ "bookmark-tree?, (page-sequence|fox:external-document)+)");
}
+ foEventHandler.endRoot(this);
}
/**
@@ -343,4 +364,9 @@ public class Root extends FObj implements CommonAccessibilityHolder {
return FO_ROOT;
}
+
+ public Locale getLocale() {
+ return locale;
+ }
+
}