/**
* Set a location associated with the exception.
- * @param location the locator holding the location.
+ * @param locator the locator holding the location.
*/
public void setLocator(Locator locator) {
if (locator != null) {
* id reference.
*
* @see org.apache.fop.area.Resolvable#resolveIDRef(String, List)
- * @todo check to make sure works when multiple bookmark-items
+ * @todo check to make sure it works if multiple bookmark-items
* have the same idref
*/
public void resolveIDRef(String id, List pages) {
/**
* Construct a coordinate transformation matrix (CTM).
* @param absRefOrient absolute reference orientation
- * @param writingmode the writing mode
+ * @param writingMode the writing mode
* @param absVPrect absolute viewpoint rectangle
* @param reldims relative dimensions
* @return CTM the coordinate transformation matrix (CTM)
/**
* Set the parent for the child area.
*
- * @see org.apache.fop.area.inline.Area#addChildArea(Area)
+ * @see org.apache.fop.area.Area#addChildArea(Area)
*/
public void addChildArea(Area childArea) {
super.addChildArea(childArea);
return 1.0;
}
- /** @see org.apache.fop.datatypes.PercentBase#getBaseLength() */
+ /**
+ * @see org.apache.fop.datatypes.PercentBase#getBaseLength(PercentBaseContext)
+ */
public int getBaseLength(PercentBaseContext context) throws PropertyException {
int baseLength = 0;
if (context != null) {
/**
* Returns the value of this numeric as an int.
- * @param conext The context for the length calculation (for percentage based lengths)
+ * @param context the context for the length calculation (for percentage based lengths)
* @return the value as an integer.
*/
public int getValue(PercentBaseContext context);
/**
* Returns the value for the given lengthBase.
- * @see org.apache.fop.datatypes.PercentBaseContext#getBaseLength(int, fobj)
+ * @see org.apache.fop.datatypes.PercentBaseContext#getBaseLength(int, FObj)
*/
public int getBaseLength(int lengthBase, FObj fobj) {
// if its for us return our value otherwise delegate to parent context
}
/**
- * Return the value.
- * @param Evaluation context
- * @see Numeric#getNumericValue(Object)
+ * @see Numeric#getNumericValue(PercentBaseContext)
*/
public double getNumericValue(PercentBaseContext context) {
return value;
}
/**
- * Return the value of this numeric as a length in millipoints.
+ * @see org.apache.fop.datatypes.Numeric#getValue()
*/
public int getValue() {
return (int) value;
}
/**
- * Return the value of this numeric as a length in millipoints.
- * @param Evaluation context
+ * @see org.apache.fop.datatypes.Numeric#getValue(PercentBaseContext)
*/
public int getValue(PercentBaseContext context) {
return (int) value;
/**
* Return the resolved (calculated) value of the expression.
- * @see Numeric#getNumericValue()
+ * @see org.apache.fop.datatypes.Numeric#getNumericValue()
*/
public double getNumericValue() throws PropertyException {
return getResolved(null).getNumericValue(null);
}
/**
- * Return the value.
- * @param Evaluation context
- * @see Numeric#getNumericValue(Object)
+ * @see org.apache.fop.datatypes.Numeric#getNumericValue(PercentBaseContext)
*/
public double getNumericValue(PercentBaseContext context) throws PropertyException {
return getResolved(context).getNumericValue(context);
}
/**
- * Return a resolved length.
+ * @see org.apache.fop.datatypes.Numeric#getValue()
*/
public int getValue() {
try {
}
/**
- * Return the value of this numeric as a length in millipoints.
- * @param Evaluation context
+ * @see org.apache.fop.datatypes.Numeric#getValue(PercentBaseContext)
*/
public int getValue(PercentBaseContext context) {
try {
}
/**
- * Return a string represention of the expression. Only used for debugging.
+ * Return a string represention of the expression. Only used for debugging.
+ * @return the string representation.
*/
public String toString() {
switch (operation) {
/**
* Sets the associated Declarations.
- * @param Declarations the Declarations to use
+ * @param declarations the Declarations to use
*/
public void setDeclarations(Declarations declarations) {
this.declarations = declarations;
public class BoxPropShorthandParser extends GenericShorthandParser {
/**
- * @see org.apache.fop.fo.GenericShorthandParser#GenericShorthandParser()
+ * Default constructor.
*/
public BoxPropShorthandParser() {
}
* Set the given property based on the number of values set.
* Example: padding, border-width, border-color, border-style, margin
* @see org.apache.fop.fo.GenericShorthandParser#convertValueForProperty(
- * int, ListProperty, PropertyMaker, PropertyList)
+ * int, Property, PropertyMaker, PropertyList)
*/
protected Property convertValueForProperty(int propId,
Property property,
public static class Maker extends PropertyMaker {
/**
- * @param propName name of property for which a Maker should be created
+ * @param propId the id of the property for which a Maker should be created
*/
public Maker(int propId) {
super(propId);
public static class Maker extends PropertyMaker {
/**
- * @param propName name of property for which a Maker should be created
+ * @param propId the id of the property for which a Maker should be created
*/
public Maker(int propId) {
super(propId);
* of compound property types, such as "space".
* Overridden by property maker subclasses which handle
* compound properties.
- * @param subprop The Constants ID of the component for which a Maker is to
+ * @param subpropId the id of the component for which a Maker is to
* returned, for example CP_OPTIMUM, if the FO attribute is
* space.optimum='10pt'.
* @return the Maker object specified
* the default value.
* @param subpropId The subproperty id of the property being retrieved.
* Is 0 when retriving a base property.
- * @param propertylist The PropertyList object being built for this FO.
+ * @param propertyList The PropertyList object being built for this FO.
* @param bTryInherit true if inherited properties should be examined.
* @param bTryDefault true if the default value should be returned.
*/
public static class Maker extends CompoundPropertyMaker {
/**
- * @param name of property for which a Maker should be created
+ * @param propId the id of the property for which a Maker should be created
*/
public Maker(int propId) {
super(propId);
}
/**
- * Returns the length in 1/1000ths of a point (millipoints)
- * @return the length in millipoints
+ * @see org.apache.fop.datatypes.Numeric#getValue()
*/
public int getValue() {
log.error("getValue() called on " + enumProperty + " length");
}
/**
- * Returns the length in 1/1000ths of a point (millipoints)
- * @param Evaluation context
- * @return the length in millipoints
+ * @see org.apache.fop.datatypes.Numeric#getValue(PercentBaseContext)
*/
public int getValue(PercentBaseContext context) {
log.error("getValue() called on " + enumProperty + " length");
}
/**
- * Returns the value as numeric.
- * @return the length in millipoints
+ * @see org.apache.fop.datatypes.Numeric#getNumericValue()
*/
public double getNumericValue() {
log.error("getNumericValue() called on " + enumProperty + " number");
}
/**
- * Returns the value as numeric.
- * @param context Evaluation context
- * @return the length in millipoints
+ * @see org.apache.fop.datatypes.Numeric#getNumericValue()
*/
public double getNumericValue(PercentBaseContext context) {
log.error("getNumericValue() called on " + enumProperty + " number");
public static class Maker extends PropertyMaker {
/**
- * @param propName name of property for which a Maker should be created
+ * @param propId the id of the property for which a Maker should be created
*/
public Maker(int propId) {
super(propId);
* @param unit input unit specifier (in, cm, etc.)
*/
protected void convert(double dvalue, String unit) {
+ // TODO: the whole routine smells fishy.
int assumedResolution = 1; // points/pixel
// Do nothing.
// dvalue = dvalue;
} else if (unit.equals("mpt")) { //mpt is non-standard!!! mpt=millipoints
+ // TODO: this seems to be wrong.
// Do nothing.
// dvalue = dvalue;
} else if (unit.equals("pc")) {
* dvalue = dvalue * fontsize;
*/
} else if (unit.equals("px")) {
+ // TODO: get resolution from user agent?
dvalue = dvalue * assumedResolution;
} else {
dvalue = 0;
}
/**
- * Returns the length in 1/1000ths of a point (millipoints)
- * @return the length in millipoints
+ * @see org.apache.fop.datatypes.Numeric#getValue()
*/
public int getValue() {
return millipoints;
}
/**
- * Returns the length in 1/1000ths of a point (millipoints)
- * @param Evaluation context
- * @return the length in millipoints
+ * @see org.apache.fop.datatypes.Numeric#getValue(PercentBaseContext)
*/
public int getValue(PercentBaseContext context) {
return millipoints;
}
/**
- * Returns the value as numeric.
- * @return the length in millipoints
- * @see Numeric#getNumericValue()
+ * @see org.apache.fop.datatypes.Numeric#getNumericValue()
*/
public double getNumericValue() {
return millipoints;
}
/**
- * Return the value of this Numeric.
- * @param context Evaluation context
- * @return the length in millipoints
- * @see Numeric#getNumericValue(Object)
+ * @see org.apache.fop.datatypes.Numeric#getNumericValue(PercentBaseContext)
*/
public double getNumericValue(PercentBaseContext context) {
return millipoints;
public static class Maker extends CompoundPropertyMaker {
/**
- * @param name name of property for which Maker should be created
+ * @param propId the id of the property for which a Maker should be created
*/
public Maker(int propId) {
super(propId);
private boolean autoOk = false;
/**
- * @param name name of property for which Maker should be created
+ * @param propId the id of the property for which a Maker should be created
*/
public Maker(int propId) {
super(propId);
public static class Maker extends CompoundPropertyMaker {
/**
- * @param name name of property for which to create Maker
+ * @param propId the id of the property for which a Maker should be created
*/
public Maker(int propId) {
super(propId);
/**
* A maker which calculates the line-height property.
- * This property maker is special because line-height inherit the specified
+ * This property maker is special because line-height inherits the specified
* value, instead of the computed value.
- * So when a line-height is create based on a attribute, the specified value
+ * So when a line-height is create based on an attribute, the specified value
* is stored in the property and in compute() the stored specified value of
* the nearest specified is used to recalculate the line-height.
*/
}
/**
- * @see SpaceProperty#convertProperty(Property, PropertyList, FObj)
+ * @see SpaceProperty.Maker#convertProperty(Property, PropertyList, FObj)
*/
public Property convertProperty(Property p,
PropertyList propertyList,
/**
* Constructor for NumberProperty.Maker
- * @param propName the name of the property
+ * @param propId the id of the property for which a Maker should be created
*/
public Maker(int propId) {
super(propId);
* Return the value of this Numeric.
* @param context Evaluation context
* @return The value as a double.
- * @see Numeric#getNumericValue(Object)
+ * @see Numeric#getNumericValue(PercentBaseContext)
*/
public double getNumericValue(PercentBaseContext context) {
return getNumericValue();
* Return the value
* @param context Evaluation context
* @return The value as an int.
- * @see Numeric#getValue(Object)
+ * @see Numeric#getValue(PercentBaseContext)
*/
public int getValue(PercentBaseContext context) {
return getValue();
}
/**
- * Return the value of this Numeric.
* @see org.apache.fop.datatypes.Numeric#getNumericValue()
*/
public double getNumericValue() {
}
/**
- * Return the value of this Numeric.
- * @param context Evaluation context
- * @return the length in millipoints
- * @see Numeric#getNumericValue(Object)
+ * @see org.apache.fop.datatypes.Numeric#getNumericValue(PercentBaseContext)
*/
public double getNumericValue(PercentBaseContext context) {
try {
}
/**
- * Return the value of this numeric as a length in millipoints.
- * @param Evaluation context
+ * @see org.apache.fop.datatypes.Numeric#getValue(PercentBaseContext)
*/
public int getValue(PercentBaseContext context) {
return (int) getNumericValue(context);
/**
* Set the shorthand datatype parser.
- * @param subproperty
+ * @param parser the shorthand parser
*/
public void setDatatypeParser(ShorthandParser parser) {
datatypeParser = parser;
}
/**
- * Set the byShorthand flag which only is applicable for subproperty
+ * Set the setByShorthand flag which only is applicable for subproperty
* makers. It should be true for the subproperties which must be
* assigned a value when the base property is assigned a attribute
* value directly.
- * @param defaultValue
+ * @param setByShorthand
*/
public void setByShorthand(boolean setByShorthand) {
this.setByShorthand = setByShorthand;
* the default value.
* @param subpropId The subproperty id of the property being retrieved.
* Is 0 when retriving a base property.
- * @param propertylist The PropertyList object being built for this FO.
+ * @param propertyList The PropertyList object being built for this FO.
* @param bTryInherit true if inherited properties should be examined.
* @param bTryDefault true if the default value should be returned.
*/
* property.
* @param p A property value for a compound property type such as
* SpaceProperty.
- * @param subprop The Constants ID of the component whose value is to be
+ * @param subpropId the id of the component whose value is to be
* returned.
* NOTE: this is only to ease porting when calls are made to
* PropertyList.get() using a component name of a compound property,
* initializers "thin", "medium", or "thick". The FOPropertyMapping
* file specifies a length value equivalent for these keywords,
* such as "0.5pt" for "thin".
- * @param value The string value of property attribute.
- * @return A String containging a parseable equivalent or null if
+ * @param keyword the string value of property attribute.
+ * @return a String containing a parseable equivalent or null if
* the passed value isn't a keyword initializer for this Property.
*/
protected String checkValueKeywords(String keyword) {
return value;
}
}
+ // TODO: should return null here?
return keyword;
}
public static class Maker extends CompoundPropertyMaker {
/**
- * @param name name of the property whose Maker is to be created
+ * @param propId the id of the property for which a Maker should be created
*/
public Maker(int propId) {
super(propId);
public static class Maker extends PropertyMaker {
/**
- * @param propName name of property for which to create a Maker
+ * @param propId the id of the property for which a Maker should be created
*/
public Maker(int propId) {
super(propId);
}
/**
- * Return the value of this Numeric.
- * @param context Evaluation context
- * @return the value
- * @see Numeric#getNumericValue(Object)
+ * @see org.apache.fop.datatypes.Numeric#getNumericValue(PercentBaseContext)
*/
public double getNumericValue(PercentBaseContext context) {
return getNumericValue();
}
/**
- * Returns the length in 1/1000ths of a point (millipoints)
- * @param Evaluation context
- * @return the length in millipoints
+ * @see org.apache.fop.datatypes.Numeric#getValue(PercentBaseContext)
*/
public int getValue(PercentBaseContext context) {
return getValue();
}
/**
- * Add fonts from configuration file starting with
- * internalnames F<num>
+ * Add fonts from configuration file starting with internal name F<num>.
* @param fontInfo the font info object to set up
- * @param fontInfos ???
+ * @param fontInfoList
* @param num starting index for internal font numbering
*/
public static void addConfiguredFonts(FontInfo fontInfo, List fontInfoList, int num) {
private int contentAreaIPD = 0;
/**
- * @param the fo this LM deals with
+ * @param node the fo this LM deals with
*/
public BlockStackingLayoutManager(FObj node) {
super(node);
* Create a new KnuthElement.
* This class being abstract, this can be called only by subclasses.
*
- * @param t the type of this element (one of the KNUTH_* constants)
* @param w the width of this element
* @param pos the Position stored in this element
* @param bAux is this an auxiliary element?
/**
* Constructor
* @param node the formatting object that creates this area
- * @param parent the parent layout manager
*/
public AbstractGraphicsLayoutManager(AbstractGraphics node) {
super(node);
* to take the border/padding into account as well.
* @param area the inline area to be updated
* @param context the layout context used for adding the area
- * @see LeafNodeLayoutManager#offsetArea(InlineArae, LayoutContext)
+ * @see LeafNodeLayoutManager#offsetArea(InlineArea, LayoutContext)
*/
protected void offsetArea(InlineArea area, LayoutContext context) {
int bpd = area.getBPD()
this.parentLM = pslm;
holder = new LineArea();
- setUserAgent(foTitle.getUserAgent());
+ // setUserAgent(foTitle.getUserAgent());
// use special layout manager to add the inline areas
// to the Title.
*
* @param ua the user agent
*/
- public void setUserAgent(FOUserAgent ua) {
- userAgent = ua;
- }
+// public void setUserAgent(FOUserAgent ua) {
+// userAgent = ua;
+// }
/**
* @see org.apache.fop.layoutmgr.LayoutManager#getUserAgent()
*/
- public FOUserAgent getUserAgent() {
- return userAgent;
- }
+// public FOUserAgent getUserAgent() {
+// return userAgent;
+// }
- /** @see org.apache.fop.layoutmgr.LayoutManager */
+ /**
+ * @see org.apache.fop.layoutmgr.LayoutManager#setParent(LayoutManager)
+ */
public void setParent(LayoutManager lm) {
parentLM = lm;
}
return this.parentLM;
}
- /** @see org.apache.fop.layoutmgr.LayoutManager */
+ /**
+ * @see org.apache.fop.layoutmgr.LayoutManager#isFinished()
+ */
public boolean isFinished() {
return false;
}
- /** @see org.apache.fop.layoutmgr.LayoutManager */
+ /**
+ * @see org.apache.fop.layoutmgr.LayoutManager#setFinished(boolean)
+ */
public void setFinished(boolean isFinished) {
//to be done
}
- /** @see org.apache.fop.layoutmgr.LayoutManager */
+ /**
+ * @see org.apache.fop.layoutmgr.LayoutManager#resetPosition(Position)
+ */
public void resetPosition(Position position) {
//to be done
}
/**
- * @see org.apache.fop.layoutmgr.LayoutManager#createNextChildLMs
+ * @see org.apache.fop.layoutmgr.LayoutManager#createNextChildLMs(int)
*/
public boolean createNextChildLMs(int pos) {
return false;
}
/**
- * @see org.apache.fop.layoutmgr.LayoutManager#getChildLMs
+ * @see org.apache.fop.layoutmgr.LayoutManager#getChildLMs()
*/
public List getChildLMs() {
List childLMs = new ArrayList(1);
return inlineProps.spaceEnd;
}
- /** @see org.apache.fop.layoutmgr.inline.InlineStackingLayoutManager#createArea() */
+ /** @see org.apache.fop.layoutmgr.inline.InlineLayoutManager#createArea(boolean) */
protected InlineArea createArea(boolean bInlineParent) {
InlineArea area;
if (bInlineParent) {
* @param str the string for the TextArea
* @param width the MinOptMax width of the content
* @param adjust the total ipd adjustment with respect to the optimal width
- * @param base the baseline position
- * @return the new word area
+ * @param context the layout context
+ * @param spaceDiff unused
+ * @return the new text area
*/
protected TextArea createTextArea(String str, MinOptMax width, int adjust,
LayoutContext context, int spaceDiff) {
/**
* Create a new list block layout manager.
* @param node list-block to create the layout manager for
- * @param parent the parent layout manager
*/
public ListBlockLayoutManager(ListBlock node) {
super(node);
//public static final int FIRST_ROW_IN_GROUP = 4;
/** Indicates that the cell is/end in the last row of a body/table-header/table-footer */
//public static final int LAST_ROW_IN_GROUP = 8;
-
+
+ // TODO: this is not MT safe. Must be removed.
private static CollapsingBorderModel collapse = null;
private static CollapsingBorderModel collapseWithPrecedence = null;
/**
- * @param cellLM the cell
+ * @param borderCollapse border collapse control
* @return the border model for the cell
*/
public static CollapsingBorderModel getBorderModelFor(int borderCollapse) {
// --------- Property Resolution related functions --------- //
/**
- * @see org.apache.fop.datatypes.PercentBaseContext#getBaseLength(int, fobj)
+ * @see org.apache.fop.datatypes.PercentBaseContext#getBaseLength(int, FObj)
*/
public int getBaseLength(int lengthBase, FObj fobj) {
return tableLM.getBaseLength(lengthBase, fobj);
* the necessary cryptographic support is available.
* @param params the PDF encryption params or null to disable encryption
* @param pdf the PDF document to setup encryption for
- * @param log the logger to send warnings to
*/
public static void setupPDFEncryption(PDFEncryptionParams params,
PDFDocument pdf) {
}
}
- /** @return The 0-based current page number */
+ /**
+ * @return The 0-based current page number
+ */
public int getCurrentPageNumber() {
return currentPageNumber;
}
- /** @param The 0-based current page number */
+ /**
+ * @param c the 0-based current page number
+ */
public void setCurrentPageNumber(int c) {
this.currentPageNumber = c;
}
- /** @return The 0-based total number of rendered pages */
+ /**
+ * @return The 0-based total number of rendered pages
+ */
public int getNumberOfPages() {
return numberOfPages;
}
- /** clears the ViewportList, in case the document is reloaded */
+ /**
+ * Clears the ViewportList.
+ * Used if the document is reloaded.
+ */
public void clearViewportList() {
pageViewportList.clear();
setCurrentPageNumber(0);
*/
public void renderPage(PageViewport pageViewport)
throws IOException, FOPException {
- pageViewportList.add(pageViewport.clone()); // FIXME clone
+ // TODO clone
+ pageViewportList.add(pageViewport.clone());
currentPageNumber++;
}
* Draw the background and borders. This draws the background and border
* traits for an area given the position.
*
- * @param block the area to get the traits from
+ * @param area the area whose traits are used
* @param startx the start x position
* @param starty the start y position
* @param width the width of the area
/**
* Creates a new SVGUserAgent.
- * @param log an Commons logging instance
- * @param pixelUnitToMM The pixel to millimeter conversion factor
- * currently in effect
+ * @param pixelUnitToMM the pixel to millimeter conversion factor
+ * currently in effect
* @param at the current transform
*/
public SVGUserAgent(float pixelUnitToMM, AffineTransform at) {
/**
* Compares two files to see if they are equal
- * @param true if files are same, false otherwise
+ * @param f1 first file to compare
+ * @param f2 second file to compare
+ * @return true if files are same, false otherwise
*/
public static boolean compareFiles(File f1, File f2) throws IOException {
return (compareFileSize(f1, f2) && compareBytes(f1, f2));
}
/**
- * Does a byte compare of two files
+ * Compare the contents of two files.
* @param true if files are same byte-by-byte, false otherwise
*/
private static boolean compareBytes(File file1, File file2) throws IOException {
* @param max the maximum value
*/
public MinOptMax(int min, int opt, int max) {
+ // TODO: assert min<=opt<=max
this.min = min;
this.opt = opt;
this.max = max;
}
/**
- * New min/opt/max with the three values.
+ * Copy constructor.
*
- * @param min the minimum value
- * @param opt the optimum value
- * @param max the maximum value
+ * @param op the MinOptMax object to copy
*/
public MinOptMax(MinOptMax op) {
this.min = op.min;
this.max = op.max;
}
+ // TODO: remove this.
/**
* @see java.lang.Object#clone()
*/
* @return MinOptMax new instance
*/
public static MinOptMax multiply(MinOptMax op1, double mult) {
+ // TODO: assert mult>0
return new MinOptMax((int)(op1.min * mult),
(int)(op1.opt * mult), (int)(op1.max * mult));
}
}
/**
- * Adds another MinOptMax instance to this one.
- * @param op the other instance
+ * Adds min, opt and max to their counterpart components.
+ * @param min the value to add to the minimum value
+ * @param opt the value to add to the optimum value
+ * @param max the value to add to the maximum value
*/
public void add(int min, int opt, int max) {
this.min += min;
this.opt += opt;
this.max += max;
+ // TODO: assert min<=opt<=max
}
/**
- * Adds another MinOptMax instance to this one.
- * @param op the other instance
+ * Adds a length to all components.
+ * @param len the length to add
*/
public void add(int len) {
this.min += len;
/**
- * Subtracts from this instance using another.
+ * Subtracts another MinOptMax instance from this one.
* @param op the other instance
*/
public void subtract(MinOptMax op) {