aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2005-12-15 22:20:48 +0000
committerJeremias Maerki <jeremias@apache.org>2005-12-15 22:20:48 +0000
commit811fd3eefbfb06cb945bb3599523b7f3a15f251e (patch)
tree66bba8948beb68ee1cccb39655ece6d4516cfac7 /test
parent0052c3f3bbe504304dabc836fe708fa49b391ed1 (diff)
downloadxmlgraphics-fop-811fd3eefbfb06cb945bb3599523b7f3a15f251e.tar.gz
xmlgraphics-fop-811fd3eefbfb06cb945bb3599523b7f3a15f251e.zip
NOTE: API changes in a backwards-incompatible way: FOUserAgent.setResolution() -> FOUserAgent.setSourceResolution() and FOUserAgent.setTargetResolution()
Resolution parameter to the user agent is split into: - a source resolution used to determine the pixel size in SVG images and bitmap without resolution information - a target resolution used to specify the output resolution of bitmap images generated by bitmap renderers and bitmaps generated by Batik for filter effects. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@357081 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test')
-rw-r--r--test/java/org/apache/fop/visual/AbstractPSPDFBitmapProducer.java4
-rw-r--r--test/java/org/apache/fop/visual/BatchDiffer.java6
-rw-r--r--test/java/org/apache/fop/visual/BitmapProducerJava2D.java3
-rw-r--r--test/java/org/apache/fop/visual/ProducerContext.java10
4 files changed, 11 insertions, 12 deletions
diff --git a/test/java/org/apache/fop/visual/AbstractPSPDFBitmapProducer.java b/test/java/org/apache/fop/visual/AbstractPSPDFBitmapProducer.java
index 655643877..8e893fea9 100644
--- a/test/java/org/apache/fop/visual/AbstractPSPDFBitmapProducer.java
+++ b/test/java/org/apache/fop/visual/AbstractPSPDFBitmapProducer.java
@@ -85,7 +85,7 @@ public abstract class AbstractPSPDFBitmapProducer extends AbstractBitmapProducer
//Build command-line
String cmd = MessageFormat.format(converter,
new Object[] {inFile.toString(), outFile.toString(),
- Integer.toString(context.getResolution())});
+ Integer.toString(context.getTargetResolution())});
ConvertUtils.convert(cmd, null, null, log);
if (!outFile.exists()) {
@@ -107,7 +107,7 @@ public abstract class AbstractPSPDFBitmapProducer extends AbstractBitmapProducer
public BufferedImage produce(File src, ProducerContext context) {
try {
FOUserAgent userAgent = new FOUserAgent();
- userAgent.setResolution(context.getResolution());
+ userAgent.setTargetResolution(context.getTargetResolution());
userAgent.setBaseURL(src.getParentFile().toURL().toString());
File tempOut = new File(context.getTargetDir(),
diff --git a/test/java/org/apache/fop/visual/BatchDiffer.java b/test/java/org/apache/fop/visual/BatchDiffer.java
index 71d6ebb60..271f1a120 100644
--- a/test/java/org/apache/fop/visual/BatchDiffer.java
+++ b/test/java/org/apache/fop/visual/BatchDiffer.java
@@ -152,14 +152,14 @@ public class BatchDiffer {
public void runBatch(Configuration cfg) {
try {
ProducerContext context = new ProducerContext();
- context.setResolution(cfg.getChild("resolution").getValueAsInteger(72));
+ context.setTargetResolution(cfg.getChild("resolution").getValueAsInteger(72));
String xslt = cfg.getChild("stylesheet").getValue(null);
if (xslt != null) {
try {
context.setTemplates(context.getTransformerFactory().newTemplates(
new StreamSource(xslt)));
} catch (TransformerConfigurationException e) {
- // throw new RuntimeException("Error setting up stylesheet", e); // This is JDK 1.4 or later specific
+ log.error("Error setting up stylesheet", e);
throw new RuntimeException("Error setting up stylesheet");
}
}
@@ -252,7 +252,7 @@ public class BatchDiffer {
producers[i] = (BitmapProducer)clazz.newInstance();
ContainerUtil.configure(producers[i], children[i]);
} catch (Exception e) {
- // throw new RuntimeException("Error while setting up producers", e); // This is JDK 1.4 or later specific
+ log.error("Error setting up producers", e);
throw new RuntimeException("Error while setting up producers");
}
}
diff --git a/test/java/org/apache/fop/visual/BitmapProducerJava2D.java b/test/java/org/apache/fop/visual/BitmapProducerJava2D.java
index 3fd4cef3a..06f3b6b5e 100644
--- a/test/java/org/apache/fop/visual/BitmapProducerJava2D.java
+++ b/test/java/org/apache/fop/visual/BitmapProducerJava2D.java
@@ -35,7 +35,6 @@ import org.apache.commons.io.IOUtils;
import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.apps.Fop;
import org.apache.fop.apps.MimeConstants;
-import org.apache.fop.fo.Constants;
/**
* BitmapProducer implementation that uses the Java2DRenderer to create bitmaps.
@@ -63,7 +62,7 @@ public class BitmapProducerJava2D extends AbstractBitmapProducer implements Conf
public BufferedImage produce(File src, ProducerContext context) {
try {
FOUserAgent userAgent = new FOUserAgent();
- userAgent.setResolution(context.getResolution());
+ userAgent.setTargetResolution(context.getTargetResolution());
userAgent.setBaseURL(src.getParentFile().toURL().toString());
File outputFile = new File(context.getTargetDir(), src.getName() + ".java2d.png");
diff --git a/test/java/org/apache/fop/visual/ProducerContext.java b/test/java/org/apache/fop/visual/ProducerContext.java
index f63ad3fdb..eda08e60d 100644
--- a/test/java/org/apache/fop/visual/ProducerContext.java
+++ b/test/java/org/apache/fop/visual/ProducerContext.java
@@ -30,7 +30,7 @@ public class ProducerContext {
private TransformerFactory tFactory;
private Templates templates;
- private int resolution;
+ private int targetResolution;
private File targetDir;
/**
@@ -46,16 +46,16 @@ public class ProducerContext {
/**
* @return the requested bitmap resolution in dpi for all bitmaps.
*/
- public int getResolution() {
- return resolution;
+ public int getTargetResolution() {
+ return targetResolution;
}
/**
* Sets the requested bitmap resolution in dpi for all bitmaps.
* @param resolution the resolution in dpi
*/
- public void setResolution(int resolution) {
- this.resolution = resolution;
+ public void setTargetResolution(int resolution) {
+ this.targetResolution = resolution;
}
/**