From 811e218ebc6e7f3eacc303f76dd2a0b7d504d8a9 Mon Sep 17 00:00:00 2001 From: Vincent Hennebert Date: Fri, 11 Jul 2014 17:38:47 +0000 Subject: [PATCH] More sensible variable naming git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/FOP-2393_gradient-rendering@1609751 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/fop/pdf/PDFFunction.java | 20 ++++---- .../apache/fop/render/shading/Function.java | 48 +++++++++---------- .../fop/render/shading/GradientFactory.java | 12 ++--- .../render/shading/PDFGradientFactory.java | 25 +++++----- .../fop/render/shading/PSGradientFactory.java | 18 +++---- 5 files changed, 60 insertions(+), 63 deletions(-) diff --git a/src/java/org/apache/fop/pdf/PDFFunction.java b/src/java/org/apache/fop/pdf/PDFFunction.java index b63887186..39942fc21 100644 --- a/src/java/org/apache/fop/pdf/PDFFunction.java +++ b/src/java/org/apache/fop/pdf/PDFFunction.java @@ -50,32 +50,30 @@ public class PDFFunction extends PDFObject { * Use null for an optional object parameter if you choose not to use it. * For optional int parameters, pass the default. * - * @param theDomain List objects of Double objects. + * @param domain List objects of Double objects. * This is the domain of the function. * See page 264 of the PDF 1.3 Spec. - * @param theRange List of Doubles that is the Range of the function. + * @param range List of Doubles that is the Range of the function. * See page 264 of the PDF 1.3 Spec. - * @param theCZero This is a vector of Double objects which defines the function result + * @param cZero This is a vector of Double objects which defines the function result * when x=0. * * This attribute is optional. * It's described on page 268 of the PDF 1.3 spec. - * @param theCOne This is a vector of Double objects which defines the function result + * @param cOne This is a vector of Double objects which defines the function result * when x=1. * * This attribute is optional. * It's described on page 268 of the PDF 1.3 spec. - * @param theInterpolationExponentN This is the inerpolation exponent. + * @param interpolationExponentN This is the inerpolation exponent. * * This attribute is required. * PDF Spec page 268 - * @param theFunctionType The type of the function, which should be 2. + * @param functionType The type of the function, which should be 2. */ - public PDFFunction(int theFunctionType, List theDomain, - List theRange, float[] theCZero, float[] theCOne, - double theInterpolationExponentN) { - this(new Function(theFunctionType, theDomain, theRange, - theCZero, theCOne, theInterpolationExponentN)); + public PDFFunction(int functionType, List domain, List range, float[] cZero, float[] cOne, + double interpolationExponentN) { + this(new Function(functionType, domain, range, cZero, cOne, interpolationExponentN)); } diff --git a/src/java/org/apache/fop/render/shading/Function.java b/src/java/org/apache/fop/render/shading/Function.java index 75a041d72..cc9b2d0f7 100644 --- a/src/java/org/apache/fop/render/shading/Function.java +++ b/src/java/org/apache/fop/render/shading/Function.java @@ -141,13 +141,13 @@ public class Function { * * Use null for an optional object parameter if you choose not to use it. * For optional int parameters, pass the default. - * @param theFunctionType The type of the function, which should be 2. - * @param theDomain List objects of Double objects. + * @param functionType The type of the function, which should be 2. + * @param domain List objects of Double objects. * This is the domain of the function. * See page 264 of the PDF 1.3 Spec. - * @param theRange List of Doubles that is the Range of the function. + * @param range List of Doubles that is the Range of the function. * See page 264 of the PDF 1.3 Spec. - * @param theCZero This is a vector of Double objects which defines the function result + * @param cZero This is a vector of Double objects which defines the function result * when x=0. * * This attribute is optional. @@ -157,21 +157,21 @@ public class Function { * * This attribute is optional. * It's described on page 268 of the PDF 1.3 spec. - * @param theInterpolationExponentN This is the inerpolation exponent. + * @param interpolationExponentN This is the inerpolation exponent. * * This attribute is required. * PDF Spec page 268 */ - public Function(int theFunctionType, List theDomain, List theRange, - float[] cZero, float[] cOne, double theInterpolationExponentN) { + public Function(int functionType, List domain, List range, + float[] cZero, float[] cOne, double interpolationExponentN) { this.functionType = 2; // dang well better be 2; this.cZero = cZero; this.cOne = cOne; - this.interpolationExponentN = theInterpolationExponentN; + this.interpolationExponentN = interpolationExponentN; - this.domain = theDomain; - this.range = theRange; + this.domain = domain; + this.range = range; } @@ -180,19 +180,19 @@ public class Function { * * Use null for an optional object parameter if you choose not to use it. * For optional int parameters, pass the default. - * @param theFunctionType This is the function type. It should be 3, + * @param functionType This is the function type. It should be 3, * for a stitching function. - * @param theDomain List objects of Double objects. + * @param domain List objects of Double objects. * This is the domain of the function. * See page 264 of the PDF 1.3 Spec. - * @param theRange List objects of Double objects. + * @param range List objects of Double objects. * This is the Range of the function. * See page 264 of the PDF 1.3 Spec. - * @param theFunctions A List of the PDFFunction objects that the stitching function stitches. + * @param functions A List of the PDFFunction objects that the stitching function stitches. * * This attributed is required. * It is described on page 269 of the PDF spec. - * @param theBounds This is a vector of Doubles representing the numbers that, + * @param bounds This is a vector of Doubles representing the numbers that, * in conjunction with Domain define the intervals to which each function from * the 'functions' object applies. It must be in order of increasing magnitude, * and each must be within Domain. @@ -201,7 +201,7 @@ public class Function { * * This attributed is required. * It's described on page 269 of the PDF 1.3 spec. - * @param theEncode List objects of Double objects. + * @param encode List objects of Double objects. * This is the linear mapping of input values intop the domain * of the function's sample table. Default is hard to represent in * ascii, but basically [0 (Size0 1) 0 (Size1 1)...]. @@ -209,16 +209,16 @@ public class Function { * * See page 270 in the PDF 1.3 spec. */ - public Function(int theFunctionType, List theDomain, List theRange, - List theFunctions, List theBounds, - List theEncode) { + public Function(int functionType, List domain, List range, + List functions, List bounds, + List encode) { this.functionType = 3; // dang well better be 3; - this.functions = theFunctions; - this.bounds = theBounds; - this.encode = theEncode; - this.domain = theDomain; - this.range = theRange; + this.functions = functions; + this.bounds = bounds; + this.encode = encode; + this.domain = domain; + this.range = range; } diff --git a/src/java/org/apache/fop/render/shading/GradientFactory.java b/src/java/org/apache/fop/render/shading/GradientFactory.java index 5cc33c62d..666bc0a77 100644 --- a/src/java/org/apache/fop/render/shading/GradientFactory.java +++ b/src/java/org/apache/fop/render/shading/GradientFactory.java @@ -149,11 +149,11 @@ public abstract class GradientFactory

{ return gradientColors; } - public abstract Shading makeShading(int theShadingType, - PDFDeviceColorSpace theColorSpace, List theBackground, List theBBox, - boolean theAntiAlias, List theCoords, List theDomain, - Function theFunction, List theExtend); + public abstract Shading makeShading(int shadingType, + PDFDeviceColorSpace colorSpace, List background, List bbox, + boolean antiAlias, List coords, List domain, + Function function, List extend); - public abstract P makePattern(int thePatternType, Shading theShading, List theXUID, - StringBuffer theExtGState, List theMatrix); + public abstract P makePattern(int patternType, Shading shading, List xuid, + StringBuffer extGState, List matrix); } diff --git a/src/java/org/apache/fop/render/shading/PDFGradientFactory.java b/src/java/org/apache/fop/render/shading/PDFGradientFactory.java index 86c4e7e79..4cab73a80 100644 --- a/src/java/org/apache/fop/render/shading/PDFGradientFactory.java +++ b/src/java/org/apache/fop/render/shading/PDFGradientFactory.java @@ -35,26 +35,25 @@ public class PDFGradientFactory extends GradientFactory { } @Override - public Shading makeShading(int theShadingType, - PDFDeviceColorSpace theColorSpace, List theBackground, List theBBox, - boolean theAntiAlias, List theCoords, List theDomain, - Function theFunction, List theExtend) { - List pdfFunctions = new ArrayList(theFunction.getFunctions().size()); - for (Function f : theFunction.getFunctions()) { + public Shading makeShading(int shadingType, + PDFDeviceColorSpace colorSpace, List background, List bbox, + boolean antiAlias, List coords, List domain, + Function function, List extend) { + List pdfFunctions = new ArrayList(function.getFunctions().size()); + for (Function f : function.getFunctions()) { pdfFunctions.add(graphics2D.registerFunction(new PDFFunction(f))); } - PDFFunction pdfFunction = graphics2D.registerFunction(new PDFFunction(theFunction, pdfFunctions)); - PDFShading newShading = new PDFShading(theShadingType, theColorSpace, theBackground, - theBBox, theAntiAlias, theCoords, theDomain, pdfFunction, theExtend); + PDFFunction pdfFunction = graphics2D.registerFunction(new PDFFunction(function, pdfFunctions)); + PDFShading newShading = new PDFShading(shadingType, colorSpace, background, + bbox, antiAlias, coords, domain, pdfFunction, extend); newShading = graphics2D.registerShading(newShading); return newShading; } @Override - public PDFPattern makePattern(int thePatternType, Shading theShading, List theXUID, - StringBuffer theExtGState, List theMatrix) { - PDFPattern newPattern = new PDFPattern(thePatternType, theShading, theXUID, theExtGState, - theMatrix); + public PDFPattern makePattern(int patternType, Shading shading, List xuid, + StringBuffer extGState, List matrix) { + PDFPattern newPattern = new PDFPattern(patternType, shading, xuid, extGState, matrix); newPattern = graphics2D.registerPattern(newPattern); return newPattern; } diff --git a/src/java/org/apache/fop/render/shading/PSGradientFactory.java b/src/java/org/apache/fop/render/shading/PSGradientFactory.java index 03011fa35..7bd7ba245 100644 --- a/src/java/org/apache/fop/render/shading/PSGradientFactory.java +++ b/src/java/org/apache/fop/render/shading/PSGradientFactory.java @@ -26,18 +26,18 @@ import org.apache.fop.render.ps.svg.PSShading; public class PSGradientFactory extends GradientFactory { @Override - public Shading makeShading(int theShadingType, - PDFDeviceColorSpace theColorSpace, List theBackground, List theBBox, - boolean theAntiAlias, List theCoords, List theDomain, - Function theFunction, List theExtend) { - Shading newShading = new PSShading(theShadingType, theColorSpace, theBackground, theBBox, - theAntiAlias, theCoords, theDomain, theFunction, theExtend); + public Shading makeShading(int shadingType, + PDFDeviceColorSpace colorSpace, List background, List bbox, + boolean antiAlias, List coords, List domain, + Function function, List extend) { + Shading newShading = new PSShading(shadingType, colorSpace, background, bbox, + antiAlias, coords, domain, function, extend); return newShading; } @Override - public PSPattern makePattern(int thePatternType, Shading theShading, List theXUID, - StringBuffer theExtGState, List theMatrix) { - return new PSPattern(thePatternType, theShading, theXUID, theExtGState, theMatrix); + public PSPattern makePattern(int patternType, Shading shading, List xuid, + StringBuffer extGState, List matrix) { + return new PSPattern(patternType, shading, xuid, extGState, matrix); } } -- 2.39.5