* @param charSet is the AFP Character Set to use with the text
* @throws UnsupportedEncodingException thrown if character encoding is not supported
*/
- public void createText
- ( final AFPTextDataInfo textDataInfo, final int letterSpacing, final int wordSpacing,
- final Font font, final CharacterSet charSet) throws UnsupportedEncodingException {
+ public void createText(final AFPTextDataInfo textDataInfo, final int letterSpacing,
+ final int wordSpacing, final Font font, final CharacterSet charSet)
+ throws UnsupportedEncodingException {
int rotation = paintingState.getRotation();
if (rotation != 0) {
textDataInfo.setRotation(rotation);
}
/**
- * Sets the data for the the object container
+ * Sets the data for the object container
*
* @param data a byte array
*/
* Numerics can be either absolute or relative. Relative numerics
* must be resolved against base value before the value can be used.
* <p>
- * To support relative numerics internally in the expresion parser and
- * during evaulation one additional methods exists: isAbsolute() which
+ * To support relative numerics internally in the expression parser and
+ * during evaluation one additional methods exists: isAbsolute() which
* return true for absolute numerics and false for relative numerics.
*/
public interface Numeric {
/**
* Return the value of this Numeric
* @return the computed value.
- * @throws PropertyException if a propert exception occurs
+ * @throws PropertyException if a property exception occurs
*/
double getNumericValue() throws PropertyException;
* Return the value of this Numeric
* @param context The context for the length calculation (for percentage based lengths)
* @return the computed value.
- * @throws PropertyException if a propert exception occurs
+ * @throws PropertyException if a property exception occurs
*/
double getNumericValue(PercentBaseContext context) throws PropertyException;
int getValue(PercentBaseContext context);
/**
- * Return the resolved value. This method will becalled during evaluation
+ * Return the resolved value. This method will be called during evaluation
* of the expression tree and relative numerics can then return a
- * resolved absolute Numeric. Absolute numerics can just return themself.
+ * resolved absolute Numeric. Absolute numerics can just return themselves.
*
* @return A resolved value.
* @throws PropertyException
package org.apache.fop.fo.expr;
-import org.apache.fop.datatypes.PercentBaseContext;
import org.apache.fop.datatypes.Numeric;
+import org.apache.fop.datatypes.PercentBaseContext;
/**
* This class contains static methods to evaluate operations on Numeric
* @throws PropertyException If the dimension of the operand is different
* from the dimension of this Numeric.
*/
- public static Numeric addition(Numeric op1, Numeric op2)
- throws PropertyException {
+ public static Numeric addition(Numeric op1, Numeric op2) throws PropertyException {
if (op1.isAbsolute() && op2.isAbsolute()) {
return addition2(op1, op2, null);
} else {
* @throws PropertyException If the dimension of the operand is different
* from the dimension of this Numeric.
*/
- public static Numeric subtraction(Numeric op1, Numeric op2)
- throws PropertyException {
+ public static Numeric subtraction(Numeric op1, Numeric op2) throws PropertyException {
if (op1.isAbsolute() && op2.isAbsolute()) {
return subtraction2(op1, op2, null);
} else {
* from the dimension of this Numeric.
*/
public static Numeric subtraction2(Numeric op1, Numeric op2, PercentBaseContext context)
- throws PropertyException {
+ throws PropertyException {
if (op1.getDimension() != op2.getDimension()) {
throw new PropertyException("Can't subtract Numerics of different dimensions");
}
* @throws PropertyException If the dimension of the operand is different
* from the dimension of this Numeric.
*/
- public static Numeric multiply(Numeric op1, Numeric op2)
- throws PropertyException {
+ public static Numeric multiply(Numeric op1, Numeric op2) throws PropertyException {
if (op1.isAbsolute() && op2.isAbsolute()) {
return multiply2(op1, op2, null);
} else {
* from the dimension of this Numeric.
*/
public static Numeric multiply2(Numeric op1, Numeric op2, PercentBaseContext context)
- throws PropertyException {
+ throws PropertyException {
return numeric(op1.getNumericValue(context) * op2.getNumericValue(context),
op1.getDimension() + op2.getDimension());
}
* from the dimension of this Numeric.
*/
public static Numeric divide2(Numeric op1, Numeric op2, PercentBaseContext context)
- throws PropertyException {
+ throws PropertyException {
return numeric(op1.getNumericValue(context) / op2.getNumericValue(context),
op1.getDimension() - op2.getDimension());
}
* @return A new Numeric object representing the absolute value.
* @throws PropertyException if a property exception occurs
*/
- public static Numeric modulo(Numeric op1, Numeric op2)
- throws PropertyException {
+ public static Numeric modulo(Numeric op1, Numeric op2) throws PropertyException {
if (op1.isAbsolute() && op2.isAbsolute()) {
return modulo2(op1, op2, null);
} else {
* from the dimension of this Numeric.
*/
public static Numeric modulo2(Numeric op1, Numeric op2, PercentBaseContext context)
- throws PropertyException {
+ throws PropertyException {
return numeric(op1.getNumericValue(context)
% op2.getNumericValue(context), op1.getDimension());
}
* @return a new Numeric object representing the absolute value of the operand.
* @throws PropertyException if a property exception occurs
*/
- public static Numeric abs(Numeric op)
- throws PropertyException {
+ public static Numeric abs(Numeric op) throws PropertyException {
if (op.isAbsolute()) {
return abs2(op, null);
} else {
* @throws PropertyException If the dimension of the operand is different
* from the dimension of this Numeric.
*/
- public static Numeric abs2(Numeric op, PercentBaseContext context)
- throws PropertyException {
+ public static Numeric abs2(Numeric op, PercentBaseContext context) throws PropertyException {
return numeric(Math.abs(op.getNumericValue(context)), op.getDimension());
}
* @return a new Numeric object representing the negation of the operand.
* @throws PropertyException if a property exception occurs
*/
- public static Numeric negate(Numeric op)
- throws PropertyException {
+ public static Numeric negate(Numeric op) throws PropertyException {
if (op.isAbsolute()) {
return negate2(op, null);
} else {
* @throws PropertyException If the dimension of the operand is different
* from the dimension of this Numeric.
*/
- public static Numeric negate2(Numeric op, PercentBaseContext context)
- throws PropertyException {
+ public static Numeric negate2(Numeric op, PercentBaseContext context) throws PropertyException {
return numeric(-op.getNumericValue(context), op.getDimension());
}
* @return a Numeric which is the maximum of the two operands.
* @throws PropertyException if the dimensions or value types of the operands are different.
*/
- public static Numeric max(Numeric op1, Numeric op2)
- throws PropertyException {
+ public static Numeric max(Numeric op1, Numeric op2) throws PropertyException {
if (op1.isAbsolute() && op2.isAbsolute()) {
return max2(op1, op2, null);
} else {
* from the dimension of this Numeric.
*/
public static Numeric max2(Numeric op1, Numeric op2, PercentBaseContext context)
- throws PropertyException {
+ throws PropertyException {
if (op1.getDimension() != op2.getDimension()) {
throw new PropertyException("Arguments to max() must have same dimensions");
}
* @return a Numeric which is the minimum of the two operands.
* @throws PropertyException if the dimensions or value types of the operands are different.
*/
- public static Numeric min(Numeric op1, Numeric op2)
- throws PropertyException {
+ public static Numeric min(Numeric op1, Numeric op2) throws PropertyException {
if (op1.isAbsolute() && op2.isAbsolute()) {
return min2(op1, op2, null);
} else {
* from the dimension of this Numeric.
*/
public static Numeric min2(Numeric op1, Numeric op2, PercentBaseContext context)
- throws PropertyException {
+ throws PropertyException {
if (op1.getDimension() != op2.getDimension()) {
throw new PropertyException("Arguments to min() must have same dimensions");
}
*/
i = 1;
}
- TableEventProducer eventProducer
- = TableEventProducer.Provider.get(fo.getUserAgent().getEventBroadcaster());
- eventProducer.forceNextColumnNumber
- (this, propertyList.getFObj().getName(),
- val, i, propertyList.getFObj().getLocator());
+ TableEventProducer eventProducer = TableEventProducer.Provider.get(
+ fo.getUserAgent().getEventBroadcaster());
+ eventProducer.forceNextColumnNumber(this, propertyList.getFObj().getName(),
+ val, i, propertyList.getFObj().getLocator());
}
return NumberProperty.getInstance(i);
}
}
/** {@inheritDoc} */
- public void processNode
- (String elementName, Locator locator, Attributes attlist, PropertyList pList)
- throws FOPException {
+ public void processNode(String elementName, Locator locator, Attributes attlist,
+ PropertyList pList) throws FOPException {
super.processNode(elementName, locator, attlist, pList);
Table table = getTable();
if (!inMarker() && !table.isSeparateBorderModel()) {
* @throws IllegalArgumentException for negative additional page counts
*/
public void notifyPageSequenceFinished(int lastPageNumber, int additionalPages)
- throws IllegalArgumentException {
+ throws IllegalArgumentException {
if (additionalPages >= 0) {
totalPagesGenerated += additionalPages;
* to "50%".
*/
public Property make(PropertyList propertyList, String value, FObj fo)
- throws PropertyException {
+ throws PropertyException {
Property p = super.make(propertyList, value, fo);
if (p.getList().size() == 1) {
/* only background-position-horizontal specified
* {@inheritDoc}
*/
- public Property get(int subpropId, PropertyList propertyList,
- boolean bTryInherit, boolean bTryDefault)
- throws PropertyException {
+ public Property get(int subpropId, PropertyList propertyList, boolean bTryInherit,
+ boolean bTryDefault) throws PropertyException {
Property p = super.get(subpropId, propertyList,
bTryInherit, bTryDefault);
* @see ColorUtil#parseColorString(FOUserAgent, String)
*/
public static ColorProperty getInstance(FOUserAgent foUserAgent, String value)
- throws PropertyException {
+ throws PropertyException {
ColorProperty instance = new ColorProperty(
ColorUtil.parseColorString(
foUserAgent, value));
* @throws PropertyException if a a property exception occurs
*/
public static CommonHyphenation getInstance(PropertyList propertyList)
- throws PropertyException {
+ throws PropertyException {
StringProperty language
= (StringProperty) propertyList.get(Constants.PR_LANGUAGE);
StringProperty country
* @return the property
* @throws PropertyException if a property exception occurs
*/
- public Property get(int subpropertyId, PropertyList propertyList,
- boolean tryInherit, boolean tryDefault)
- throws PropertyException {
+ public Property get(int subpropertyId, PropertyList propertyList, boolean tryInherit,
+ boolean tryDefault) throws PropertyException {
Property p = super.get(subpropertyId, propertyList, tryInherit, tryDefault);
if (subpropertyId != 0 && p != null) {
p = getSubprop(p, subpropertyId);
* @throws PropertyException ...
*/
protected Property makeCompound(PropertyList propertyList, FObj parentFO)
- throws PropertyException {
+ throws PropertyException {
Property p = makeNewProperty();
CompoundDatatype data = (CompoundDatatype) p.getObject();
for (int i = 0; i < Constants.COMPOUND_COUNT; i++) {
* {@inheritDoc}
*/
public Property make(PropertyList propertyList, String value, FObj fo)
- throws PropertyException {
+ throws PropertyException {
if ("inherit".equals(value)) {
return super.make(propertyList, value, fo);
} else {
* it is immediately replaced by the resolved {@link FixedLength}.
*/
public Property make(PropertyList propertyList, String value, FObj fo)
- throws PropertyException {
+ throws PropertyException {
Property p = super.make(propertyList, value, fo);
if (p instanceof PercentLength) {
Property pp = propertyList.getFromParent(this.propId);
* {@inheritDoc}
*/
public Property convertProperty(Property p, PropertyList propertyList, FObj fo)
- throws PropertyException {
+ throws PropertyException {
if (p instanceof KeepProperty) {
return p;
}
* Return the default or user-defined fallback in case the value
* was specified as "auto"
* @param subpropId The subproperty id of the property being retrieved.
- * Is 0 when retriving a base property.
+ * Is 0 when retrieving a base property.
* @param propertyList The PropertyList object being built for this FO.
* @param tryInherit true if inherited properties should be examined.
* @param tryDefault true if the default value should be returned.
import org.apache.fop.fo.PropertyList;
/**
- * A special property for representing an as yet implemented implemented property.
+ * A special property for representing an as yet unimplemented property.
*/
public class ToBeImplementedProperty extends Property {
*/
private boolean needBlankPageBeforeNew(int breakVal) {
if (breakVal == Constants.EN_PAGE
- || (pslm.getCurrentPage().getPageViewport().getPage().isEmpty())) {
+ || (pslm.getCurrentPage().getPageViewport().getPage().isEmpty())) {
// any page is OK or we already have an empty page
return false;
} else {
package org.apache.fop.tools.anttasks;
// Ant
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.DirectoryScanner;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.Task;
-import org.apache.tools.ant.types.FileSet;
-import org.apache.tools.ant.util.GlobPatternMapper;
-
-// Java
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.IOException;
import java.util.List;
import java.util.Vector;
-// FOP
+import org.xml.sax.SAXException;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.impl.SimpleLog;
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.DirectoryScanner;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.Task;
+import org.apache.tools.ant.types.FileSet;
+import org.apache.tools.ant.util.GlobPatternMapper;
+
import org.apache.fop.apps.FOPException;
import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.apps.FopFactory;
import org.apache.fop.apps.MimeConstants;
import org.apache.fop.cli.InputHandler;
-import org.apache.commons.logging.impl.SimpleLog;
-import org.apache.commons.logging.Log;
-import org.xml.sax.SAXException;
-
/**
* Wrapper for FOP which allows it to be accessed from within an Ant task.
* Accepts the inputs:
}
/**
- * Sets the XSLT parameters
+ * Sets the XSLT parameters
* @param xsltParams the XSLT parameters
*/
public void setXsltParams(String xsltParams) {
/**
* Set whether exceptions are thrown.
* default is false.
- * @param throwExceptions true if should be thrown
+ * @param throwExceptions true if exceptions should be thrown
*/
public void setThrowexceptions(boolean throwExceptions) {
this.throwExceptions = throwExceptions;
// OR output file doesn't exist OR
// output file is older than input file
if (task.getForce() || !outf.exists()
- || (task.getXmlFile().lastModified() > outf.lastModified()
+ || (task.getXmlFile().lastModified() > outf.lastModified()
|| task.getXsltFile().lastModified() > outf.lastModified())) {
render(task.getXmlFile(), task.getXsltFile(), outf, outputFormat);
actioncount++;
}
}
- private void renderInputHandler
- (InputHandler inputHandler, File outFile, String outputFormat) throws Exception {
+ private void renderInputHandler(InputHandler inputHandler, File outFile, String outputFormat)
+ throws Exception {
OutputStream out = null;
try {
out = new java.io.FileOutputStream(outFile);
* @return the corresponding instance
* @throws IllegalArgumentException if <code>min > opt || max < opt</code>.
*/
- public static MinOptMax getInstance(int min, int opt, int max)
- throws IllegalArgumentException {
+ public static MinOptMax getInstance(int min, int opt, int max) throws IllegalArgumentException {
if (min > opt) {
throw new IllegalArgumentException("min (" + min + ") > opt (" + opt + ")");
}
* @throws ArithmeticException if this instance has strictly less shrink or stretch
* than the operand
*/
- public MinOptMax minus(MinOptMax operand)
- throws ArithmeticException {
+ public MinOptMax minus(MinOptMax operand) throws ArithmeticException {
checkCompatibility(getShrink(), operand.getShrink(), "shrink");
checkCompatibility(getStretch(), operand.getStretch(), "stretch");
return new MinOptMax(min - operand.min, opt - operand.opt, max - operand.max);
}
/**
- * Returns an instance with the given value added to the minimal value.
+ * Do not use, backwards compatibility only. Returns an instance with the
+ * given value added to the minimal value.
*
* @param minOperand the minimal value to be added.
* @return an instance with the given value added to the minimal value.
- * @throws IllegalArgumentException if <code>min + minOperand > opt || max < opt</code>.
+ * @throws IllegalArgumentException if
+ * <code>min + minOperand > opt || max < opt</code>.
*/
- // [GA] remove deprecation - no alternative specified
- // @deprecated Do not use! It's only for backwards compatibility.
- public MinOptMax plusMin(int minOperand)
- throws IllegalArgumentException {
+ public MinOptMax plusMin(int minOperand) throws IllegalArgumentException {
return getInstance(min + minOperand, opt, max);
}
/**
- * Returns an instance with the given value subtracted to the minimal value.
+ * Do not use, backwards compatibility only. Returns an instance with the
+ * given value subtracted to the minimal value.
*
* @param minOperand the minimal value to be subtracted.
* @return an instance with the given value subtracted to the minimal value.
- * @throws IllegalArgumentException if <code>min - minOperand > opt || max < opt</code>.
+ * @throws IllegalArgumentException if
+ * <code>min - minOperand > opt || max < opt</code>.
*/
- // [GA] remove deprecation - no alternative specified
- // @deprecated Do not use! It's only for backwards compatibility.
- public MinOptMax minusMin(int minOperand)
- throws IllegalArgumentException {
+ public MinOptMax minusMin(int minOperand) throws IllegalArgumentException {
return getInstance(min - minOperand, opt, max);
}
/**
- * Returns an instance with the given value added to the maximal value.
+ * Do not use, backwards compatibility only. Returns an instance with the
+ * given value added to the maximal value.
*
* @param maxOperand the maximal value to be added.
* @return an instance with the given value added to the maximal value.
- * @throws IllegalArgumentException if <code>min > opt || max < opt + maxOperand</code>.
+ * @throws IllegalArgumentException if
+ * <code>min > opt || max < opt + maxOperand</code>.
*/
- // [GA] remove deprecation - no alternative specified
- // @deprecated Do not use! It's only for backwards compatibility.
- public MinOptMax plusMax(int maxOperand)
- throws IllegalArgumentException {
+ public MinOptMax plusMax(int maxOperand) throws IllegalArgumentException {
return getInstance(min, opt, max + maxOperand);
}
/**
- * Returns an instance with the given value subtracted to the maximal value.
+ * Do not use, backwards compatibility only. Returns an instance with the
+ * given value subtracted to the maximal value.
*
* @param maxOperand the maximal value to be subtracted.
* @return an instance with the given value subtracted to the maximal value.
- * @throws IllegalArgumentException if <code>min > opt || max < opt - maxOperand</code>.
+ * @throws IllegalArgumentException if
+ * <code>min > opt || max < opt - maxOperand</code>.
*/
- // [GA] remove deprecation - no alternative specified
- // @deprecated Do not use! It's only for backwards compatibility.
- public MinOptMax minusMax(int maxOperand)
- throws IllegalArgumentException {
+ public MinOptMax minusMax(int maxOperand) throws IllegalArgumentException {
return getInstance(min, opt, max - maxOperand);
}
* @return the product of this <code>MinOptMax</code> and the given factor
* @throws IllegalArgumentException if the factor is negative
*/
- public MinOptMax mult(int factor)
- throws IllegalArgumentException {
+ public MinOptMax mult(int factor) throws IllegalArgumentException {
if (factor < 0) {
throw new IllegalArgumentException("factor < 0; was: " + factor);
} else if (factor == 1) {