aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/pdf/PDFStructTreeRoot.java
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2009-02-19 18:04:18 +0000
committerJeremias Maerki <jeremias@apache.org>2009-02-19 18:04:18 +0000
commit223eb5df1f7597ac5269eb8dce45b6a7450144b8 (patch)
treeb6475383dd7fca2a53402b19d22b682276d8d6d1 /src/java/org/apache/fop/pdf/PDFStructTreeRoot.java
parent51c210eea6bf627053854359388c1ad14203c0aa (diff)
downloadxmlgraphics-fop-223eb5df1f7597ac5269eb8dce45b6a7450144b8.tar.gz
xmlgraphics-fop-223eb5df1f7597ac5269eb8dce45b6a7450144b8.zip
Bugzilla #46705:
Accessibility and Tagged PDF Support Submitted by: Jost Klopfstein <jost.klopfstein.at.gmail.com> Changes to patch by jeremias: - Some style fixes - Various simplifications - Removal of dead code - Addressed some issues raised in Bugzilla (work in progress) - Fixed a couple of bugs on leader handling detected while testing (an NPE remains in leader_leader-pattern_use-content.xml) git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_Accessibility@745949 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/pdf/PDFStructTreeRoot.java')
-rw-r--r--src/java/org/apache/fop/pdf/PDFStructTreeRoot.java67
1 files changed, 67 insertions, 0 deletions
diff --git a/src/java/org/apache/fop/pdf/PDFStructTreeRoot.java b/src/java/org/apache/fop/pdf/PDFStructTreeRoot.java
new file mode 100644
index 000000000..e530b1582
--- /dev/null
+++ b/src/java/org/apache/fop/pdf/PDFStructTreeRoot.java
@@ -0,0 +1,67 @@
+/*
+ * 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.pdf;
+
+/**
+ * Class representing a PDF /StructTreeRoot dictionary.
+ */
+public class PDFStructTreeRoot extends PDFDictionary {
+
+ /**
+ * Create the /StructTreeRoot dictionary.
+ */
+ public PDFStructTreeRoot() {
+ super();
+ put("Type", new PDFName("StructTreeRoot"));
+ put("K", new PDFArray());
+ }
+
+ /**
+ * Add parentTree entry.
+ * @param parentTree to be added
+ */
+ public void addParentTree(PDFParentTree parentTree) {
+ put("ParentTree", parentTree);
+ }
+
+ /**
+ * Get the kids.
+ * @return the kids
+ */
+ public PDFArray getKids() {
+ return (PDFArray)get("K");
+ }
+
+ /**
+ * Returns the first child of the kids array (normally the structure tree root element)
+ * @return the first child
+ */
+ public PDFObject getFirstChild() {
+ return (PDFObject)getKids().get(0);
+ }
+
+ /**
+ * Adds a kid.
+ * @param kid to be added
+ */
+ public void addKid(PDFObject kid) {
+ getKids().add(kid);
+ }
+} \ No newline at end of file