diff options
author | Vincent Hennebert <vhennebert@apache.org> | 2008-07-24 09:35:34 +0000 |
---|---|---|
committer | Vincent Hennebert <vhennebert@apache.org> | 2008-07-24 09:35:34 +0000 |
commit | 92df262a0778ee539c849454be2810621dac1b7e (patch) | |
tree | d5be9359cbacb91dffcab6f1a6ecfe61e9db2c6b /src/java/org/apache/fop/fo/expr | |
parent | 30e2ce5bee38cbc32758e0b65fa7f98f3db76baa (diff) | |
download | xmlgraphics-fop-92df262a0778ee539c849454be2810621dac1b7e.tar.gz xmlgraphics-fop-92df262a0778ee539c849454be2810621dac1b7e.zip |
Fed up with all those trailing whitespaces. Let's remove them all (once... and for all?)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@679326 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/fo/expr')
27 files changed, 154 insertions, 154 deletions
diff --git a/src/java/org/apache/fop/fo/expr/AbsFunction.java b/src/java/org/apache/fop/fo/expr/AbsFunction.java index 64936459f..0e8355faa 100644 --- a/src/java/org/apache/fop/fo/expr/AbsFunction.java +++ b/src/java/org/apache/fop/fo/expr/AbsFunction.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/src/java/org/apache/fop/fo/expr/BodyStartFunction.java b/src/java/org/apache/fop/fo/expr/BodyStartFunction.java index a1c0259fa..eb68b2a23 100644 --- a/src/java/org/apache/fop/fo/expr/BodyStartFunction.java +++ b/src/java/org/apache/fop/fo/expr/BodyStartFunction.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/src/java/org/apache/fop/fo/expr/CMYKcolorFunction.java b/src/java/org/apache/fop/fo/expr/CMYKcolorFunction.java index 3aab1325d..fe86860f4 100644 --- a/src/java/org/apache/fop/fo/expr/CMYKcolorFunction.java +++ b/src/java/org/apache/fop/fo/expr/CMYKcolorFunction.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.fo.expr; import org.apache.fop.apps.FOUserAgent; import org.apache.fop.fo.properties.ColorProperty; @@ -26,22 +26,22 @@ import org.apache.fop.fo.properties.Property; * Implements the cmyk() function. */ class CMYKcolorFunction extends FunctionBase { - + /** - * cmyk takes four arguments. - * {@inheritDoc} + * cmyk takes four arguments. + * {@inheritDoc} */ public int nbArgs() { return 4; } - + /** {@inheritDoc} */ public Property eval(Property[] args, PropertyInfo pInfo) throws PropertyException { StringBuffer sb = new StringBuffer(); sb.append("cmyk(" + args[0] + "," + args[1] + "," + args[2] + "," + args[3] + ")"); - FOUserAgent ua = (pInfo == null) - ? null + FOUserAgent ua = (pInfo == null) + ? null : (pInfo.getFO() == null ? null : pInfo.getFO().getUserAgent()); return ColorProperty.getInstance(ua, sb.toString()); } diff --git a/src/java/org/apache/fop/fo/expr/CeilingFunction.java b/src/java/org/apache/fop/fo/expr/CeilingFunction.java index 29ac1940a..875c88751 100644 --- a/src/java/org/apache/fop/fo/expr/CeilingFunction.java +++ b/src/java/org/apache/fop/fo/expr/CeilingFunction.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.fo.expr; import org.apache.fop.fo.properties.NumberProperty; diff --git a/src/java/org/apache/fop/fo/expr/FloorFunction.java b/src/java/org/apache/fop/fo/expr/FloorFunction.java index 9cdbf1a28..043473140 100644 --- a/src/java/org/apache/fop/fo/expr/FloorFunction.java +++ b/src/java/org/apache/fop/fo/expr/FloorFunction.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.fo.expr; import org.apache.fop.fo.properties.NumberProperty; diff --git a/src/java/org/apache/fop/fo/expr/FromParentFunction.java b/src/java/org/apache/fop/fo/expr/FromParentFunction.java index b09d3c95f..b1e9d689d 100644 --- a/src/java/org/apache/fop/fo/expr/FromParentFunction.java +++ b/src/java/org/apache/fop/fo/expr/FromParentFunction.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/src/java/org/apache/fop/fo/expr/FromTableColumnFunction.java b/src/java/org/apache/fop/fo/expr/FromTableColumnFunction.java index 66cafc2ac..df84939f1 100644 --- a/src/java/org/apache/fop/fo/expr/FromTableColumnFunction.java +++ b/src/java/org/apache/fop/fo/expr/FromTableColumnFunction.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/src/java/org/apache/fop/fo/expr/Function.java b/src/java/org/apache/fop/fo/expr/Function.java index a06627f6c..78e40fad2 100644 --- a/src/java/org/apache/fop/fo/expr/Function.java +++ b/src/java/org/apache/fop/fo/expr/Function.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/src/java/org/apache/fop/fo/expr/FunctionBase.java b/src/java/org/apache/fop/fo/expr/FunctionBase.java index 24d2fef49..b5040c635 100644 --- a/src/java/org/apache/fop/fo/expr/FunctionBase.java +++ b/src/java/org/apache/fop/fo/expr/FunctionBase.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/src/java/org/apache/fop/fo/expr/ICCColorFunction.java b/src/java/org/apache/fop/fo/expr/ICCColorFunction.java index 9444639a5..2069945f1 100644 --- a/src/java/org/apache/fop/fo/expr/ICCColorFunction.java +++ b/src/java/org/apache/fop/fo/expr/ICCColorFunction.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.fo.expr; import org.apache.fop.datatypes.PercentBase; import org.apache.fop.datatypes.PercentBaseContext; @@ -29,16 +29,16 @@ import org.apache.fop.fo.properties.Property; * Implements the rgb-icc() function. */ class ICCColorFunction extends FunctionBase { - + /** - * rgb-icc takes a variable number of arguments. - * At least 4 should be passed - returns -4 - * {@inheritDoc} + * rgb-icc takes a variable number of arguments. + * At least 4 should be passed - returns -4 + * {@inheritDoc} */ public int nbArgs() { return -4; } - + /** {@inheritDoc} */ public PercentBase getPercentBase() { return new ICCPercentBase(); @@ -52,7 +52,7 @@ class ICCColorFunction extends FunctionBase { Declarations decls = pInfo.getFO().getRoot().getDeclarations(); ColorProfile cp = null; if (decls == null) { - //function used in a color-specification + //function used in a color-specification //on a FO occurring: //a) before the fo:declarations, //b) or in a document without fo:declarations? @@ -63,27 +63,27 @@ class ICCColorFunction extends FunctionBase { } else { cp = decls.getColorProfile(colorProfileName); if (cp == null) { - PropertyException pe = new PropertyException("The " + colorProfileName + PropertyException pe = new PropertyException("The " + colorProfileName + " color profile was not declared"); pe.setPropertyInfo(pInfo); throw pe; } } String src = cp.getSrc(); - + float red = 0, green = 0, blue = 0; red = args[0].getNumber().floatValue(); green = args[1].getNumber().floatValue(); blue = args[2].getNumber().floatValue(); /* Verify rgb replacement arguments */ - if ((red < 0 || red > 255) - || (green < 0 || green > 255) + if ((red < 0 || red > 255) + || (green < 0 || green > 255) || (blue < 0 || blue > 255)) { throw new PropertyException("Color values out of range. " + "Arguments to rgb-icc() must be [0..255] or [0%..100%]"); } - - // rgb-icc is replaced with fop-rgb-icc which has an extra fifth argument containing the + + // rgb-icc is replaced with fop-rgb-icc which has an extra fifth argument containing the // color profile src attribute as it is defined in the color-profile declarations element. StringBuffer sb = new StringBuffer(); sb.append("fop-rgb-icc("); @@ -92,19 +92,19 @@ class ICCColorFunction extends FunctionBase { sb.append(',').append(blue / 255f); for (int ix = 3; ix < args.length; ix++) { if (ix == 3) { - sb.append(',').append(colorProfileName); - sb.append(',').append(src); + sb.append(',').append(colorProfileName); + sb.append(',').append(src); } else { sb.append(',').append(args[ix]); } } sb.append(")"); - + return ColorProperty.getInstance(pInfo.getUserAgent(), sb.toString()); } private static final class ICCPercentBase implements PercentBase { - + /** {@inheritDoc} */ public int getBaseLength(PercentBaseContext context) throws PropertyException { return 0; diff --git a/src/java/org/apache/fop/fo/expr/InheritedPropFunction.java b/src/java/org/apache/fop/fo/expr/InheritedPropFunction.java index e24c78caa..94c4fdf22 100644 --- a/src/java/org/apache/fop/fo/expr/InheritedPropFunction.java +++ b/src/java/org/apache/fop/fo/expr/InheritedPropFunction.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/src/java/org/apache/fop/fo/expr/LabelEndFunction.java b/src/java/org/apache/fop/fo/expr/LabelEndFunction.java index 8a02d21d6..65be6cf9f 100644 --- a/src/java/org/apache/fop/fo/expr/LabelEndFunction.java +++ b/src/java/org/apache/fop/fo/expr/LabelEndFunction.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -70,13 +70,13 @@ public class LabelEndFunction extends FunctionBase { LengthBase.CONTAINING_REFAREA_WIDTH); PercentLength refWidth = new PercentLength(1.0, base); - Numeric labelEnd = distance; + Numeric labelEnd = distance; labelEnd = NumericOp.addition(labelEnd, startIndent); //TODO add start-intrusion-adjustment labelEnd = NumericOp.subtraction(labelEnd, separation); - + labelEnd = NumericOp.subtraction(refWidth, labelEnd); - + return (Property) labelEnd; } diff --git a/src/java/org/apache/fop/fo/expr/MaxFunction.java b/src/java/org/apache/fop/fo/expr/MaxFunction.java index 26e1a8f4c..fd2fee0b1 100644 --- a/src/java/org/apache/fop/fo/expr/MaxFunction.java +++ b/src/java/org/apache/fop/fo/expr/MaxFunction.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/src/java/org/apache/fop/fo/expr/MinFunction.java b/src/java/org/apache/fop/fo/expr/MinFunction.java index 5e5fc7bee..979d16b27 100644 --- a/src/java/org/apache/fop/fo/expr/MinFunction.java +++ b/src/java/org/apache/fop/fo/expr/MinFunction.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/src/java/org/apache/fop/fo/expr/NCnameProperty.java b/src/java/org/apache/fop/fo/expr/NCnameProperty.java index 8e2f8e27f..6bc16f2a9 100644 --- a/src/java/org/apache/fop/fo/expr/NCnameProperty.java +++ b/src/java/org/apache/fop/fo/expr/NCnameProperty.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -42,13 +42,13 @@ public class NCnameProperty extends Property { /** * If a system color, return the corresponding value. - * - * @param foUserAgent + * + * @param foUserAgent * Reference to FOP user agent - keeps track of cached ColorMaps for ICC colors * @return Color object corresponding to the NCName */ public Color getColor(FOUserAgent foUserAgent) { - try { + try { return ColorUtil.parseColorString(foUserAgent, ncName); } catch (PropertyException e) { //Not logging this error since for properties like "border" you would get an awful @@ -71,7 +71,7 @@ public class NCnameProperty extends Property { public Object getObject() { return this.ncName; } - + /** * @return ncName for this */ diff --git a/src/java/org/apache/fop/fo/expr/NearestSpecPropFunction.java b/src/java/org/apache/fop/fo/expr/NearestSpecPropFunction.java index cdde96092..3e0dda565 100644 --- a/src/java/org/apache/fop/fo/expr/NearestSpecPropFunction.java +++ b/src/java/org/apache/fop/fo/expr/NearestSpecPropFunction.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/src/java/org/apache/fop/fo/expr/NumericOp.java b/src/java/org/apache/fop/fo/expr/NumericOp.java index af77bb44c..9fe35d96d 100755 --- a/src/java/org/apache/fop/fo/expr/NumericOp.java +++ b/src/java/org/apache/fop/fo/expr/NumericOp.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -23,12 +23,12 @@ import org.apache.fop.datatypes.PercentBaseContext; import org.apache.fop.datatypes.Numeric; /** - * This class contains static methods to evaluate operations on Numeric + * This class contains static methods to evaluate operations on Numeric * operands. If the operands are absolute numerics the result is computed * rigth away and a new absolute numeric is return. If one of the operands are * relative a n operation node is created with the operation and the operands. * The evaluation of the operation can then occur when getNumericValue() is - * called. + * called. */ public class NumericOp { /** @@ -46,16 +46,16 @@ public class NumericOp { return new RelativeNumericProperty(RelativeNumericProperty.ADDITION, op1, op2); } } - + public static Numeric addition2(Numeric op1, Numeric op2, PercentBaseContext context) throws PropertyException { if (op1.getDimension() != op2.getDimension()) { throw new PropertyException("Can't subtract Numerics of different dimensions"); } return numeric(op1.getNumericValue(context) + op2.getNumericValue(context), op1.getDimension()); } - + /** - * Add the second operand from the first and return a new Numeric + * Add the second operand from the first and return a new Numeric * representing the result. * @param op1 The first operand. * @param op2 The second operand. @@ -77,9 +77,9 @@ public class NumericOp { } return numeric(op1.getNumericValue(context) - op2.getNumericValue(context), op1.getDimension()); } - + /** - * Multiply the two operands and return a new Numeric representing the + * Multiply the two operands and return a new Numeric representing the * result. * @param op1 The first operand. * @param op2 The second operand. @@ -93,16 +93,16 @@ public class NumericOp { } else { return new RelativeNumericProperty(RelativeNumericProperty.MULTIPLY, op1, op2); } - } + } public static Numeric multiply2(Numeric op1, Numeric op2, PercentBaseContext context) throws PropertyException { - return numeric(op1.getNumericValue(context) * op2.getNumericValue(context), + return numeric(op1.getNumericValue(context) * op2.getNumericValue(context), op1.getDimension() + op2.getDimension()); } - + /** - * Divide the second operand into the first and return a new - * Numeric representing the + * Divide the second operand into the first and return a new + * Numeric representing the * result. * @param op1 The first operand. * @param op2 The second operand. @@ -117,12 +117,12 @@ public class NumericOp { return new RelativeNumericProperty(RelativeNumericProperty.DIVIDE, op1, op2); } } - + public static Numeric divide2(Numeric op1, Numeric op2, PercentBaseContext context) throws PropertyException { - return numeric(op1.getNumericValue(context) / op2.getNumericValue(context), + return numeric(op1.getNumericValue(context) / op2.getNumericValue(context), op1.getDimension() - op2.getDimension()); } - + /** * Return the remainder of a division of the two operand Numeric. * @param op1 The first operand. @@ -136,7 +136,7 @@ public class NumericOp { return new RelativeNumericProperty(RelativeNumericProperty.MODULO, op1, op2); } } - + public static Numeric modulo2(Numeric op1, Numeric op2, PercentBaseContext context) throws PropertyException { return numeric(op1.getNumericValue(context) % op2.getNumericValue(context), op1.getDimension()); } @@ -157,7 +157,7 @@ public class NumericOp { public static Numeric abs2(Numeric op, PercentBaseContext context) throws PropertyException { return numeric(Math.abs(op.getNumericValue(context)), op.getDimension()); } - + /** * Return the negation of a Numeric. * @param op the operand. @@ -174,7 +174,7 @@ public class NumericOp { public static Numeric negate2(Numeric op, PercentBaseContext context) throws PropertyException { return numeric(- op.getNumericValue(context), op.getDimension()); } - + /** * Return the larger of the two Numerics. * @param op1 The first operand. @@ -196,7 +196,7 @@ public class NumericOp { } return op1.getNumericValue(context) > op2.getNumericValue(context) ? op1 : op2; } - + /** * Return the smaller of two Numerics. * @param op1 The first operand. @@ -218,9 +218,9 @@ public class NumericOp { } return op1.getNumericValue(context) <= op2.getNumericValue(context) ? op1 : op2; } - + /** - * Create a new absolute numeric with the specified value and dimension. + * Create a new absolute numeric with the specified value and dimension. * @param value * @param dimension * @return a new absolute numeric. diff --git a/src/java/org/apache/fop/fo/expr/NumericProperty.java b/src/java/org/apache/fop/fo/expr/NumericProperty.java index 54fe1f2f7..f80e1f5a5 100644 --- a/src/java/org/apache/fop/fo/expr/NumericProperty.java +++ b/src/java/org/apache/fop/fo/expr/NumericProperty.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.fo.expr; import java.awt.Color; @@ -30,7 +30,7 @@ import org.apache.fop.fo.properties.Property; /** * A numeric property which hold the final absolute result of an expression - * calculations. + * calculations. */ public class NumericProperty extends Property implements Numeric, Length { private double value; diff --git a/src/java/org/apache/fop/fo/expr/PPColWidthFunction.java b/src/java/org/apache/fop/fo/expr/PPColWidthFunction.java index 394035b49..5defda0fe 100644 --- a/src/java/org/apache/fop/fo/expr/PPColWidthFunction.java +++ b/src/java/org/apache/fop/fo/expr/PPColWidthFunction.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -40,8 +40,8 @@ public class PPColWidthFunction extends FunctionBase { return 1; } - /** - * @return the {@link PercentBase} for the proportional-column-width() + /** + * @return the {@link PercentBase} for the proportional-column-width() * function */ public PercentBase getPercentBase() { @@ -68,7 +68,7 @@ public class PPColWidthFunction extends FunctionBase { throw new PropertyException("proportional-column-width() function " + "may only be used on fo:table-column."); } - + Table t = (Table) pList.getParentFObj(); if (t.isAutoLayout()) { throw new PropertyException("proportional-column-width() function " @@ -96,6 +96,6 @@ public class PPColWidthFunction extends FunctionBase { public int getDimension() { return 0; } - + } } diff --git a/src/java/org/apache/fop/fo/expr/PropertyException.java b/src/java/org/apache/fop/fo/expr/PropertyException.java index d16d1c8ff..2d1d04913 100644 --- a/src/java/org/apache/fop/fo/expr/PropertyException.java +++ b/src/java/org/apache/fop/fo/expr/PropertyException.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -45,7 +45,7 @@ public class PropertyException extends FOPException { this.propertyName = ((PropertyException)cause).propertyName; } } - + /** * Sets the property context information. * @param propInfo the property info instance diff --git a/src/java/org/apache/fop/fo/expr/PropertyInfo.java b/src/java/org/apache/fop/fo/expr/PropertyInfo.java index 039e8783e..2bce0793f 100644 --- a/src/java/org/apache/fop/fo/expr/PropertyInfo.java +++ b/src/java/org/apache/fop/fo/expr/PropertyInfo.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -94,7 +94,7 @@ public class PropertyInfo { public PropertyMaker getPropertyMaker() { return maker; } - + /** * push a function onto the function stack * @param func function to push onto stack @@ -117,15 +117,15 @@ public class PropertyInfo { /** * Convenience shortcut to get a reference to the FOUserAgent - * + * * @return the FOUserAgent */ protected FOUserAgent getUserAgent() { - return (plist.getFObj() != null) - ? plist.getFObj().getUserAgent() + return (plist.getFObj() != null) + ? plist.getFObj().getUserAgent() : null; } - + private PercentBase getFunctionPercentBase() { if (stkFunction != null) { Function f = (Function)stkFunction.peek(); diff --git a/src/java/org/apache/fop/fo/expr/PropertyParser.java b/src/java/org/apache/fop/fo/expr/PropertyParser.java index c63142773..7ae1db7f3 100644 --- a/src/java/org/apache/fop/fo/expr/PropertyParser.java +++ b/src/java/org/apache/fop/fo/expr/PropertyParser.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -45,7 +45,7 @@ public final class PropertyParser extends PropertyTokenizer { private static final String RELUNIT = "em"; private static final HashMap FUNCTION_TABLE = new HashMap(); - + static { // Initialize the HashMap of XSL-defined functions FUNCTION_TABLE.put("ceiling", new CeilingFunction()); @@ -310,10 +310,10 @@ public final class PropertyParser extends PropertyTokenizer { propInfo.currentFontSize()); } else { if ("px".equals(unitPart)) { - //pass the ratio between source-resolution and + //pass the ratio between source-resolution and //the default resolution of 72dpi prop = FixedLength.getInstance( - numPart, unitPart, + numPart, unitPart, propInfo.getPropertyList().getFObj() .getUserAgent().getSourceResolution() / 72.0f); } else { @@ -344,7 +344,7 @@ public final class PropertyParser extends PropertyTokenizer { } propInfo.popFunction(); return prop; - + default: // TODO: add the token or the expr to the error message. throw new PropertyException("syntax error"); @@ -357,7 +357,7 @@ public final class PropertyParser extends PropertyTokenizer { * Parse a comma separated list of function arguments. Each argument * may itself be an expression. This method consumes the closing right * parenthesis of the argument list. - * @param function The function object for which the arguments are + * @param function The function object for which the arguments are * collected. * @return An array of Property objects representing the arguments * found. @@ -397,27 +397,27 @@ public final class PropertyParser extends PropertyTokenizer { } return args; } - + /** - * + * * Parse a comma separated list of function arguments. Each argument * may itself be an expression. This method consumes the closing right * parenthesis of the argument list. - * - * The method differs from parseArgs in that it accepts a variable + * + * The method differs from parseArgs in that it accepts a variable * number of arguments. - * - * @param function The function object for which the arguments are + * + * @param function The function object for which the arguments are * collected. * @return An array of Property objects representing the arguments * found. * @throws PropertyException If the number of arguments found isn't equal * to the number expected. - * - * TODO Merge this with parseArgs? + * + * TODO Merge this with parseArgs? */ Property[] parseVarArgs(Function function) throws PropertyException { - // For variable argument functions the minimum number of arguments is returned as a + // For variable argument functions the minimum number of arguments is returned as a // negative integer from the nbArgs method int nbArgs = -function.nbArgs(); List args = new LinkedList(); diff --git a/src/java/org/apache/fop/fo/expr/PropertyTokenizer.java b/src/java/org/apache/fop/fo/expr/PropertyTokenizer.java index 5fe5f4445..2ddcd0922 100644 --- a/src/java/org/apache/fop/fo/expr/PropertyTokenizer.java +++ b/src/java/org/apache/fop/fo/expr/PropertyTokenizer.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/src/java/org/apache/fop/fo/expr/RGBColorFunction.java b/src/java/org/apache/fop/fo/expr/RGBColorFunction.java index ba39662eb..1c7a91503 100644 --- a/src/java/org/apache/fop/fo/expr/RGBColorFunction.java +++ b/src/java/org/apache/fop/fo/expr/RGBColorFunction.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.fo.expr; import org.apache.fop.datatypes.PercentBaseContext; @@ -28,7 +28,7 @@ import org.apache.fop.fo.properties.Property; * Implements the rgb() function. */ class RGBColorFunction extends FunctionBase { - + /** {@inheritDoc} */ public int nbArgs() { return 3; @@ -46,8 +46,8 @@ class RGBColorFunction extends FunctionBase { /** {@inheritDoc} */ public Property eval(Property[] args, PropertyInfo pInfo) throws PropertyException { - return ColorProperty.getInstance(pInfo.getUserAgent(), - "rgb(" + args[0] + "," + return ColorProperty.getInstance(pInfo.getUserAgent(), + "rgb(" + args[0] + "," + args[1] + "," + args[2] + ")"); } diff --git a/src/java/org/apache/fop/fo/expr/RelativeNumericProperty.java b/src/java/org/apache/fop/fo/expr/RelativeNumericProperty.java index 647528692..a4e257546 100755 --- a/src/java/org/apache/fop/fo/expr/RelativeNumericProperty.java +++ b/src/java/org/apache/fop/fo/expr/RelativeNumericProperty.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -27,10 +27,10 @@ import org.apache.fop.fo.properties.TableColLength; /** - * This class represent a node in a property expression tree. + * This class represent a node in a property expression tree. * It is created when an operation involve relative expression and is used * to delay evaluation of the operation until the time where getNumericValue() - * or getValue() is called. + * or getValue() is called. */ public class RelativeNumericProperty extends Property implements Length { public static final int ADDITION = 1; @@ -42,10 +42,10 @@ public class RelativeNumericProperty extends Property implements Length { public static final int ABS = 7; public static final int MAX = 8; public static final int MIN = 9; - + // Used in the toString() method, indexed by operation id. private static String operations = " +-*/%"; - + /** * The operation identifier. */ @@ -62,7 +62,7 @@ public class RelativeNumericProperty extends Property implements Length { * The dimension of the result. */ private int dimension; - + /** * Constructor for a two argument operation. * @param operation the operation opcode: ADDITION, SUBTRACTION, ... @@ -124,12 +124,12 @@ public class RelativeNumericProperty extends Property implements Length { case MIN: return NumericOp.min2(op1, op2, context); default: - throw new PropertyException("Unknown expr operation " + operation); + throw new PropertyException("Unknown expr operation " + operation); } } /** - * Return the resolved (calculated) value of the expression. + * Return the resolved (calculated) value of the expression. * {@inheritDoc} */ public double getNumericValue() throws PropertyException { @@ -152,14 +152,14 @@ public class RelativeNumericProperty extends Property implements Length { /** * Return false since an expression is only created when there is relative - * numerics involved. + * numerics involved. */ public boolean isAbsolute() { return false; } /** - * Cast this numeric as a Length. + * Cast this numeric as a Length. */ public Length getLength() { if (dimension == 1) { @@ -205,7 +205,7 @@ public class RelativeNumericProperty extends Property implements Length { * If this value is not 0, the actual value of the Length cannot be known * without looking at all of the columns in the table to determine the value * of a "table-unit". - * + * * @return The number of table units which are included in this length * specification. */ @@ -261,7 +261,7 @@ public class RelativeNumericProperty extends Property implements Length { */ public String toString() { switch (operation) { - case ADDITION: case SUBTRACTION: + case ADDITION: case SUBTRACTION: case DIVIDE: case MULTIPLY: case MODULO: return "(" + op1 + " " + operations.charAt(operation) + op2 + ")"; case NEGATE: diff --git a/src/java/org/apache/fop/fo/expr/RoundFunction.java b/src/java/org/apache/fop/fo/expr/RoundFunction.java index a28a46e28..a29c33e5b 100644 --- a/src/java/org/apache/fop/fo/expr/RoundFunction.java +++ b/src/java/org/apache/fop/fo/expr/RoundFunction.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.fo.expr; diff --git a/src/java/org/apache/fop/fo/expr/SystemColorFunction.java b/src/java/org/apache/fop/fo/expr/SystemColorFunction.java index b32c38e54..eeb1870f7 100644 --- a/src/java/org/apache/fop/fo/expr/SystemColorFunction.java +++ b/src/java/org/apache/fop/fo/expr/SystemColorFunction.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.fo.expr; import org.apache.fop.apps.FOUserAgent; @@ -27,7 +27,7 @@ import org.apache.fop.fo.properties.Property; * Implements the system-color() function. */ class SystemColorFunction extends FunctionBase { - + /** {@inheritDoc} */ public int nbArgs() { return 1; @@ -36,8 +36,8 @@ class SystemColorFunction extends FunctionBase { /** {@inheritDoc} */ public Property eval(Property[] args, PropertyInfo pInfo) throws PropertyException { - FOUserAgent ua = (pInfo == null) - ? null + FOUserAgent ua = (pInfo == null) + ? null : (pInfo.getFO() == null ? null : pInfo.getFO().getUserAgent()); return ColorProperty.getInstance(ua, "system-color(" + args[0] + ")"); |