aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/render/ps
diff options
context:
space:
mode:
authorVincent Hennebert <vhennebert@apache.org>2014-07-11 16:59:42 +0000
committerVincent Hennebert <vhennebert@apache.org>2014-07-11 16:59:42 +0000
commitd2b8aba1131ab23985a4f390779bd5e8f76e7b53 (patch)
treed3d960245f5d39da5fa6328a330b2ae4b59b60d5 /src/java/org/apache/fop/render/ps
parent2be89ddec6f3381d98cb3a9f9732245573b0ea88 (diff)
downloadxmlgraphics-fop-d2b8aba1131ab23985a4f390779bd5e8f76e7b53.tar.gz
xmlgraphics-fop-d2b8aba1131ab23985a4f390779bd5e8f76e7b53.zip
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
Diffstat (limited to 'src/java/org/apache/fop/render/ps')
-rw-r--r--src/java/org/apache/fop/render/ps/svg/PSFunction.java77
1 files changed, 9 insertions, 68 deletions
diff --git a/src/java/org/apache/fop/render/ps/svg/PSFunction.java b/src/java/org/apache/fop/render/ps/svg/PSFunction.java
index b03e0b590..4ae7b6058 100644
--- a/src/java/org/apache/fop/render/ps/svg/PSFunction.java
+++ b/src/java/org/apache/fop/render/ps/svg/PSFunction.java
@@ -20,15 +20,13 @@
package org.apache.fop.render.ps.svg;
import java.io.UnsupportedEncodingException;
+import java.util.ArrayList;
import java.util.List;
import org.apache.fop.render.shading.Function;
-import org.apache.fop.render.shading.FunctionDelegate;
import org.apache.fop.render.shading.FunctionPattern;
-public class PSFunction implements Function {
-
- private FunctionDelegate delegate;
+public class PSFunction extends Function {
/**
* Creates a Postscript function dictionary
@@ -46,8 +44,7 @@ public class PSFunction implements Function {
public PSFunction(int theFunctionType, List<Double> theDomain,
List<Double> theRange, List<Function> theFunctions,
List<Double> theBounds, List<Double> theEncode) {
- delegate = new FunctionDelegate(this, theFunctionType, theDomain, theRange, theFunctions,
- theBounds, theEncode);
+ super(theFunctionType, theDomain, theRange, theFunctions, theBounds, theEncode);
}
/**
@@ -64,8 +61,7 @@ public class PSFunction implements Function {
public PSFunction(int theFunctionType, List<Double> theDomain,
List<Double> theRange, List<Double> theCZero, List<Double> theCOne,
double theInterpolationExponentN) {
- delegate = new FunctionDelegate(this, theFunctionType, theDomain, theRange, theCZero,
- theCOne, theInterpolationExponentN);
+ super(theFunctionType, theDomain, theRange, theCZero, theCOne, theInterpolationExponentN);
}
/**
@@ -74,70 +70,15 @@ public class PSFunction implements Function {
public byte[] toByteString() {
FunctionPattern pattern = new FunctionPattern(this);
try {
- return pattern.toWriteableString().getBytes("UTF-8");
+ List<String> functionsStrings = new ArrayList<String>(getFunctions().size());
+ for (Function f : getFunctions()) {
+ functionsStrings.add(new String(((PSFunction) f).toByteString(), "UTF-8"));
+ }
+ return pattern.toWriteableString(functionsStrings).getBytes("UTF-8");
} catch (UnsupportedEncodingException ex) {
//This should have been made an enum type to avoid throwing exceptions.
return new byte[0];
}
}
- public int getFunctionType() {
- return delegate.getFunctionType();
- }
-
- public List<Double> getBounds() {
- return delegate.getBounds();
- }
-
- public List<Double> getDomain() {
- return delegate.getDomain();
- }
-
- public List<Double> getSize() {
- return delegate.getSize();
- }
-
- public List<String> getFilter() {
- return delegate.getFilter();
- }
-
- public List<Double> getEncode() {
- return delegate.getEncode();
- }
-
- public List<Function> getFunctions() {
- return delegate.getFunctions();
- }
-
- public int getBitsPerSample() {
- return delegate.getBitsPerSample();
- }
-
- public double getInterpolationExponentN() {
- return delegate.getInterpolationExponentN();
- }
-
- public int getOrder() {
- return delegate.getOrder();
- }
-
- public List<Double> getRange() {
- return delegate.getRange();
- }
-
- public List<Double> getDecode() {
- return delegate.getDecode();
- }
-
- public StringBuffer getDataStream() {
- return delegate.getDataStream();
- }
-
- public List<Double> getCZero() {
- return delegate.getCZero();
- }
-
- public List<Double> getCOne() {
- return delegate.getCOne();
- }
}