From 4a2e8e12cb9965439ce41c405a516337a2162e43 Mon Sep 17 00:00:00 2001 From: Glenn Adams Date: Mon, 4 Jun 2012 06:04:00 +0000 Subject: [PATCH] Merge from origin/trunk. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/fop-1_1rc1@1345839 13f79535-47bb-0310-9956-ffa450edef68 --- .../fop/accessibility/Accessibility.java | 6 ++ .../fo/FO2StructureTreeConverter.java | 25 +++++ .../org/apache/fop/afp/AFPGraphics2D.java | 4 +- .../org/apache/fop/afp/modca/ImageObject.java | 6 +- .../fop/afp/modca/PresentationTextData.java | 2 +- .../afp/util/DefaultFOPResourceAccessor.java | 3 +- src/java/org/apache/fop/apps/FOUserAgent.java | 5 +- .../fonts/GlyphPositioningTable.java | 2 +- .../scripts/IndicScriptProcessor.java | 2 +- .../org/apache/fop/fo/FOEventHandler.java | 14 ++- src/java/org/apache/fop/fo/flow/Wrapper.java | 19 +++- .../BalancingColumnBreakingAlgorithm.java | 16 +-- .../apache/fop/layoutmgr/BreakElement.java | 34 ++++-- .../apache/fop/layoutmgr/KnuthPenalty.java | 7 +- src/java/org/apache/fop/pdf/PDFColor.java | 2 +- .../org/apache/fop/pdf/PDFEmbeddedFile.java | 5 +- src/java/org/apache/fop/pdf/PDFObject.java | 6 -- src/java/org/apache/fop/pdf/PDFResources.java | 54 +++++----- .../org/apache/fop/render/ImageHandler.java | 3 +- .../fop/render/afp/AFPDocumentHandler.java | 3 +- .../afp/extensions/AFPIncludeFormMap.java | 2 +- .../extensions/AFPIncludeFormMapElement.java | 4 +- .../render/afp/extensions/AFPPageOverlay.java | 2 +- .../bitmap/AbstractBitmapDocumentHandler.java | 3 +- .../fop/render/bitmap/PNGDocumentHandler.java | 3 +- .../render/bitmap/TIFFDocumentHandler.java | 3 +- .../fop/render/intermediate/IFContext.java | 4 +- .../fop/render/intermediate/IFUtil.java | 8 +- .../java2d/CustomFontMetricsMapper.java | 2 +- .../fop/render/java2d/Java2DPainter.java | 3 +- .../fop/render/pcl/PCLDocumentHandler.java | 3 +- .../org/apache/fop/render/pcl/PCLPainter.java | 3 +- .../fop/render/ps/NativeTextHandler.java | 6 -- .../fop/render/ps/PSDocumentHandler.java | 3 +- .../org/apache/fop/svg/PDFAElementBridge.java | 2 +- src/java/org/apache/fop/traits/MinOptMax.java | 5 +- src/java/org/apache/fop/traits/TraitEnum.java | 4 +- src/java/org/apache/fop/util/ColorExt.java | 2 +- .../org/apache/fop/render/mif/MIFHandler.java | 60 +++++++---- .../fop/render/svg/SVGDocumentHandler.java | 3 +- .../render/svg/SVGPrintDocumentHandler.java | 3 +- status.xml | 12 +++ .../fo/FO2StructureTreeConverterTestCase.java | 15 ++- .../apache/fop/accessibility/fo/artifact.fo | 97 ++++++++++++++++++ .../fop/accessibility/fo/fo2StructureTree.xsl | 2 + test/pdf/accessibility/pdf/role.pdf | Bin 19023 -> 18600 bytes test/pdf/accessibility/role.fo | 4 +- 47 files changed, 342 insertions(+), 134 deletions(-) create mode 100644 test/java/org/apache/fop/accessibility/fo/artifact.fo diff --git a/src/java/org/apache/fop/accessibility/Accessibility.java b/src/java/org/apache/fop/accessibility/Accessibility.java index c842cf43f..88ec6dbdd 100644 --- a/src/java/org/apache/fop/accessibility/Accessibility.java +++ b/src/java/org/apache/fop/accessibility/Accessibility.java @@ -28,6 +28,12 @@ public final class Accessibility { /** Constant string for the rendering options key to enable accessibility features. */ public static final String ACCESSIBILITY = "accessibility"; + /** + * The value to be set on the 'role' property for the element and its descendants to + * be considered as artifacts. + */ + public static final String ROLE_ARTIFACT = "artifact"; + private Accessibility() { } } diff --git a/src/java/org/apache/fop/accessibility/fo/FO2StructureTreeConverter.java b/src/java/org/apache/fop/accessibility/fo/FO2StructureTreeConverter.java index 47c227e9a..27469d6e0 100644 --- a/src/java/org/apache/fop/accessibility/fo/FO2StructureTreeConverter.java +++ b/src/java/org/apache/fop/accessibility/fo/FO2StructureTreeConverter.java @@ -23,6 +23,7 @@ import java.util.Stack; import org.xml.sax.SAXException; +import org.apache.fop.accessibility.Accessibility; import org.apache.fop.accessibility.StructureTreeEventHandler; import org.apache.fop.fo.DelegatingFOEventHandler; import org.apache.fop.fo.FOEventHandler; @@ -57,6 +58,8 @@ import org.apache.fop.fo.pagination.Flow; import org.apache.fop.fo.pagination.PageSequence; import org.apache.fop.fo.pagination.Root; import org.apache.fop.fo.pagination.StaticContent; +import org.apache.fop.fo.properties.CommonAccessibility; +import org.apache.fop.fo.properties.CommonAccessibilityHolder; /** * Allows to create the structure tree of an FO document, by converting FO @@ -355,6 +358,7 @@ public class FO2StructureTreeConverter extends DelegatingFOEventHandler { @Override public void startStatic(StaticContent staticContent) { + handleStartArtifact(staticContent); converter.startStatic(staticContent); super.startStatic(staticContent); } @@ -362,6 +366,7 @@ public class FO2StructureTreeConverter extends DelegatingFOEventHandler { @Override public void endStatic(StaticContent statisContent) { converter.endStatic(statisContent); + handleEndArtifact(statisContent); super.endStatic(statisContent); } @@ -454,6 +459,7 @@ public class FO2StructureTreeConverter extends DelegatingFOEventHandler { @Override public void startWrapper(Wrapper wrapper) { + handleStartArtifact(wrapper); converter.startWrapper(wrapper); super.startWrapper(wrapper); } @@ -461,6 +467,7 @@ public class FO2StructureTreeConverter extends DelegatingFOEventHandler { @Override public void endWrapper(Wrapper wrapper) { converter.endWrapper(wrapper); + handleEndArtifact(wrapper); super.endWrapper(wrapper); } @@ -488,4 +495,22 @@ public class FO2StructureTreeConverter extends DelegatingFOEventHandler { super.endExternalDocument(document); } + private void handleStartArtifact(CommonAccessibilityHolder fobj) { + if (isArtifact(fobj)) { + converters.push(converter); + converter = eventSwallower; + } + } + + private void handleEndArtifact(CommonAccessibilityHolder fobj) { + if (isArtifact(fobj)) { + converter = converters.pop(); + } + } + + private boolean isArtifact(CommonAccessibilityHolder fobj) { + CommonAccessibility accessibility = fobj.getCommonAccessibility(); + return Accessibility.ROLE_ARTIFACT.equalsIgnoreCase(accessibility.getRole()); + } + } diff --git a/src/java/org/apache/fop/afp/AFPGraphics2D.java b/src/java/org/apache/fop/afp/AFPGraphics2D.java index e9a269ac4..7172b0ee3 100644 --- a/src/java/org/apache/fop/afp/AFPGraphics2D.java +++ b/src/java/org/apache/fop/afp/AFPGraphics2D.java @@ -67,7 +67,7 @@ import org.apache.fop.svg.NativeImageHandler; /** * This is a concrete implementation of {@link AbstractGraphics2D} (and - * therefore of {@link Graphics2D}) which is able to generate GOCA byte + * therefore of {@link java.awt.Graphics2D}) which is able to generate GOCA byte * codes. * * @see org.apache.xmlgraphics.java2d.AbstractGraphics2D @@ -165,7 +165,7 @@ public class AFPGraphics2D extends AbstractGraphics2D implements NativeImageHand } /** - * Returns the AFP resource manager associated with this {@link Graphics2D} instance. + * Returns the AFP resource manager associated with this {@link java.awt.Graphics2D} instance. * @return the resource manager */ public AFPResourceManager getResourceManager() { diff --git a/src/java/org/apache/fop/afp/modca/ImageObject.java b/src/java/org/apache/fop/afp/modca/ImageObject.java index adb56e626..e42639248 100644 --- a/src/java/org/apache/fop/afp/modca/ImageObject.java +++ b/src/java/org/apache/fop/afp/modca/ImageObject.java @@ -119,7 +119,8 @@ public class ImageObject extends AbstractDataObject { * Sets the image IDE color model. * * @param colorModel the IDE color model. - * @deprecated Use {@link IDEStructureParameter#setColorModel(byte)} instead. + * @deprecated Use {@link org.apache.fop.afp.ioca.IDEStructureParameter#setColorModel(byte)} + * instead. */ public void setIDEColorModel(byte colorModel) { getImageSegment().setIDEColorModel(colorModel); @@ -128,7 +129,8 @@ public class ImageObject extends AbstractDataObject { /** * Set either additive or subtractive mode (used for ASFLAG). * @param subtractive true for subtractive mode, false for additive mode - * @deprecated Use {@link IDEStructureParameter#setSubtractive(boolean)} instead. + * @deprecated Use {@link org.apache.fop.afp.ioca.IDEStructureParameter#setSubtractive(boolean)} + * instead. */ public void setSubtractive(boolean subtractive) { getImageSegment().setSubtractive(subtractive); diff --git a/src/java/org/apache/fop/afp/modca/PresentationTextData.java b/src/java/org/apache/fop/afp/modca/PresentationTextData.java index b68131413..c0934b1e5 100644 --- a/src/java/org/apache/fop/afp/modca/PresentationTextData.java +++ b/src/java/org/apache/fop/afp/modca/PresentationTextData.java @@ -46,7 +46,7 @@ import org.apache.fop.afp.util.BinaryUtils; * which signal an alternate mode of processing for the content of the current * Presentation Text data. *

- * The content for this object can be created using {@link PtocaBuilder}. + * The content for this object can be created using {@link org.apache.fop.afp.ptoca.PtocaBuilder}. */ public class PresentationTextData extends AbstractAFPObject implements PtocaConstants { diff --git a/src/java/org/apache/fop/afp/util/DefaultFOPResourceAccessor.java b/src/java/org/apache/fop/afp/util/DefaultFOPResourceAccessor.java index f379546e2..2872976b6 100644 --- a/src/java/org/apache/fop/afp/util/DefaultFOPResourceAccessor.java +++ b/src/java/org/apache/fop/afp/util/DefaultFOPResourceAccessor.java @@ -44,7 +44,8 @@ public class DefaultFOPResourceAccessor extends SimpleResourceAccessor { * Constructor for resource to be accessed via the {@link FOUserAgent}. This contructor * can take two base URIs: the category base URI is the one to use when differentiating between * normal resources (ex. images) and font resources. So, if fonts need to be accessed, you can - * set the {@link FontManager}'s base URI instead of the one on the {@link FopFactory}. + * set the {@link org.apache.fop.fonts.FontManager}'s base URI instead of the one on the + * {@link org.apache.fop.apps.FopFactory}. * @param userAgent the FO user agent * @param categoryBaseURI the category base URI (may be null) * @param baseURI the custom base URI to resolve relative URIs against (may be null) diff --git a/src/java/org/apache/fop/apps/FOUserAgent.java b/src/java/org/apache/fop/apps/FOUserAgent.java index 665c1abf8..035b6f1a1 100644 --- a/src/java/org/apache/fop/apps/FOUserAgent.java +++ b/src/java/org/apache/fop/apps/FOUserAgent.java @@ -355,7 +355,7 @@ public class FOUserAgent { /** * Sets font base URL. * @param fontBaseUrl font base URL - * @deprecated Use {@link FontManager#setFontBaseURL(String)} instead. + * @deprecated Use {@link org.apache.fop.fonts.FontManager#setFontBaseURL(String)} instead. */ public void setFontBaseURL(String fontBaseUrl) { try { @@ -500,7 +500,8 @@ public class FOUserAgent { /** * Returns the font base URL. * @return the font base URL - * @deprecated Use {@link FontManager#getFontBaseURL()} instead. This method is not used by FOP. + * @deprecated Use {@link org.apache.fop.fonts.FontManager#getFontBaseURL()} instead. + * This method is not used by FOP. */ public String getFontBaseURL() { String fontBase = getFactory().getFontManager().getFontBaseURL(); diff --git a/src/java/org/apache/fop/complexscripts/fonts/GlyphPositioningTable.java b/src/java/org/apache/fop/complexscripts/fonts/GlyphPositioningTable.java index 3b7c14b0e..6db6be726 100644 --- a/src/java/org/apache/fop/complexscripts/fonts/GlyphPositioningTable.java +++ b/src/java/org/apache/fop/complexscripts/fonts/GlyphPositioningTable.java @@ -1783,9 +1783,9 @@ public class GlyphPositioningTable extends GlyphTable { * Find device adjustment. * @param fontSize the font size to search for * @return an adjustment if font size matches an entry - * @asf.todo at present, assumes that 1 device unit equals one point */ public int findAdjustment ( int fontSize ) { + // [TODO] at present, assumes that 1 device unit equals one point int fs = fontSize / 1000; if ( fs < startSize ) { return 0; diff --git a/src/java/org/apache/fop/complexscripts/scripts/IndicScriptProcessor.java b/src/java/org/apache/fop/complexscripts/scripts/IndicScriptProcessor.java index ce4585828..26249bc22 100644 --- a/src/java/org/apache/fop/complexscripts/scripts/IndicScriptProcessor.java +++ b/src/java/org/apache/fop/complexscripts/scripts/IndicScriptProcessor.java @@ -360,7 +360,7 @@ public class IndicScriptProcessor extends DefaultScriptProcessor { } /** Abstract syllabizer. */ - protected abstract static class Syllabizer { + protected abstract static class Syllabizer implements Comparable { private String script; private String language; Syllabizer ( String script, String language ) { diff --git a/src/java/org/apache/fop/fo/FOEventHandler.java b/src/java/org/apache/fop/fo/FOEventHandler.java index 743708b72..11b6d4a2f 100644 --- a/src/java/org/apache/fop/fo/FOEventHandler.java +++ b/src/java/org/apache/fop/fo/FOEventHandler.java @@ -123,11 +123,17 @@ public abstract class FOEventHandler { public void endDocument() throws SAXException { } - /** {@inheritDoc} */ + /** + * Called upon start of root element. + * @param root element + */ public void startRoot(Root root) { } - /** {@inheritDoc} */ + /** + * Called upon end of root element. + * @param root element + */ public void endRoot(Root root) { } @@ -413,9 +419,9 @@ public abstract class FOEventHandler { /** * Process end of a Static. - * @param statisContent StaticContent that is ending + * @param staticContent StaticContent that is ending */ - public void endStatic(StaticContent statisContent) { + public void endStatic(StaticContent staticContent) { } diff --git a/src/java/org/apache/fop/fo/flow/Wrapper.java b/src/java/org/apache/fop/fo/flow/Wrapper.java index 1302e3134..0aec7ce16 100644 --- a/src/java/org/apache/fop/fo/flow/Wrapper.java +++ b/src/java/org/apache/fop/fo/flow/Wrapper.java @@ -26,7 +26,10 @@ import org.apache.fop.fo.Constants; import org.apache.fop.fo.FONode; import org.apache.fop.fo.FOText; import org.apache.fop.fo.FObjMixed; +import org.apache.fop.fo.PropertyList; import org.apache.fop.fo.ValidationException; +import org.apache.fop.fo.properties.CommonAccessibility; +import org.apache.fop.fo.properties.CommonAccessibilityHolder; /** * Class modelling the @@ -34,13 +37,13 @@ import org.apache.fop.fo.ValidationException; * The fo:wrapper object serves as a property holder for * its child node objects. */ -public class Wrapper extends FObjMixed { - // The value of properties relevant for fo:wrapper. - // End of property values +public class Wrapper extends FObjMixed implements CommonAccessibilityHolder { // used for FO validation private boolean blockOrInlineItemFound = false; + private CommonAccessibility commonAccessibility; + /** * Create a Wrapper instance that is a child of the * given {@link FONode} @@ -51,6 +54,12 @@ public class Wrapper extends FObjMixed { super(parent); } + @Override + public void bind(PropertyList pList) throws FOPException { + super.bind(pList); + commonAccessibility = CommonAccessibility.getInstance(pList); + } + @Override protected void startOfNode() throws FOPException { super.startOfNode(); @@ -136,6 +145,10 @@ public class Wrapper extends FObjMixed { return FO_WRAPPER; } + public CommonAccessibility getCommonAccessibility() { + return commonAccessibility; + } + @Override public boolean isDelimitedTextRangeBoundary ( int boundary ) { return false; diff --git a/src/java/org/apache/fop/layoutmgr/BalancingColumnBreakingAlgorithm.java b/src/java/org/apache/fop/layoutmgr/BalancingColumnBreakingAlgorithm.java index 2bcdb6127..03c159843 100644 --- a/src/java/org/apache/fop/layoutmgr/BalancingColumnBreakingAlgorithm.java +++ b/src/java/org/apache/fop/layoutmgr/BalancingColumnBreakingAlgorithm.java @@ -41,12 +41,16 @@ public class BalancingColumnBreakingAlgorithm extends PageBreakingAlgorithm { * @param topLevelLM the top level layout manager * @param pageProvider the page provider * @param layoutListener the layout listener - * @param alignment alignment of the paragraph/page. One of {@link Constants#EN_START}, - * {@link Constants#EN_JUSTIFY}, {@link Constants#EN_CENTER}, - * {@link Constants#EN_END}. - * For pages, {@link Constants#EN_BEFORE} and {@link Constants#EN_AFTER} - * are mapped to the corresponding inline properties, - * {@link Constants#EN_START} and {@link Constants#EN_END}. + * @param alignment alignment of the paragraph/page. One of + * {@link org.apache.fop.fo.Constants#EN_START}, + * {@link org.apache.fop.fo.Constants#EN_JUSTIFY}, + * {@link org.apache.fop.fo.Constants#EN_CENTER}, + * {@link org.apache.fop.fo.Constants#EN_END}. + * For pages, {@link org.apache.fop.fo.Constants#EN_BEFORE} and + * {@link org.apache.fop.fo.Constants#EN_AFTER} + * are mapped to the corresponding inline properties, + * {@link org.apache.fop.fo.Constants#EN_START} and + * {@link org.apache.fop.fo.Constants#EN_END}. * @param alignmentLast alignment of the paragraph's last line * @param footnoteSeparatorLength length of footnote separator * @param partOverflowRecovery {@code true} if too long elements should be moved to diff --git a/src/java/org/apache/fop/layoutmgr/BreakElement.java b/src/java/org/apache/fop/layoutmgr/BreakElement.java index 1c89c2009..77e7f140b 100644 --- a/src/java/org/apache/fop/layoutmgr/BreakElement.java +++ b/src/java/org/apache/fop/layoutmgr/BreakElement.java @@ -46,8 +46,11 @@ public class BreakElement extends UnresolvedListElement { * Create a new BreakElement for the given {@code position}, {@code penaltyValue} * and {@code breakClass}. (Used principally to generate break-possibilities in * ranges of content that must be kept together within the context corresponding - * to the {@code breakClass}; expected to be one of {@link Constants#EN_AUTO}, - * {@link Constants#EN_LINE}, {@link Constants#EN_COLUMN} or {@link Constants#EN_PAGE}) + * to the {@code breakClass}; expected to be one of + * {@link org.apache.fop.fo.Constants#EN_AUTO}, + * {@link org.apache.fop.fo.Constants#EN_LINE}, + * {@link org.apache.fop.fo.Constants#EN_COLUMN} or + * {@link org.apache.fop.fo.Constants#EN_PAGE}) * @param position the corresponding {@link Position} * @param penaltyValue the penalty value * @param breakClass the break class @@ -64,9 +67,12 @@ public class BreakElement extends UnresolvedListElement { * @param position the Position instance needed by the addAreas stage of the LMs. * @param penaltyWidth the penalty width * @param penaltyValue the penalty value for the penalty element to be constructed - * @param breakClass the break class of this penalty (one of {@link Constants#EN_AUTO}, - * {@link Constants#EN_COLUMN}, {@link Constants#EN_PAGE}, - * {@link Constants#EN_EVEN_PAGE}, {@link Constants#EN_ODD_PAGE}) + * @param breakClass the break class of this penalty (one of + * {@link org.apache.fop.fo.Constants#EN_AUTO}, + * {@link org.apache.fop.fo.Constants#EN_COLUMN}, + * {@link org.apache.fop.fo.Constants#EN_PAGE}, + * {@link org.apache.fop.fo.Constants#EN_EVEN_PAGE}, + * {@link org.apache.fop.fo.Constants#EN_ODD_PAGE}) * @param context the layout context which contains the pending conditional elements */ public BreakElement(Position position, int penaltyWidth, int penaltyValue, @@ -120,9 +126,12 @@ public class BreakElement extends UnresolvedListElement { /** * Returns the break class of this penalty. * - * @return one of {@link Constants#EN_AUTO}, {@link Constants#EN_COLUMN}, - * {@link Constants#EN_PAGE}, {@link Constants#EN_EVEN_PAGE}, - * {@link Constants#EN_ODD_PAGE} + * @return one of + * {@link org.apache.fop.fo.Constants#EN_AUTO}, + * {@link org.apache.fop.fo.Constants#EN_COLUMN}, + * {@link org.apache.fop.fo.Constants#EN_PAGE}, + * {@link org.apache.fop.fo.Constants#EN_EVEN_PAGE}, + * {@link org.apache.fop.fo.Constants#EN_ODD_PAGE}. */ public int getBreakClass() { return breakClass; @@ -131,9 +140,12 @@ public class BreakElement extends UnresolvedListElement { /** * Sets the break class. * - * @param breakClass one of {@link Constants#EN_AUTO}, {@link Constants#EN_COLUMN}, - * {@link Constants#EN_PAGE}, {@link Constants#EN_EVEN_PAGE}, - * {@link Constants#EN_ODD_PAGE} + * @param breakClass one of + * {@link org.apache.fop.fo.Constants#EN_AUTO}, + * {@link org.apache.fop.fo.Constants#EN_COLUMN}, + * {@link org.apache.fop.fo.Constants#EN_PAGE}, + * {@link org.apache.fop.fo.Constants#EN_EVEN_PAGE}, + * {@link org.apache.fop.fo.Constants#EN_ODD_PAGE}. */ public void setBreakClass(int breakClass) { this.breakClass = breakClass; diff --git a/src/java/org/apache/fop/layoutmgr/KnuthPenalty.java b/src/java/org/apache/fop/layoutmgr/KnuthPenalty.java index 2d4e1f2be..220f9c35d 100644 --- a/src/java/org/apache/fop/layoutmgr/KnuthPenalty.java +++ b/src/java/org/apache/fop/layoutmgr/KnuthPenalty.java @@ -72,8 +72,11 @@ public class KnuthPenalty extends KnuthElement { * @param penalty the penalty value of this penalty * @param penaltyFlagged is this penalty flagged? * @param breakClass the break class of this penalty (one of - * {@link Constants#EN_AUTO}, {@link Constants#EN_COLUMN}, {@link Constants#EN_PAGE}, - * {@link Constants#EN_EVEN_PAGE}, {@link Constants#EN_ODD_PAGE}) + * {@link org.apache.fop.fo.Constants#EN_AUTO}, + * {@link org.apache.fop.fo.Constants#EN_COLUMN}, + * {@link org.apache.fop.fo.Constants#EN_PAGE}, + * {@link org.apache.fop.fo.Constants#EN_EVEN_PAGE}, + * {@link org.apache.fop.fo.Constants#EN_ODD_PAGE}). * @param pos the Position stored in this penalty * @param isAuxiliary is this penalty auxiliary? */ diff --git a/src/java/org/apache/fop/pdf/PDFColor.java b/src/java/org/apache/fop/pdf/PDFColor.java index 8eea7e390..1fb544368 100644 --- a/src/java/org/apache/fop/pdf/PDFColor.java +++ b/src/java/org/apache/fop/pdf/PDFColor.java @@ -30,7 +30,7 @@ import org.apache.xmlgraphics.java2d.color.DeviceCMYKColorSpace; * image. And in this context, only RGB and Gray values are used. *

* Use of this class is discouraged. {@link PDFColorHandler} is now used for in-content color - * selection. For masked bitmaps, it may be wiser to switch to {@link Color} in the long run. + * selection. For masked bitmaps, it may be wiser to switch to {@link java.awt.Color} in the long run. */ public class PDFColor extends PDFPathPaint { // could be 3.0 as well. diff --git a/src/java/org/apache/fop/pdf/PDFEmbeddedFile.java b/src/java/org/apache/fop/pdf/PDFEmbeddedFile.java index dc0681405..ae6893944 100644 --- a/src/java/org/apache/fop/pdf/PDFEmbeddedFile.java +++ b/src/java/org/apache/fop/pdf/PDFEmbeddedFile.java @@ -38,7 +38,10 @@ public class PDFEmbeddedFile extends PDFStream { put("Params", params); } - /** {@inheritDoc} */ + /** + * Determine if should encode on the fly. + * @return true if should encode on the fly + */ protected boolean isEncodingOnTheFly() { //Acrobat doesn't like an indirect /Length object in this case, //but only when the embedded file is a PDF file. diff --git a/src/java/org/apache/fop/pdf/PDFObject.java b/src/java/org/apache/fop/pdf/PDFObject.java index 1b9c4eea7..e0f950154 100644 --- a/src/java/org/apache/fop/pdf/PDFObject.java +++ b/src/java/org/apache/fop/pdf/PDFObject.java @@ -22,7 +22,6 @@ package org.apache.fop.pdf; // Java import java.io.IOException; import java.io.OutputStream; -import java.io.Writer; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -210,11 +209,6 @@ public abstract class PDFObject implements PDFWritable { return pdf.length; } - /** {@inheritDoc} */ - public void outputInline(OutputStream out, Writer writer) throws IOException { - throw new UnsupportedOperationException("Don't use anymore: " + getClass().getName()); - } - /** {@inheritDoc} */ public void outputInline(OutputStream out, StringBuilder textBuffer) throws IOException { if (hasObjectNumber()) { diff --git a/src/java/org/apache/fop/pdf/PDFResources.java b/src/java/org/apache/fop/pdf/PDFResources.java index df8647bf4..cded7c00a 100644 --- a/src/java/org/apache/fop/pdf/PDFResources.java +++ b/src/java/org/apache/fop/pdf/PDFResources.java @@ -21,9 +21,8 @@ package org.apache.fop.pdf; import java.io.IOException; import java.io.OutputStream; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; import java.util.Map; import java.util.Set; @@ -46,33 +45,33 @@ public class PDFResources extends PDFDictionary { /** * /Font objects keyed by their internal name */ - protected Map fonts = new HashMap(); + protected Map fonts = new LinkedHashMap(); /** * Set of XObjects */ - protected Set xObjects = new HashSet(); + protected Set xObjects = new LinkedHashSet(); /** * Set of patterns */ - protected Set patterns = new HashSet(); + protected Set patterns = new LinkedHashSet(); /** * Set of shadings */ - protected Set shadings = new HashSet(); + protected Set shadings = new LinkedHashSet(); /** * Set of ExtGStates */ - protected Set gstates = new HashSet(); + protected Set gstates = new LinkedHashSet(); /** Map of color spaces (key: color space name) */ - protected Map colorSpaces = new HashMap(); + protected Map colorSpaces = new LinkedHashMap(); /** Map of ICC color spaces (key: ICC profile description) */ - protected Map iccColorSpaces = new HashMap(); + protected Map iccColorSpaces = new LinkedHashMap(); /** * create a /Resources object. @@ -168,7 +167,7 @@ public class PDFResources extends PDFDictionary { PDFICCBasedColorSpace icc = (PDFICCBasedColorSpace)colorSpace; String desc = ColorProfileUtil.getICCProfileDescription( icc.getICCStream().getICCProfile()); - this.iccColorSpaces.put(desc, colorSpace); + this.iccColorSpaces.put(desc, icc); } } @@ -178,7 +177,7 @@ public class PDFResources extends PDFDictionary { * @return the requested color space or null if it wasn't found */ public PDFICCBasedColorSpace getICCColorSpaceByProfileName(String desc) { - PDFICCBasedColorSpace cs = (PDFICCBasedColorSpace)this.iccColorSpaces.get(desc); + PDFICCBasedColorSpace cs = this.iccColorSpaces.get(desc); return cs; } @@ -188,7 +187,7 @@ public class PDFResources extends PDFDictionary { * @return the requested color space or null if it wasn't found */ public PDFColorSpace getColorSpace(PDFName name) { - PDFColorSpace cs = (PDFColorSpace)this.colorSpaces.get(name); + PDFColorSpace cs = this.colorSpaces.get(name); return cs; } @@ -202,28 +201,24 @@ public class PDFResources extends PDFDictionary { if (!this.fonts.isEmpty()) { PDFDictionary dict = new PDFDictionary(this); /* construct PDF dictionary of font object references */ - Iterator fontIterator = this.fonts.keySet().iterator(); - while (fontIterator.hasNext()) { - String fontName = (String)fontIterator.next(); - dict.put(fontName, (PDFFont)this.fonts.get(fontName)); + for (Map.Entry entry : fonts.entrySet()) { + dict.put(entry.getKey(), entry.getValue()); } put("Font", dict); } if (!this.shadings.isEmpty()) { PDFDictionary dict = new PDFDictionary(this); - for (Iterator iter = shadings.iterator(); iter.hasNext();) { - PDFShading currentShading = (PDFShading)iter.next(); - dict.put(currentShading.getName(), currentShading); + for (PDFShading shading : shadings) { + dict.put(shading.getName(), shading); } put("Shading", dict); } if (!this.patterns.isEmpty()) { PDFDictionary dict = new PDFDictionary(this); - for (Iterator iter = patterns.iterator(); iter.hasNext();) { - PDFPattern currentPattern = (PDFPattern)iter.next(); - dict.put(currentPattern.getName(), currentPattern); + for (PDFPattern pattern : patterns) { + dict.put(pattern.getName(), pattern); } put("Pattern", dict); } @@ -237,26 +232,23 @@ public class PDFResources extends PDFDictionary { if (this.xObjects != null && !this.xObjects.isEmpty()) { PDFDictionary dict = new PDFDictionary(this); - for (Iterator iter = xObjects.iterator(); iter.hasNext();) { - PDFXObject xobj = (PDFXObject)iter.next(); - dict.put(xobj.getName().toString(), xobj); + for (PDFXObject xObject : xObjects) { + dict.put(xObject.getName().toString(), xObject); } put("XObject", dict); } if (!this.gstates.isEmpty()) { PDFDictionary dict = new PDFDictionary(this); - for (Iterator iter = gstates.iterator(); iter.hasNext();) { - PDFGState gs = (PDFGState)iter.next(); - dict.put(gs.getName(), gs); + for (PDFGState gstate : gstates) { + dict.put(gstate.getName(), gstate); } put("ExtGState", dict); } if (!this.colorSpaces.isEmpty()) { PDFDictionary dict = new PDFDictionary(this); - for (Iterator iter = colorSpaces.values().iterator(); iter.hasNext();) { - PDFColorSpace colorSpace = (PDFColorSpace)iter.next(); + for (PDFColorSpace colorSpace : colorSpaces.values()) { dict.put(colorSpace.getName(), colorSpace); } put("ColorSpace", dict); diff --git a/src/java/org/apache/fop/render/ImageHandler.java b/src/java/org/apache/fop/render/ImageHandler.java index fe6952de1..190d7c5d6 100644 --- a/src/java/org/apache/fop/render/ImageHandler.java +++ b/src/java/org/apache/fop/render/ImageHandler.java @@ -33,7 +33,8 @@ public interface ImageHandler extends ImageHandlerBase { * Indicates whether the image handler is compatible with the indicated target represented * by the rendering context object and with the image to be processed. The image is also * passed as a parameter because a handler might not support every subtype of image that is - * presented. For example: in the case of {@link ImageXMLDOM}, the image might carry an SVG + * presented. For example: in the case of + * {@link org.apache.xmlgraphics.image.loader.impl.ImageXMLDOM}, the image might carry an SVG * or some other XML format. One handler might only handle SVG but no other XML format. * @param targetContext the target rendering context * @param image the image to be processed (or null if only to check based on the rendering diff --git a/src/java/org/apache/fop/render/afp/AFPDocumentHandler.java b/src/java/org/apache/fop/render/afp/AFPDocumentHandler.java index 7823a2ce6..2ae95dd4c 100644 --- a/src/java/org/apache/fop/render/afp/AFPDocumentHandler.java +++ b/src/java/org/apache/fop/render/afp/AFPDocumentHandler.java @@ -58,7 +58,8 @@ import org.apache.fop.render.intermediate.IFException; import org.apache.fop.render.intermediate.IFPainter; /** - * {@link IFDocumentHandler} implementation that produces AFP (MO:DCA). + * {@link org.apache.fop.render.intermediate.IFDocumentHandler} implementation that + * produces AFP (MO:DCA). */ public class AFPDocumentHandler extends AbstractBinaryWritingIFDocumentHandler implements AFPCustomizable { diff --git a/src/java/org/apache/fop/render/afp/extensions/AFPIncludeFormMap.java b/src/java/org/apache/fop/render/afp/extensions/AFPIncludeFormMap.java index 842456f69..824ecbabb 100644 --- a/src/java/org/apache/fop/render/afp/extensions/AFPIncludeFormMap.java +++ b/src/java/org/apache/fop/render/afp/extensions/AFPIncludeFormMap.java @@ -27,7 +27,7 @@ import org.xml.sax.helpers.AttributesImpl; /** * This extension allows to include an AFP form map resource. It is implemented as an extension - * attachment ({@link ExtensionAttachment}). + * attachment ({@link org.apache.fop.fo.extensions.ExtensionAttachment}). */ public class AFPIncludeFormMap extends AFPExtensionAttachment { diff --git a/src/java/org/apache/fop/render/afp/extensions/AFPIncludeFormMapElement.java b/src/java/org/apache/fop/render/afp/extensions/AFPIncludeFormMapElement.java index 37f818f64..c5079b2bd 100644 --- a/src/java/org/apache/fop/render/afp/extensions/AFPIncludeFormMapElement.java +++ b/src/java/org/apache/fop/render/afp/extensions/AFPIncludeFormMapElement.java @@ -32,8 +32,8 @@ import org.apache.fop.fo.PropertyList; import org.apache.fop.fo.extensions.ExtensionAttachment; /** - * This class extends the {@link ExtensionObj} class. It represents the "include-form-map" - * extension in the FO tree. + * This class extends the {@link org.apache.fop.fo.extensions.ExtensionObj} class. + * It represents the "include-form-map" extension in the FO tree. */ public class AFPIncludeFormMapElement extends AbstractAFPExtensionObject { diff --git a/src/java/org/apache/fop/render/afp/extensions/AFPPageOverlay.java b/src/java/org/apache/fop/render/afp/extensions/AFPPageOverlay.java index 0900d40b4..1e6aee7d5 100644 --- a/src/java/org/apache/fop/render/afp/extensions/AFPPageOverlay.java +++ b/src/java/org/apache/fop/render/afp/extensions/AFPPageOverlay.java @@ -25,7 +25,7 @@ import org.xml.sax.helpers.AttributesImpl; /** * This extension allows to include an AFP Page Overlay resource. It is implemented as an extension - * attachment ({@link ExtensionAttachment}). + * attachment ({@link org.apache.fop.fo.extensions.ExtensionAttachment}). */ public class AFPPageOverlay extends AFPExtensionAttachment { diff --git a/src/java/org/apache/fop/render/bitmap/AbstractBitmapDocumentHandler.java b/src/java/org/apache/fop/render/bitmap/AbstractBitmapDocumentHandler.java index c98c05a8e..0c6ebde56 100644 --- a/src/java/org/apache/fop/render/bitmap/AbstractBitmapDocumentHandler.java +++ b/src/java/org/apache/fop/render/bitmap/AbstractBitmapDocumentHandler.java @@ -47,7 +47,8 @@ import org.apache.fop.render.java2d.Java2DPainter; import org.apache.fop.render.java2d.Java2DUtil; /** - * Abstract {@link IFDocumentHandler} implementation for producing bitmap images. + * Abstract {@link org.apache.fop.render.intermediate.IFDocumentHandler} implementation + * for producing bitmap images. */ public abstract class AbstractBitmapDocumentHandler extends AbstractBinaryWritingIFDocumentHandler { diff --git a/src/java/org/apache/fop/render/bitmap/PNGDocumentHandler.java b/src/java/org/apache/fop/render/bitmap/PNGDocumentHandler.java index 05c44a1a6..ed92b852f 100644 --- a/src/java/org/apache/fop/render/bitmap/PNGDocumentHandler.java +++ b/src/java/org/apache/fop/render/bitmap/PNGDocumentHandler.java @@ -23,7 +23,8 @@ import org.apache.fop.apps.MimeConstants; import org.apache.fop.render.intermediate.IFDocumentHandlerConfigurator; /** - * {@link IFDocumentHandler} implementation that produces PNG files. + * {@link org.apache.fop.render.intermediate.IFDocumentHandler} implementation + * that produces PNG files. */ public class PNGDocumentHandler extends AbstractBitmapDocumentHandler { diff --git a/src/java/org/apache/fop/render/bitmap/TIFFDocumentHandler.java b/src/java/org/apache/fop/render/bitmap/TIFFDocumentHandler.java index 4b7fa3c2d..1c9a39bbe 100644 --- a/src/java/org/apache/fop/render/bitmap/TIFFDocumentHandler.java +++ b/src/java/org/apache/fop/render/bitmap/TIFFDocumentHandler.java @@ -23,7 +23,8 @@ import org.apache.fop.apps.MimeConstants; import org.apache.fop.render.intermediate.IFDocumentHandlerConfigurator; /** - * {@link IFDocumentHandler} implementation that produces TIFF files. + * {@link org.apache.fop.render.intermediate.IFDocumentHandler} implementation + * that produces TIFF files. */ public class TIFFDocumentHandler extends AbstractBitmapDocumentHandler { diff --git a/src/java/org/apache/fop/render/intermediate/IFContext.java b/src/java/org/apache/fop/render/intermediate/IFContext.java index c59a02ba8..681b996e4 100644 --- a/src/java/org/apache/fop/render/intermediate/IFContext.java +++ b/src/java/org/apache/fop/render/intermediate/IFContext.java @@ -145,7 +145,7 @@ public class IFContext { /** * Resets the current structure tree element. - * @see #setStructureTreeElement(String) + * @see #setStructureTreeElement(StructureTreeElement) */ public void resetStructureTreeElement() { setStructureTreeElement(null); @@ -154,7 +154,7 @@ public class IFContext { /** * Returns the current structure tree element. * @return the structure tree element (or null if no element is active) - * @see #setStructureTreeElement(String) + * @see #setStructureTreeElement(StructureTreeElement) */ public StructureTreeElement getStructureTreeElement() { return this.structureTreeElement; diff --git a/src/java/org/apache/fop/render/intermediate/IFUtil.java b/src/java/org/apache/fop/render/intermediate/IFUtil.java index e8651a3df..c4f681936 100644 --- a/src/java/org/apache/fop/render/intermediate/IFUtil.java +++ b/src/java/org/apache/fop/render/intermediate/IFUtil.java @@ -147,8 +147,8 @@ public final class IFUtil { /** * Sets up the fonts on a document handler. If the document handler provides a configurator - * object the configuration from the {@link FopFactory} will be used. Otherwise, - * a default font configuration will be set up. + * object the configuration from the {@link org.apache.fop.apps.FopFactory} will be used. + * Otherwise, a default font configuration will be set up. * @param documentHandler the document handler * @param fontInfo the font info object (may be null) * @throws FOPException if an error occurs while setting up the fonts @@ -175,8 +175,8 @@ public final class IFUtil { /** * Sets up the fonts on a document handler. If the document handler provides a configurator - * object the configuration from the {@link FopFactory} will be used. Otherwise, - * a default font configuration will be set up. + * object the configuration from the {@link org.apache.fop.apps.FopFactory} will be used. + * Otherwise, a default font configuration will be set up. * @param documentHandler the document handler * @throws FOPException if an error occurs while setting up the fonts */ diff --git a/src/java/org/apache/fop/render/java2d/CustomFontMetricsMapper.java b/src/java/org/apache/fop/render/java2d/CustomFontMetricsMapper.java index 5d964cbbf..36df00f20 100644 --- a/src/java/org/apache/fop/render/java2d/CustomFontMetricsMapper.java +++ b/src/java/org/apache/fop/render/java2d/CustomFontMetricsMapper.java @@ -36,7 +36,7 @@ import org.apache.fop.fonts.Typeface; /** * FontMetricsMapper that delegates most methods to an underlying - * {@link FontMetrics} instance. This class was designed to allow + * {@link org.apache.fop.fonts.FontMetrics} instance. This class was designed to allow * the underlying {@link Font} to be loaded from a * user-configured file not registered in the current graphics environment. */ diff --git a/src/java/org/apache/fop/render/java2d/Java2DPainter.java b/src/java/org/apache/fop/render/java2d/Java2DPainter.java index dd830a15b..575242d38 100644 --- a/src/java/org/apache/fop/render/java2d/Java2DPainter.java +++ b/src/java/org/apache/fop/render/java2d/Java2DPainter.java @@ -47,7 +47,8 @@ import org.apache.fop.traits.RuleStyle; import org.apache.fop.util.CharUtilities; /** - * {@link IFPainter} implementation that paints on a Graphics2D instance. + * {@link org.apache.fop.render.intermediate.IFPainter} implementation + * that paints on a Graphics2D instance. */ public class Java2DPainter extends AbstractIFPainter { diff --git a/src/java/org/apache/fop/render/pcl/PCLDocumentHandler.java b/src/java/org/apache/fop/render/pcl/PCLDocumentHandler.java index 52e522c7a..332b4a77d 100644 --- a/src/java/org/apache/fop/render/pcl/PCLDocumentHandler.java +++ b/src/java/org/apache/fop/render/pcl/PCLDocumentHandler.java @@ -45,7 +45,8 @@ import org.apache.fop.render.java2d.Java2DUtil; import org.apache.fop.render.pcl.extensions.PCLElementMapping; /** - * {@link IFDocumentHandler} implementation that produces PCL 5. + * {@link org.apache.fop.render.intermediate.IFDocumentHandler} implementation + * that produces PCL 5. */ public class PCLDocumentHandler extends AbstractBinaryWritingIFDocumentHandler implements PCLConstants { diff --git a/src/java/org/apache/fop/render/pcl/PCLPainter.java b/src/java/org/apache/fop/render/pcl/PCLPainter.java index 9fc575456..0d630826c 100644 --- a/src/java/org/apache/fop/render/pcl/PCLPainter.java +++ b/src/java/org/apache/fop/render/pcl/PCLPainter.java @@ -58,7 +58,8 @@ import org.apache.fop.traits.RuleStyle; import org.apache.fop.util.CharUtilities; /** - * {@link IFPainter} implementation that produces PCL 5. + * {@link org.apache.fop.render.intermediate.IFPainter} implementation + * that produces PCL 5. */ public class PCLPainter extends AbstractIFPainter implements PCLConstants { diff --git a/src/java/org/apache/fop/render/ps/NativeTextHandler.java b/src/java/org/apache/fop/render/ps/NativeTextHandler.java index 33adcb8d7..e8f123dc5 100644 --- a/src/java/org/apache/fop/render/ps/NativeTextHandler.java +++ b/src/java/org/apache/fop/render/ps/NativeTextHandler.java @@ -100,12 +100,6 @@ public class NativeTextHandler implements PSTextHandler { //nop } - /** {@inheritDoc} */ - public void drawString(String text, float x, float y) throws IOException { - // TODO Remove me after removing the deprecated method in TextHandler. - throw new UnsupportedOperationException("Deprecated method!"); - } - /** * Draw a string to the PostScript document. The text is painted using * text operations. diff --git a/src/java/org/apache/fop/render/ps/PSDocumentHandler.java b/src/java/org/apache/fop/render/ps/PSDocumentHandler.java index 95647d820..dc785ea18 100644 --- a/src/java/org/apache/fop/render/ps/PSDocumentHandler.java +++ b/src/java/org/apache/fop/render/ps/PSDocumentHandler.java @@ -63,7 +63,8 @@ import org.apache.fop.render.ps.extensions.PSSetPageDevice; import org.apache.fop.render.ps.extensions.PSSetupCode; /** - * {@link IFDocumentHandler} implementation that produces PostScript. + * {@link org.apache.fop.render.intermediate.IFDocumentHandler} implementation + * that produces PostScript. */ public class PSDocumentHandler extends AbstractBinaryWritingIFDocumentHandler { diff --git a/src/java/org/apache/fop/svg/PDFAElementBridge.java b/src/java/org/apache/fop/svg/PDFAElementBridge.java index cd70bed34..c2a481af9 100644 --- a/src/java/org/apache/fop/svg/PDFAElementBridge.java +++ b/src/java/org/apache/fop/svg/PDFAElementBridge.java @@ -64,7 +64,7 @@ public class PDFAElementBridge extends AbstractGraphicsNodeBridge { } /** - * Creates a {@link CompositeGraphicsNode}. + * Creates a {@link org.apache.batik.gvt.CompositeGraphicsNode}. * @return a new PDFANode */ protected GraphicsNode instantiateGraphicsNode() { diff --git a/src/java/org/apache/fop/traits/MinOptMax.java b/src/java/org/apache/fop/traits/MinOptMax.java index 022f3c214..84fb0156a 100644 --- a/src/java/org/apache/fop/traits/MinOptMax.java +++ b/src/java/org/apache/fop/traits/MinOptMax.java @@ -22,8 +22,9 @@ package org.apache.fop.traits; import java.io.Serializable; /** - * This class holds the resolved (as mpoints) form of a {@link LengthRangeProperty LengthRange} or - * {@link SpaceProperty Space} type property value. + * This class holds the resolved (as mpoints) form of a + * {@link org.apache.fop.fo.properties.LengthRangeProperty} or + * {@link org.apache.fop.fo.properties.SpaceProperty} type property value. *

* Instances of this class are immutable. All arithmetic methods like {@link #plus(MinOptMax) plus}, * {@link #minus(MinOptMax) minus} or {@link #mult(int) mult} return a different instance. So it is diff --git a/src/java/org/apache/fop/traits/TraitEnum.java b/src/java/org/apache/fop/traits/TraitEnum.java index 18fdffaab..0d664a6df 100644 --- a/src/java/org/apache/fop/traits/TraitEnum.java +++ b/src/java/org/apache/fop/traits/TraitEnum.java @@ -30,7 +30,7 @@ public abstract class TraitEnum implements Serializable { /** * Constructor to add a new named item. * @param name Name of the item. - * @param enumValue the {@link Constants}.EN_* value + * @param enumValue the {@link org.apache.fop.fo.Constants}.EN_* value */ protected TraitEnum(String name, int enumValue) { this.name = name; @@ -46,7 +46,7 @@ public abstract class TraitEnum implements Serializable { } /** - * Returns the enumeration value (one of {@link Constants}.EN_*). + * Returns the enumeration value (one of {@link org.apache.fop.fo.Constants}.EN_*). * @return the enumeration value */ public int getEnumValue() { diff --git a/src/java/org/apache/fop/util/ColorExt.java b/src/java/org/apache/fop/util/ColorExt.java index d0ac6767c..f92e7c2a6 100644 --- a/src/java/org/apache/fop/util/ColorExt.java +++ b/src/java/org/apache/fop/util/ColorExt.java @@ -28,7 +28,7 @@ import java.util.Arrays; *

* This class extends java.awt.Color class keeping track of the original color * property values specified by the fo user in a rgb-icc call. - * @deprecated Replaced by {@link ColorWithAlternatives} + * @deprecated Replaced by {@link org.apache.xmlgraphics.java2d.color.ColorWithAlternatives} */ @Deprecated public final class ColorExt extends Color { diff --git a/src/sandbox/org/apache/fop/render/mif/MIFHandler.java b/src/sandbox/org/apache/fop/render/mif/MIFHandler.java index cfc86edc7..5ef4c0940 100644 --- a/src/sandbox/org/apache/fop/render/mif/MIFHandler.java +++ b/src/sandbox/org/apache/fop/render/mif/MIFHandler.java @@ -29,8 +29,10 @@ import org.apache.commons.logging.LogFactory; import org.apache.fop.apps.FOUserAgent; import org.apache.fop.fo.FOEventHandler; +import org.apache.fop.fo.FOText; import org.apache.fop.fo.flow.BasicLink; import org.apache.fop.fo.flow.Block; +import org.apache.fop.fo.flow.Character; import org.apache.fop.fo.flow.ExternalGraphic; import org.apache.fop.fo.flow.Footnote; import org.apache.fop.fo.flow.FootnoteBody; @@ -39,6 +41,8 @@ import org.apache.fop.fo.flow.InstreamForeignObject; import org.apache.fop.fo.flow.Leader; import org.apache.fop.fo.flow.ListBlock; import org.apache.fop.fo.flow.ListItem; +import org.apache.fop.fo.flow.ListItemBody; +import org.apache.fop.fo.flow.ListItemLabel; import org.apache.fop.fo.flow.PageNumber; import org.apache.fop.fo.flow.table.Table; import org.apache.fop.fo.flow.table.TableBody; @@ -51,6 +55,7 @@ import org.apache.fop.fo.pagination.Flow; import org.apache.fop.fo.pagination.PageSequence; import org.apache.fop.fo.pagination.PageSequenceMaster; import org.apache.fop.fo.pagination.SimplePageMaster; +import org.apache.fop.fo.pagination.StaticContent; import org.apache.fop.fonts.FontSetup; import org.apache.fop.render.DefaultFontResolver; @@ -267,27 +272,27 @@ public class MIFHandler extends FOEventHandler { } /** {@inheritDoc} */ - public void startListLabel() { + public void startListLabel(ListItemLabel listItemLabel) { } /** {@inheritDoc} */ - public void endListLabel() { + public void endListLabel(ListItemLabel listItemLabel) { } /** {@inheritDoc} */ - public void startListBody() { + public void startListBody(ListItemBody listItemBody) { } /** {@inheritDoc} */ - public void endListBody() { + public void endListBody(ListItemBody listItemBody) { } /** {@inheritDoc} */ - public void startStatic() { + public void startStatic(StaticContent staticContent) { } /** {@inheritDoc} */ - public void endStatic() { + public void endStatic(StaticContent staticContent) { } /** {@inheritDoc} */ @@ -303,7 +308,7 @@ public class MIFHandler extends FOEventHandler { } /** {@inheritDoc} */ - public void endLink() { + public void endLink(BasicLink basicLink) { } /** {@inheritDoc} */ @@ -315,7 +320,11 @@ public class MIFHandler extends FOEventHandler { } /** {@inheritDoc} */ - public void foreignObject(InstreamForeignObject ifo) { + public void startInstreamForeignObject(InstreamForeignObject ifo) { + } + + /** {@inheritDoc} */ + public void endInstreamForeignObject(InstreamForeignObject ifo) { } /** {@inheritDoc} */ @@ -335,19 +344,37 @@ public class MIFHandler extends FOEventHandler { } /** {@inheritDoc} */ - public void leader(Leader l) { + public void startLeader(Leader l) { + } + + /** {@inheritDoc} */ + public void endLeader(Leader l) { + } + + public void character(Character c) { + appendCharacters ( new String ( new char[] {c.getCharacter()} ) ); + } + + /** {@inheritDoc} */ + public void characters(FOText foText) { + appendCharacters ( foText.getCharSequence().toString() ); + } + + /** {@inheritDoc} */ + public void startPageNumber(PageNumber pagenum) { } /** {@inheritDoc} */ - public void characters(char[] data, int start, int length) { + public void endPageNumber(PageNumber pagenum) { + } + + private void appendCharacters ( String str ) { if (para != null) { - String str = new String(data, start, length); str = str.trim(); // break into nice length chunks if (str.length() == 0) { return; } - MIFElement line = new MIFElement("ParaLine"); MIFElement prop = new MIFElement("TextRectID"); prop.setValue("2"); @@ -355,17 +382,8 @@ public class MIFHandler extends FOEventHandler { prop = new MIFElement("String"); prop.setValue("\"" + str + "\""); line.addElement(prop); - para.addElement(line); } } - - /** {@inheritDoc} */ - public void startPageNumber(PageNumber pagenum) { - } - - /** {@inheritDoc} */ - public void endPageNumber(PageNumber pagenum) { - } } diff --git a/src/sandbox/org/apache/fop/render/svg/SVGDocumentHandler.java b/src/sandbox/org/apache/fop/render/svg/SVGDocumentHandler.java index ef0d9f301..6fd4d3618 100644 --- a/src/sandbox/org/apache/fop/render/svg/SVGDocumentHandler.java +++ b/src/sandbox/org/apache/fop/render/svg/SVGDocumentHandler.java @@ -54,7 +54,8 @@ import org.apache.fop.util.GenerationHelperContentHandler; import org.apache.fop.util.XMLUtil; /** - * {@link IFDocumentHandler} implementation that writes SVG 1.1. + * {@link org.apache.fop.render.intermediate.IFDocumentHandler} implementation + * that writes SVG 1.1. */ public class SVGDocumentHandler extends AbstractSVGDocumentHandler { diff --git a/src/sandbox/org/apache/fop/render/svg/SVGPrintDocumentHandler.java b/src/sandbox/org/apache/fop/render/svg/SVGPrintDocumentHandler.java index 10be9588e..8ec374731 100644 --- a/src/sandbox/org/apache/fop/render/svg/SVGPrintDocumentHandler.java +++ b/src/sandbox/org/apache/fop/render/svg/SVGPrintDocumentHandler.java @@ -32,7 +32,8 @@ import org.apache.fop.render.intermediate.IFPainter; import org.apache.fop.util.XMLUtil; /** - * {@link IFDocumentHandler} implementation that writes SVG Print. + * {@link org.apache.fop.render.intermediate.IFDocumentHandler} implementation + * that writes SVG Print. */ public class SVGPrintDocumentHandler extends AbstractSVGDocumentHandler { diff --git a/status.xml b/status.xml index 8cfed70eb..9fc448cf4 100644 --- a/status.xml +++ b/status.xml @@ -62,6 +62,18 @@ documents. Example: the fix of marks layering will be such a case when it's done. --> + + Eliminate javadocs warnings. + + + Update xmlgraphics common jar to reflect recent fixes in XGC. + + + Fix handling of NaN, {+,-}Infinity, and other edge cases. Submitted by Julien Aymé. + + + Add version attribute to AT and IF intermediate formats. Also eliminate redundant use of reversed attribute in AT format. + Add version attribute to AT and IF intermediate formats. Also eliminate redundant use of reversed attribute in AT format. diff --git a/test/java/org/apache/fop/accessibility/fo/FO2StructureTreeConverterTestCase.java b/test/java/org/apache/fop/accessibility/fo/FO2StructureTreeConverterTestCase.java index 9c53bdde3..863bfe797 100644 --- a/test/java/org/apache/fop/accessibility/fo/FO2StructureTreeConverterTestCase.java +++ b/test/java/org/apache/fop/accessibility/fo/FO2StructureTreeConverterTestCase.java @@ -19,8 +19,6 @@ package org.apache.fop.accessibility.fo; -import static org.junit.Assert.assertTrue; - import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; @@ -45,6 +43,8 @@ import org.w3c.dom.Document; import org.xml.sax.SAXException; import org.xml.sax.helpers.AttributesImpl; +import static org.junit.Assert.assertTrue; + import org.apache.fop.accessibility.StructureTree2SAXEventAdapter; import org.apache.fop.accessibility.StructureTreeEventHandler; import org.apache.fop.apps.FOPException; @@ -102,6 +102,17 @@ public class FO2StructureTreeConverterTestCase { testConverter(); } + @Test + public void testArtifact() throws Exception { + foLoader = new FOLoader() { + + public InputStream getFoInputStream() { + return getResource("artifact.fo"); + } + }; + testConverter(); + } + private Transformer createTransformer(Source xslt) throws TransformerFactoryConfigurationError, TransformerConfigurationException { TransformerFactory transformerFactory = TransformerFactory.newInstance(); diff --git a/test/java/org/apache/fop/accessibility/fo/artifact.fo b/test/java/org/apache/fop/accessibility/fo/artifact.fo new file mode 100644 index 000000000..c3d5fadf3 --- /dev/null +++ b/test/java/org/apache/fop/accessibility/fo/artifact.fo @@ -0,0 +1,97 @@ + + + + + + + + + + + + This piece of text is normal content that should be read out loud by a screen + reader. + + The following content will be treated as artifact: + + + + + A block as artifact. + + + + + Header 1.1 + Header 1.2 + + + Footer 1.1 + Footer 1.2 + + + + Cell 1.1 + Cell 1.2 + + + Cell 2.1 + Cell 2.2 + + + + + + + • + + + Item 1. + + + + + • + + + Item 2. + + + + + • + + + Item 3. + + + + + A block in a nested wrapper. + + + A block in a nested artifact wrapper. + + + Inside a nested wrapper. + An artifact wrapper inside the nested wrapper. + Inside a wrapper inside the artifact wrapper that is inside + the nested wrapper. Outside the wrapper inside the artifact + wrapper that is inside the nested wrapper. + Outside the artifact wrapper. + + + + + + Now we are back to normal content that is part of the logical + structure, should appear in the structure tree and should be read out loud by the screen + reader. + + + + + diff --git a/test/java/org/apache/fop/accessibility/fo/fo2StructureTree.xsl b/test/java/org/apache/fop/accessibility/fo/fo2StructureTree.xsl index ce326f3b1..db0dffb14 100644 --- a/test/java/org/apache/fop/accessibility/fo/fo2StructureTree.xsl +++ b/test/java/org/apache/fop/accessibility/fo/fo2StructureTree.xsl @@ -105,6 +105,8 @@ + + diff --git a/test/pdf/accessibility/pdf/role.pdf b/test/pdf/accessibility/pdf/role.pdf index 38fcf1bde3c847f0480323f16f90b38d310ddc0d..4dfb686c9f962f298f1b1611ca221d67eb0a300d 100644 GIT binary patch delta 3098 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 F{tNzI3>g3b diff --git a/test/pdf/accessibility/role.fo b/test/pdf/accessibility/role.fo index 885638592..b94c6ab67 100644 --- a/test/pdf/accessibility/role.fo +++ b/test/pdf/accessibility/role.fo @@ -24,8 +24,8 @@ - - + +