From d2b8aba1131ab23985a4f390779bd5e8f76e7b53 Mon Sep 17 00:00:00 2001 From: Vincent Hennebert Date: Fri, 11 Jul 2014 16:59:42 +0000 Subject: Removed unnecessary FunctionDelegate class Removed makeFunction/Shading/Gradient methods in PDFFactory that were not used, duplicates of methods in (PDF)GradientFactory and getting in the way of refactoring git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/FOP-2393_gradient-rendering@1609745 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/fop/render/shading/PDFGradientFactory.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/java/org/apache/fop/render/shading/PDFGradientFactory.java') diff --git a/src/java/org/apache/fop/render/shading/PDFGradientFactory.java b/src/java/org/apache/fop/render/shading/PDFGradientFactory.java index e12fa82e5..1e57e72ea 100644 --- a/src/java/org/apache/fop/render/shading/PDFGradientFactory.java +++ b/src/java/org/apache/fop/render/shading/PDFGradientFactory.java @@ -17,6 +17,7 @@ package org.apache.fop.render.shading; +import java.util.ArrayList; import java.util.List; import org.apache.fop.pdf.PDFDeviceColorSpace; @@ -37,18 +38,14 @@ public class PDFGradientFactory extends GradientFactory { public Function makeFunction(int functionType, List theDomain, List theRange, List theFunctions, List theBounds, List theEncode) { - PDFFunction newFunction = new PDFFunction(functionType, theDomain, theRange, theFunctions, - theBounds, theEncode); - newFunction = graphics2D.registerFunction(newFunction); - return newFunction; + return new Function(functionType, theDomain, theRange, theFunctions, theBounds, theEncode); } public Function makeFunction(int functionType, List theDomain, List theRange, List theCZero, List theCOne, double theInterpolationExponentN) { - PDFFunction newFunction = new PDFFunction(functionType, theDomain, theRange, theCZero, + Function newFunction = new Function(functionType, theDomain, theRange, theCZero, theCOne, theInterpolationExponentN); - newFunction = graphics2D.registerFunction(newFunction); return newFunction; } @@ -57,8 +54,13 @@ public class PDFGradientFactory extends GradientFactory { 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()) { + 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, theFunction, theExtend); + theBBox, theAntiAlias, theCoords, theDomain, pdfFunction, theExtend); newShading = graphics2D.registerShading(newShading); return newShading; } -- cgit v1.2.3