/** 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() { }
}
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;
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
@Override
public void startStatic(StaticContent staticContent) {
+ handleStartArtifact(staticContent);
converter.startStatic(staticContent);
super.startStatic(staticContent);
}
@Override
public void endStatic(StaticContent statisContent) {
converter.endStatic(statisContent);
+ handleEndArtifact(statisContent);
super.endStatic(statisContent);
}
@Override
public void startWrapper(Wrapper wrapper) {
+ handleStartArtifact(wrapper);
converter.startWrapper(wrapper);
super.startWrapper(wrapper);
}
@Override
public void endWrapper(Wrapper wrapper) {
converter.endWrapper(wrapper);
+ handleEndArtifact(wrapper);
super.endWrapper(wrapper);
}
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());
+ }
+
}
/**
* 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
}
/**
- * 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() {
* 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);
/**
* 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);
* which signal an alternate mode of processing for the content of the current
* Presentation Text data.
* <p>
- * 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 {
* 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)
/**
* 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 {
/**
* 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();
* 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;
}
/** 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 ) {
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) {
}
/**
* 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) {
}
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 <a href=http://www.w3.org/TR/xsl/#fo_wrapper">
* The <code>fo:wrapper</code> 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}
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();
return FO_WRAPPER;
}
+ public CommonAccessibility getCommonAccessibility() {
+ return commonAccessibility;
+ }
+
@Override
public boolean isDelimitedTextRangeBoundary ( int boundary ) {
return false;
* @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
* 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
* @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,
/**
* 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;
/**
* 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;
* @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?
*/
* image. And in this context, only RGB and Gray values are used.
* <p>
* 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.
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.
// 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;
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()) {
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;
/**
* /Font objects keyed by their internal name
*/
- protected Map fonts = new HashMap();
+ protected Map<String, PDFFont> fonts = new LinkedHashMap<String, PDFFont>();
/**
* Set of XObjects
*/
- protected Set xObjects = new HashSet();
+ protected Set<PDFXObject> xObjects = new LinkedHashSet<PDFXObject>();
/**
* Set of patterns
*/
- protected Set patterns = new HashSet();
+ protected Set<PDFPattern> patterns = new LinkedHashSet<PDFPattern>();
/**
* Set of shadings
*/
- protected Set shadings = new HashSet();
+ protected Set<PDFShading> shadings = new LinkedHashSet<PDFShading>();
/**
* Set of ExtGStates
*/
- protected Set gstates = new HashSet();
+ protected Set<PDFGState> gstates = new LinkedHashSet<PDFGState>();
/** Map of color spaces (key: color space name) */
- protected Map colorSpaces = new HashMap();
+ protected Map<PDFName, PDFColorSpace> colorSpaces = new LinkedHashMap<PDFName, PDFColorSpace>();
/** Map of ICC color spaces (key: ICC profile description) */
- protected Map iccColorSpaces = new HashMap();
+ protected Map<String, PDFICCBasedColorSpace> iccColorSpaces = new LinkedHashMap<String, PDFICCBasedColorSpace>();
/**
* create a /Resources object.
PDFICCBasedColorSpace icc = (PDFICCBasedColorSpace)colorSpace;
String desc = ColorProfileUtil.getICCProfileDescription(
icc.getICCStream().getICCProfile());
- this.iccColorSpaces.put(desc, colorSpace);
+ this.iccColorSpaces.put(desc, icc);
}
}
* @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;
}
* @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;
}
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<String, PDFFont> 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);
}
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);
* 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
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 {
/**
* 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 {
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 {
/**
* 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 {
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 {
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 {
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 {
/**
* Resets the current structure tree element.
- * @see #setStructureTreeElement(String)
+ * @see #setStructureTreeElement(StructureTreeElement)
*/
public void resetStructureTreeElement() {
setStructureTreeElement(null);
/**
* 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;
/**
* 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
/**
* 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
*/
/**
* 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.
*/
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 {
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 {
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 {
//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.
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 {
}
/**
- * Creates a {@link CompositeGraphicsNode}.
+ * Creates a {@link org.apache.batik.gvt.CompositeGraphicsNode}.
* @return a new PDFANode
*/
protected GraphicsNode instantiateGraphicsNode() {
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.
* <p/>
* 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
/**
* 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;
}
/**
- * 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() {
* <p>
* 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 {
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;
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;
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;
}
/** {@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} */
}
/** {@inheritDoc} */
- public void endLink() {
+ public void endLink(BasicLink basicLink) {
}
/** {@inheritDoc} */
}
/** {@inheritDoc} */
- public void foreignObject(InstreamForeignObject ifo) {
+ public void startInstreamForeignObject(InstreamForeignObject ifo) {
+ }
+
+ /** {@inheritDoc} */
+ public void endInstreamForeignObject(InstreamForeignObject ifo) {
}
/** {@inheritDoc} */
}
/** {@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");
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) {
- }
}
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 {
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 {
documents. Example: the fix of marks layering will be such a case when it's done.
-->
<release version="1.1rc1" date="3 June 2012">
+ <action context="Code" dev="GA" type="fix">
+ Eliminate javadocs warnings.
+ </action>
+ <action context="Code" dev="GA" type="update" fixes-bug="53055">
+ Update xmlgraphics common jar to reflect recent fixes in XGC.
+ </action>
+ <action context="Code" dev="GA" type="update" fixes-bug="43940" due-to="Julien Aymé">
+ Fix handling of NaN, {+,-}Infinity, and other edge cases. Submitted by Julien Aymé.
+ </action>
+ <action context="Renderers" dev="GA" type="fix" fixes-bug="53304,53306">
+ Add version attribute to AT and IF intermediate formats. Also eliminate redundant use of reversed attribute in AT format.
+ </action>
<action context="Renderers" dev="GA" type="fix" fixes-bug="53304,53306">
Add version attribute to AT and IF intermediate formats. Also eliminate redundant use of reversed attribute in AT format.
</action>
package org.apache.fop.accessibility.fo;
-import static org.junit.Assert.assertTrue;
-
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
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;
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();
--- /dev/null
+<?xml version="1.0" standalone="no"?>
+<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
+ <fo:layout-master-set>
+ <fo:simple-page-master master-name="page"
+ page-height="500pt" page-width="300pt" margin="20pt">
+ <fo:region-body/>
+ </fo:simple-page-master>
+ </fo:layout-master-set>
+
+ <fo:page-sequence master-reference="page">
+ <fo:flow flow-name="xsl-region-body" text-align="justify">
+
+ <fo:block>This piece of text is normal content that should be read out loud by a screen
+ reader.</fo:block>
+
+ <fo:block space-before="10pt">The following content will be treated as artifact:</fo:block>
+
+ <fo:wrapper role="artifact">
+ <fo:block-container border="1pt solid black" padding="5pt" background-color="#F0F0F0"
+ space-before="10pt" start-indent="6pt" end-indent="6pt" color="#606060">
+ <fo:block start-indent="0" end-indent="0">
+ <fo:block>A block as artifact.</fo:block>
+ <fo:table space-before="5pt" width="100%" table-layout="fixed">
+ <fo:table-column column-width="proportional-column-width(1)"/>
+ <fo:table-column column-width="proportional-column-width(2)"/>
+ <fo:table-header>
+ <fo:table-cell border="1pt solid #606060"><fo:block>Header 1.1</fo:block></fo:table-cell>
+ <fo:table-cell border="1pt solid #606060"><fo:block>Header 1.2</fo:block></fo:table-cell>
+ </fo:table-header>
+ <fo:table-footer>
+ <fo:table-cell border="1pt solid #606060"><fo:block>Footer 1.1</fo:block></fo:table-cell>
+ <fo:table-cell border="1pt solid #606060"><fo:block>Footer 1.2</fo:block></fo:table-cell>
+ </fo:table-footer>
+ <fo:table-body>
+ <fo:table-row>
+ <fo:table-cell border="1pt solid #606060"><fo:block>Cell 1.1</fo:block></fo:table-cell>
+ <fo:table-cell border="1pt solid #606060"><fo:block>Cell 1.2</fo:block></fo:table-cell>
+ </fo:table-row>
+ <fo:table-row>
+ <fo:table-cell border="1pt solid #606060"><fo:block>Cell 2.1</fo:block></fo:table-cell>
+ <fo:table-cell border="1pt solid #606060"><fo:block>Cell 2.2</fo:block></fo:table-cell>
+ </fo:table-row>
+ </fo:table-body>
+ </fo:table>
+ <fo:list-block space-before="7pt" provisional-distance-between-starts="8pt"
+ provisional-label-separation="5pt">
+ <fo:list-item>
+ <fo:list-item-label end-indent="label-end()">
+ <fo:block>•</fo:block>
+ </fo:list-item-label>
+ <fo:list-item-body start-indent="body-start()">
+ <fo:block>Item 1.</fo:block>
+ </fo:list-item-body>
+ </fo:list-item>
+ <fo:list-item>
+ <fo:list-item-label end-indent="label-end()">
+ <fo:block>•</fo:block>
+ </fo:list-item-label>
+ <fo:list-item-body start-indent="body-start()">
+ <fo:block>Item 2.</fo:block>
+ </fo:list-item-body>
+ </fo:list-item>
+ <fo:list-item>
+ <fo:list-item-label end-indent="label-end()">
+ <fo:block>•</fo:block>
+ </fo:list-item-label>
+ <fo:list-item-body start-indent="body-start()">
+ <fo:block>Item 3.</fo:block>
+ </fo:list-item-body>
+ </fo:list-item>
+ </fo:list-block>
+ <fo:wrapper>
+ <fo:block>A block in a nested wrapper.</fo:block>
+ </fo:wrapper>
+ <fo:wrapper role="artifact">
+ <fo:block>A block in a nested artifact wrapper.</fo:block>
+ </fo:wrapper>
+ <fo:wrapper>
+ <fo:block>Inside a nested wrapper.
+ <fo:wrapper role="artifact">An artifact wrapper inside the nested wrapper.
+ <fo:inline><fo:wrapper>Inside a wrapper inside the artifact wrapper that is inside
+ the nested wrapper.</fo:wrapper> Outside the wrapper inside the artifact
+ wrapper that is inside the nested wrapper.</fo:inline>
+ </fo:wrapper> Outside the artifact wrapper.</fo:block>
+ </fo:wrapper>
+ </fo:block>
+ </fo:block-container>
+ </fo:wrapper>
+
+ <fo:block space-before="10pt">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.</fo:block>
+
+ </fo:flow>
+ </fo:page-sequence>
+
+</fo:root>
<xsl:call-template name="copy"/>
</xsl:template>
+ <xsl:template match="fo:wrapper[translate(normalize-space(@role), 'ARTIFCT', 'artifct') = 'artifact']"/>
+
<!-- Discard descendants of fo:leader -->
<xsl:template match="fo:leader"/>
<fo:region-after extent="10pt"/>
</fo:simple-page-master>
</fo:layout-master-set>
- <fo:page-sequence master-reference="page" role="Art">
- <fo:static-content flow-name="xsl-region-after" role="NonStruct" font-size="8pt">
+ <fo:page-sequence master-reference="page" language="en" country="GB" role="Art">
+ <fo:static-content flow-name="xsl-region-after" role="artifact" font-size="8pt">
<fo:block text-align="center"><fo:page-number/></fo:block>
</fo:static-content>
<fo:flow flow-name="xsl-region-body" role="NonStruct" hyphenate="true"