aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/render/gradient
diff options
context:
space:
mode:
authorVincent Hennebert <vhennebert@apache.org>2014-07-14 21:24:32 +0000
committerVincent Hennebert <vhennebert@apache.org>2014-07-14 21:24:32 +0000
commitcc8de67793c578b4e33860db6f11ab18e2aeee20 (patch)
tree7ee856c0ee1be368a01ee940feeace1468073903 /src/java/org/apache/fop/render/gradient
parent137171a8e7b96fcff3b9c87195cda692b1fdbfa0 (diff)
downloadxmlgraphics-fop-cc8de67793c578b4e33860db6f11ab18e2aeee20.tar.gz
xmlgraphics-fop-cc8de67793c578b4e33860db6f11ab18e2aeee20.zip
Delegate function rendering to dedicated class intead of taking as parameter a list of Strings coming from who knows where
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/FOP-2393_gradient-rendering@1610535 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/render/gradient')
-rw-r--r--src/java/org/apache/fop/render/gradient/Function.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/java/org/apache/fop/render/gradient/Function.java b/src/java/org/apache/fop/render/gradient/Function.java
index f37479538..e83f6dc05 100644
--- a/src/java/org/apache/fop/render/gradient/Function.java
+++ b/src/java/org/apache/fop/render/gradient/Function.java
@@ -24,6 +24,11 @@ import org.apache.fop.pdf.PDFNumber;
public class Function {
+ public interface SubFunctionRenderer {
+
+ void outputFunction(StringBuilder out, int functionIndex);
+ }
+
/**
* Required: The Type of function (0,2,3,4) default is 0.
*/
@@ -333,7 +338,7 @@ public class Function {
return cOne;
}
- public String toWriteableString(List<String> functionsStrings) {
+ public String toWriteableString(SubFunctionRenderer subFunctionRenderer) {
StringBuilder out = new StringBuilder(256);
out.append("<<\n/FunctionType " + functionType + "\n");
outputDomain(out);
@@ -362,8 +367,8 @@ public class Function {
outputRange(out);
if (!functions.isEmpty()) {
out.append("/Functions [ ");
- for (String f : functionsStrings) {
- out.append(f);
+ for (int i = 0; i < functions.size(); i++) {
+ subFunctionRenderer.outputFunction(out, i);
out.append(' ');
}
out.append("]\n");