/**
* Main constructor
+ *
+ * @param resourceResolver the associated {@link InternalResourceResolver} instance
*/
public AFPResourceManager(InternalResourceResolver resourceResolver) {
this.factory = new Factory();
}
/**
- * TODO
- * @param resourceInfo
- * @return
+ * Returns {@code true} if the passed {@link AFPResourceInfo} instance is already cached.
+ *
+ * @param resourceInfo the resource info to check
+ * @return {@code true} if the object is cached
*/
public boolean isObjectCached(AFPResourceInfo resourceInfo) {
return includeObjectCache.containsKey(resourceInfo);
}
/**
- * TODO
- * @param resourceInfo
- * @param areaInfo
- * @return
+ * {@asf.todo}
+ *
+ * @param resourceInfo the resource info to check
+ * @param areaInfo the area info to check
+ * @return {@code true} if ...
*/
public boolean includeCachedObject(AFPResourceInfo resourceInfo, AFPObjectAreaInfo areaInfo) {
/**
* All implementations of AFP fonts should extend this base class,
* the object implements the FontMetrics information.
- * <p/>
*/
public abstract class AFPFont extends Typeface {
* font description information for identifying the characters, font metric
* information for positioning the characters, and character shape information
* for presenting the character images.
- * <p/>
+ * <br>
* Presenting a graphic character on a presentation surface requires
* information on the rotation and position of character on the physical
* or logical page.
- * <p/>
+ * <br>
* This class proivdes font metric information for a particular font
* as identified by the character set name. This information is obtained
* directly from the AFP font files which must be installed in the path
* specified in the afp-fonts xml definition file.
- * <p/>
+ * <br>
*/
public class CharacterSet {
}
/**
- * TODO
+ * Return the width to use for an underscore (_) character.
+ *
+ * @return the width of an underscore character
*/
public int getUnderscoreWidth() {
return getCharacterSetOrientation().getUnderscoreWidth();
}
/**
- * TODO
+ * Return the position for an underscore (_) character.
+ *
+ * @return the position of an underscore character
*/
public int getUnderscorePosition() {
return getCharacterSetOrientation().getUnderscorePosition();
* identified by the parameter passed.
*
* @param character the Unicode character from which the width will be calculated
+ * @param size the font size
* @return the width of the character
*/
public int getWidth(char character, int size) {
try {
nameBytes = name.getBytes(AFPConstants.EBCIDIC_ENCODING);
} catch (UnsupportedEncodingException usee) {
+ // @SuppressFBWarnings("DM_DEFAULT_ENCODING")
nameBytes = name.getBytes();
LOG.warn(
"UnsupportedEncodingException translating the name " + name);
/**
* The CharacterSetBuilder is responsible building the a CharacterSet instance that holds
- * the font metric data. The data is either read from disk and passed to a CharacterSet (*)
- * or a FopCharacterSet is instantiated that is composed of a Typeface instance configured
- * with this data.<p/>
+ * the font metric data. The data is either read from disk and passed to a CharacterSet (*)
+ * or a FopCharacterSet is instantiated that is composed of a Typeface instance configured
+ * with this data.<br>
* -*- For referenced fonts CharacterSetBuilder is responsible for reading the font attributes
* from binary code page files and the character set metric files. In IBM font structure, a
* code page maps each character of text to the characters in a character set.
* outline pattern) of the character in the character set specified. The image
* in the character set is the image that is printed in the document. To be a
* valid code page for a particular character set, all character IDs in the code
- * page must be included in that character set. <p/>This class will read the
- * font information from the binary code page files and character set metric
- * files in order to determine the correct metrics to use when rendering the
- * formatted object. <p/>
- *
+ * page must be included in that character set.<br>
+ * This class will read the font information from the binary code page files and character
+ * set metric files in order to determine the correct metrics to use when rendering the
+ * formatted object.
*/
public abstract class CharacterSetBuilder {
/**
* Returns an InputStream to a given file path and filename
*
- * * @param accessor the resource accessor
+ * @param accessor the resource accessor
* @param uriStr the URI
* @param eventProducer for handling AFP related events
* @return an inputStream
* of character shapes by defining their characteristics, which include
* Font-Description information for identifying the characters, Font-Metric
* information for positioning the characters, and Character-Shape
- * information for presenting the character images.
+ * information for presenting the character images.<br>
*
* Presenting a graphic character on a presentation surface requires
* that you communicate this information clearly to rotate and position
- * characters correctly on the physical or logical page.
+ * characters correctly on the physical or logical page.<br>
*
* This class provides font metric information for a particular font
- * as by the orientation.
+ * as by the orientation.<br>
*
* This information is obtained directly from the AFP font files which must
* be installed in the classpath under in the location specified by the path
* attribute in the afp-font.xml file.
- * <p/>
*/
public class CharacterSetOrientation {
/**
* Constructor for the CharacterSetOrientation, the orientation is
* expressed as the degrees rotation (i.e 0, 90, 180, 270)
- * @param orientation the character set orientation
+ *
+ * @param orientation the character set orientation
+ * @param spaceIncrement the space increment
+ * @param emSpaceIncrement the em space increment
+ * @param nomCharIncrement the nominal character increment
*/
public CharacterSetOrientation(int orientation, int spaceIncrement, int emSpaceIncrement,
int nomCharIncrement) {
}
/**
- * TODO
+ * {@asf.todo}
+ *
+ * @return the underscore width
*/
public int getUnderscoreWidth() {
return underscoreWidth;
}
/**
- * TODO
+ * {@asf.todo}
+ *
+ * @return the underscore position
*/
public int getUnderscorePosition() {
return underscorePosition;
* Get the width (in 1/1000ths of a point size) of the character
* identified by the parameter passed.
* @param character the Unicode character to evaluate
+ * @param size the font size
* @return the widths of the character
*/
public int getWidth(char character, int size) {
* Get the character box (rectangle with dimensions in 1/1000ths of a point size) of the character
* identified by the parameter passed.
* @param character the Unicode character to evaluate
+ * @param size the font size
* @return the character box
*/
public Rectangle getCharacterBox(char character, int size) {
* identified by the parameter passed.
* @param character the Unicode character for which the width is being set
* @param width the widths of the character
+ * @param characterBox the character box
*/
public void setCharacterMetrics(char character, int width, Rectangle characterBox) {
characterMetrics.put((int) character, new CharacterMetrics(width, characterBox));
import org.apache.fop.afp.AFPEventProducer;
/**
- * Implementation of AbstractOutlineFont that supports double-byte fonts (CID Keyed font (Type 0)).
+ * Implementation of {@link AbstractOutlineFont} that supports double-byte fonts (CID Keyed font (Type 0)).
* The width of characters that are not prescribed a width metrics in the font resource use
* a fallback width. The default width is 1 em. A character can be supplied and queried for the
- * fallback width of all non-ideograph characters.<p />
+ * fallback width of all non-ideograph characters.
*/
public class DoubleByteFont extends AbstractOutlineFont {
/**
* A runtime exception for handling fatal errors in processing fonts.
- * <p/>
*/
public class FontRuntimeException extends RuntimeException {
import org.apache.fop.fonts.Typeface;
/**
- * A Character set for a normal FOP font<p/>
+ * A Character set for a normal FOP font
*/
public class FopCharacterSet extends CharacterSet {
* A font where each character is stored as an array of pixels (a bitmap). Such
* fonts are not easily scalable, in contrast to vectored fonts. With this type
* of font, the font metrics information is held in character set files (one for
- * each size and style). <p/>
- *
+ * each size and style).
*/
public class RasterFont extends AFPFont {
* Constructor for the raster font requires the name, weight and style
* attribute to be available as this forms the key to the font.
*
- * @param name
- * the name of the font
+ * @param name the name of the font
+ * @param embeddable {@code true} if the font is embeddable
*/
public RasterFont(String name, boolean embeddable) {
super(name, embeddable);
try {
nameBytes = name.getBytes(AFPConstants.EBCIDIC_ENCODING);
} catch (UnsupportedEncodingException usee) {
+ // @SuppressFBWarnings("DM_DEFAULT_ENCODING")
nameBytes = name.getBytes();
LOG.warn(
"Constructor:: UnsupportedEncodingException translating the name "
* structured field that defines the position of the image cell relative to
* the origin of the entire image. Each ICP also specifies the size of the
* image cell and a fill rectangle into which the cell is replicated.
- * <p/>
*/
public class IMImageObject extends AbstractNamedAFPObject {
* embedded in, the same page or page group. The Tag Logical Element structured
* field does not provide any presentation specifications and therefore has no
* effect on the appearance of a document when it is presented.
- * <p/>
*/
public class TagLogicalElement extends AbstractTripletStructuredObject {
try {
tleByteValue = attVal.getBytes(AFPConstants.EBCIDIC_ENCODING);
} catch (UnsupportedEncodingException usee) {
- tleByteValue = attVal.getBytes();
throw new IllegalArgumentException(attVal + " encoding failed");
}
System.arraycopy(tleByteValue, 0, data, 4, tleByteValue.length);
* @param linkTransform AffineTransform to properly place links,
* may be null
* @param g2d an AFPGraphics 2D implementation
+ * @param eventBroadCaster the associated event broadcaster
*/
public AFPBridgeContext(UserAgent userAgent, FontInfo fontInfo,
ImageManager imageManager, ImageSessionContext imageSessionContext,
import org.apache.fop.svg.AbstractFOPTextElementBridge;
/**
- * Bridge class for the <text> element.
+ * Bridge class for the <text> element.
* This bridge will use the direct text painter if the text
* for the element is simple.
*/
public class AFPTextElementBridge extends AbstractFOPTextElementBridge {
/**
- * Constructs a new bridge for the <text> element.
+ * Constructs a new bridge for the <text> element.
*
* @param textPainter the text painter to use
*/
/**
* Create a new text painter with the given font information.
* @param nativeTextHandler the NativeTextHandler instance used for text painting
+ * @param fopFontFamilyResolver the font resolver
*/
public AFPTextPainter(FOPTextHandler nativeTextHandler, FontFamilyResolver fopFontFamilyResolver) {
super(nativeTextHandler, new FOPStrokingTextPainter(fopFontFamilyResolver));
* components and to provide commands and information to applications using
* the data. Structured fields may contain one or more parameters. Each
* parameter provides one value from a set of values defined by the architecture.
- * <p/>
+ * <br>
* MO:DCA structured fields consist of two parts: an introducer that identifies
* the length and type of the structured field, and data that provides the
* structured field's effect. The data is contained in a set of parameters,
* which can consist of other data structures and data elements. The maximum
* length of a structured field is 32767 bytes.
- * <p/>
*/
public final class AFPResourceUtil {
import org.apache.fop.afp.fonts.FontRuntimeException;
/**
- * An entity resolver for both DOM and SAX models of the SAX document.
- * <p>
+ * An entity resolver for both DOM and SAX models of the SAX document.<br>
* The entity resolver only handles queries for the DTD. It will find any URI
* with a recognised public id and return an {@link org.xml.sax.InputSource}.
- * <p>
+ * <br>
*
* <p>This work was authored by Joe Schmetzer (joe@exubero.com).</p>
*/
* components and to provide commands and information to applications using
* the data. Structured fields may contain one or more parameters. Each
* parameter provides one value from a set of values defined by the architecture.
- * <p/>
+ * <br>
* MO:DCA structured fields consist of two parts: an introducer that identifies
* the length and type of the structured field, and data that provides the
* structured field's effect. The data is contained in a set of parameters,
* which can consist of other data structures and data elements. The maximum
* length of a structured field is 32767 bytes.
- * <p/>
*/
public class StructuredFieldReader {