Author: jeremias
Date: Thu Apr 16 09:06:04 2009
New Revision: 765522
URL: http://svn.apache.org/viewvc?rev=765522&view=rev
Log:
Introduced the StructurePointerPropertySet interface to aid with accessing the
structure pointer uniformly (similar to BreakPropertySet).
Getting null as the pointer in TextLayoutManager should not be a reason for a
warning anymore. A null value can simply indicate that the text is part of a
leader which is treated as a painting artifact during rendering.
Added:
xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/properties/StructurePointerPropertySet.java
(with props)
Modified:
xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/flow/AbstractGraphics.java
xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/flow/AbstractPageNumberCitation.java
xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/flow/BasicLink.java
xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/flow/Block.java
xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/flow/Character.java
xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/flow/Inline.java
xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/flow/PageNumber.java
xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/flow/table/TableFObj.java
xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java
Modified:
xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/flow/AbstractGraphics.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/flow/AbstractGraphics.java?rev=765522&r1=765521&r2=765522&view=diff
==============================================================================
---
xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/flow/AbstractGraphics.java
(original)
+++
xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/flow/AbstractGraphics.java
Thu Apr 16 09:06:04 2009
@@ -29,6 +29,7 @@
import org.apache.fop.fo.properties.KeepProperty;
import org.apache.fop.fo.properties.LengthRangeProperty;
import org.apache.fop.fo.properties.SpaceProperty;
+import org.apache.fop.fo.properties.StructurePointerPropertySet;
/**
* Common base class for the <a
href="http://www.w3.org/TR/xsl/#fo_instream-foreign-object">
@@ -36,7 +37,8 @@
* and <a href="http://www.w3.org/TR/xsl/#fo_external-graphic">
* <code>fo:external-graphic</code></a> flow formatting objects.
*/
-public abstract class AbstractGraphics extends FObj implements
GraphicsProperties {
+public abstract class AbstractGraphics extends FObj
+ implements GraphicsProperties, StructurePointerPropertySet {
// The value of properties relevant for fo:instream-foreign-object
// and external-graphics.
@@ -209,7 +211,7 @@
return keepWithPrevious;
}
- /** @return the "foi:ptr" property. */
+ /** {...@inheritdoc} */
public String getPtr() {
return ptr;
}
Modified:
xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/flow/AbstractPageNumberCitation.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/flow/AbstractPageNumberCitation.java?rev=765522&r1=765521&r2=765522&view=diff
==============================================================================
---
xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/flow/AbstractPageNumberCitation.java
(original)
+++
xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/flow/AbstractPageNumberCitation.java
Thu Apr 16 09:06:04 2009
@@ -21,8 +21,8 @@
import java.awt.Color;
-import org.xml.sax.Locator;
import org.xml.sax.Attributes;
+import org.xml.sax.Locator;
import org.apache.fop.apps.FOPException;
import org.apache.fop.datatypes.Length;
@@ -35,6 +35,7 @@
import org.apache.fop.fo.properties.CommonFont;
import org.apache.fop.fo.properties.CommonTextDecoration;
import org.apache.fop.fo.properties.SpaceProperty;
+import org.apache.fop.fo.properties.StructurePointerPropertySet;
/**
* Common base class for the <a
href="http://www.w3.org/TR/xsl/#fo_page-number-citation">
@@ -42,7 +43,8 @@
* <a href="http://www.w3.org/TR/xsl/#fo_page-number-citation-last">
* <code>fo:page-number-citation-last</code></a> objects.
*/
-public abstract class AbstractPageNumberCitation extends FObj {
+public abstract class AbstractPageNumberCitation extends FObj
+ implements StructurePointerPropertySet {
// The value of properties relevant for fo:page-number-citation(-last).
private CommonBorderPaddingBackground commonBorderPaddingBackground;
@@ -140,11 +142,11 @@
return textDecoration;
}
- /** @return the "foi:ptr" property. */
+ /** {...@inheritdoc} */
public String getPtr() {
return ptr;
}
-
+
/** @return the "alignment-adjust" property */
public Length getAlignmentAdjust() {
return alignmentAdjust;
Modified:
xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/flow/BasicLink.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/flow/BasicLink.java?rev=765522&r1=765521&r2=765522&view=diff
==============================================================================
---
xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/flow/BasicLink.java
(original)
+++
xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/flow/BasicLink.java
Thu Apr 16 09:06:04 2009
@@ -159,11 +159,6 @@
return this.showDestination;
}
- /** @return the "foi:ptr" property. */
- public String getPtr() {
- return super.getPtr();
- }
-
/** {...@inheritdoc} */
public String getLocalName() {
return "basic-link";
Modified:
xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/flow/Block.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/flow/Block.java?rev=765522&r1=765521&r2=765522&view=diff
==============================================================================
---
xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/flow/Block.java
(original)
+++
xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/flow/Block.java
Thu Apr 16 09:06:04 2009
@@ -21,6 +21,8 @@
import java.awt.Color;
+import org.xml.sax.Locator;
+
import org.apache.fop.apps.FOPException;
import org.apache.fop.datatypes.Length;
import org.apache.fop.datatypes.Numeric;
@@ -38,13 +40,13 @@
import org.apache.fop.fo.properties.CommonRelativePosition;
import org.apache.fop.fo.properties.KeepProperty;
import org.apache.fop.fo.properties.SpaceProperty;
-import org.xml.sax.Locator;
+import org.apache.fop.fo.properties.StructurePointerPropertySet;
/**
* Class modelling the <a href="http://www.w3.org/TR/xsl/#fo_block">
* <code>fo:block object</code></a>.
*/
-public class Block extends FObjMixed implements BreakPropertySet {
+public class Block extends FObjMixed implements BreakPropertySet,
StructurePointerPropertySet {
// used for FO validation
private boolean blockOrInlineItemFound = false;
@@ -173,11 +175,11 @@
return breakAfter;
}
- /** @return the "foi:ptr" property. */
+ /** {...@inheritdoc} */
public String getPtr() {
return ptr;
}
-
+
/** @return the "break-before" property. */
public int getBreakBefore() {
return breakBefore;
Modified:
xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/flow/Character.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/flow/Character.java?rev=765522&r1=765521&r2=765522&view=diff
==============================================================================
---
xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/flow/Character.java
(original)
+++
xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/flow/Character.java
Thu Apr 16 09:06:04 2009
@@ -38,12 +38,13 @@
import org.apache.fop.fo.properties.KeepProperty;
import org.apache.fop.fo.properties.Property;
import org.apache.fop.fo.properties.SpaceProperty;
+import org.apache.fop.fo.properties.StructurePointerPropertySet;
/**
* Class modelling the <a href="http://www.w3.org/TR/xsl/#fo_character">
* <code>fo:character</code></a> object.
*/
-public class Character extends FObj {
+public class Character extends FObj implements StructurePointerPropertySet {
// The value of properties relevant for fo:character.
private CommonBorderPaddingBackground commonBorderPaddingBackground;
private CommonFont commonFont;
@@ -209,7 +210,7 @@
return keepWithPrevious;
}
- /** @return the "foi:ptr" property. */
+ /** {...@inheritdoc} */
public String getPtr() {
return ptr;
}
Modified:
xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/flow/Inline.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/flow/Inline.java?rev=765522&r1=765521&r2=765522&view=diff
==============================================================================
---
xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/flow/Inline.java
(original)
+++
xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/flow/Inline.java
Thu Apr 16 09:06:04 2009
@@ -26,12 +26,13 @@
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.PropertyList;
import org.apache.fop.fo.ValidationException;
+import org.apache.fop.fo.properties.StructurePointerPropertySet;
/**
* Class modelling the <a href="http://www.w3.org/TR/xsl/#fo_inline">
* <code>fo:inline</code></a> formatting object.
*/
-public class Inline extends InlineLevel {
+public class Inline extends InlineLevel implements StructurePointerPropertySet
{
// The value of properties relevant for fo:inline.
// See also superclass InlineLevel
private Length alignmentAdjust;
@@ -146,7 +147,7 @@
return dominantBaseline;
}
- /** @return the "foi:ptr" property. */
+ /** {...@inheritdoc} */
public String getPtr() {
return ptr;
}
Modified:
xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/flow/PageNumber.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/flow/PageNumber.java?rev=765522&r1=765521&r2=765522&view=diff
==============================================================================
---
xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/flow/PageNumber.java
(original)
+++
xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/flow/PageNumber.java
Thu Apr 16 09:06:04 2009
@@ -34,12 +34,13 @@
import org.apache.fop.fo.properties.CommonFont;
import org.apache.fop.fo.properties.CommonTextDecoration;
import org.apache.fop.fo.properties.SpaceProperty;
+import org.apache.fop.fo.properties.StructurePointerPropertySet;
/**
* Class modelling the <a href="http://www.w3.org/TR/xsl/#fo_page-number">
* <code>fo:page-number</code></a> object.
*/
-public class PageNumber extends FObj {
+public class PageNumber extends FObj implements StructurePointerPropertySet {
// The value of properties relevant for fo:page-number.
private CommonBorderPaddingBackground commonBorderPaddingBackground;
private CommonFont commonFont;
@@ -167,7 +168,7 @@
return lineHeight;
}
- /** @return the "foi:ptr" property. */
+ /** {...@inheritdoc} */
public String getPtr() {
return ptr;
}
Modified:
xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/flow/table/TableFObj.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/flow/table/TableFObj.java?rev=765522&r1=765521&r2=765522&view=diff
==============================================================================
---
xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/flow/table/TableFObj.java
(original)
+++
xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/flow/table/TableFObj.java
Thu Apr 16 09:06:04 2009
@@ -19,6 +19,9 @@
package org.apache.fop.fo.flow.table;
+import org.xml.sax.Attributes;
+import org.xml.sax.Locator;
+
import org.apache.fop.apps.FOPException;
import org.apache.fop.datatypes.Numeric;
import org.apache.fop.datatypes.ValidationPercentBaseContext;
@@ -33,14 +36,13 @@
import org.apache.fop.fo.properties.NumberProperty;
import org.apache.fop.fo.properties.Property;
import org.apache.fop.fo.properties.PropertyMaker;
+import org.apache.fop.fo.properties.StructurePointerPropertySet;
import org.apache.fop.layoutmgr.table.CollapsingBorderModel;
-import org.xml.sax.Locator;
-import org.xml.sax.Attributes;
/**
* Common base class for table-related FOs
*/
-public abstract class TableFObj extends FObj {
+public abstract class TableFObj extends FObj implements
StructurePointerPropertySet {
private Numeric borderAfterPrecedence;
private Numeric borderBeforePrecedence;
@@ -237,11 +239,11 @@
}
}
- /** @return the "foi:ptr" property. */
+ /** {...@inheritdoc} */
public String getPtr() {
return ptr;
}
-
+
/**
* Prepares the borders of this element if the collapsing-border model is
in use.
* Conflict resolution with parent elements is done where applicable.
Added:
xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/properties/StructurePointerPropertySet.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/properties/StructurePointerPropertySet.java?rev=765522&view=auto
==============================================================================
---
xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/properties/StructurePointerPropertySet.java
(added)
+++
xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/properties/StructurePointerPropertySet.java
Thu Apr 16 09:06:04 2009
@@ -0,0 +1,34 @@
+/*
+ * 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.properties;
+
+/**
+ * Defines property access methods for internal structure pointer extension
properties.
+ */
+public interface StructurePointerPropertySet {
+
+ /**
+ * Returns the value of the "foi:ptr" property, the internal structure
pointer used
+ * for tagged PDF and other formats that support a structure tree in
addition to paged content.
+ * @return the "foi:ptr" property
+ */
+ String getPtr();
+
+}
Propchange:
xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/properties/StructurePointerPropertySet.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/fo/properties/StructurePointerPropertySet.java
------------------------------------------------------------------------------
svn:keywords = Id
Modified:
xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java
URL:
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java?rev=765522&r1=765521&r2=765522&view=diff
==============================================================================
---
xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java
(original)
+++
xmlgraphics/fop/branches/Temp_Accessibility/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java
Thu Apr 16 09:06:04 2009
@@ -31,6 +31,7 @@
import org.apache.fop.fo.Constants;
import org.apache.fop.fo.FOText;
import org.apache.fop.fo.FObj;
+import org.apache.fop.fo.properties.StructurePointerPropertySet;
import org.apache.fop.fonts.Font;
import org.apache.fop.fonts.FontSelector;
import org.apache.fop.layoutmgr.InlineKnuthSequence;
@@ -518,13 +519,11 @@
*/
private String getPtr() {
FObj fobj = this.parentLM.getFObj();
- if (fobj instanceof org.apache.fop.fo.flow.Block) {
- return (((org.apache.fop.fo.flow.Block) fobj).getPtr());
- } else if (fobj instanceof org.apache.fop.fo.flow.Inline) {
- return (((org.apache.fop.fo.flow.Inline) fobj).getPtr());
+ if (fobj instanceof StructurePointerPropertySet) {
+ return (((StructurePointerPropertySet) fobj).getPtr());
} else {
- log.warn("Accessibility: TLM.getPtr-no Ptr found");
- return "";
+ //No structure pointer applicable
+ return null;
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]