aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/render/print/PrintRenderer.java
diff options
context:
space:
mode:
authorMehdi Houshmand <mehdi@apache.org>2012-01-30 09:49:22 +0000
committerMehdi Houshmand <mehdi@apache.org>2012-01-30 09:49:22 +0000
commitc5c6ddef0cb6c90ea71e306f63474fd67ed46f6a (patch)
treeb9a6f738110a23fd12e15e19eed2b75ef55e61db /src/java/org/apache/fop/render/print/PrintRenderer.java
parentf02df0822b06b0d4a3fad950f4dd335515ebe563 (diff)
downloadxmlgraphics-fop-c5c6ddef0cb6c90ea71e306f63474fd67ed46f6a.tar.gz
xmlgraphics-fop-c5c6ddef0cb6c90ea71e306f63474fd67ed46f6a.zip
Bugzilla#52513: Moved FOUserAgent to the constructor of the Renderers
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1237582 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/render/print/PrintRenderer.java')
-rw-r--r--src/java/org/apache/fop/render/print/PrintRenderer.java23
1 files changed, 5 insertions, 18 deletions
diff --git a/src/java/org/apache/fop/render/print/PrintRenderer.java b/src/java/org/apache/fop/render/print/PrintRenderer.java
index 2eb2b07a2..ea68bc9b2 100644
--- a/src/java/org/apache/fop/render/print/PrintRenderer.java
+++ b/src/java/org/apache/fop/render/print/PrintRenderer.java
@@ -55,19 +55,9 @@ public class PrintRenderer extends PageableRenderer {
* Creates a new PrintRenderer with the options set through the renderer options if a custom
* PrinterJob is not given in FOUserAgent's renderer options.
*/
- public PrintRenderer() {
- }
-
- /**
- * Creates a new PrintRenderer and allows you to pass in a specific PrinterJob instance
- * that this renderer should work with.
- * @param printerJob the PrinterJob instance
- * @deprecated Please use the rendering options on the user agent to pass in the PrinterJob!
- */
- public PrintRenderer(PrinterJob printerJob) {
- this();
- this.printerJob = printerJob;
- printerJob.setPageable(this);
+ public PrintRenderer(FOUserAgent userAgent) {
+ super(userAgent);
+ setRendererOptions();
}
private void initializePrinterJob() {
@@ -85,11 +75,8 @@ public class PrintRenderer extends PageableRenderer {
}
}
- /** {@inheritDoc} */
- public void setUserAgent(FOUserAgent agent) {
- super.setUserAgent(agent);
-
- Map rendererOptions = agent.getRendererOptions();
+ private void setRendererOptions() {
+ Map rendererOptions = getUserAgent().getRendererOptions();
Object printerJobO = rendererOptions.get(PrintRenderer.PRINTER_JOB);
if (printerJobO != null) {