KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > fop > visual > ProducerContext


1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */

17
18 /* $Id: ProducerContext.java 426576 2006-07-28 15:44:37Z jeremias $ */
19
20 package org.apache.fop.visual;
21
22 import java.io.File JavaDoc;
23
24 import javax.xml.transform.Templates JavaDoc;
25 import javax.xml.transform.TransformerFactory JavaDoc;
26
27 /**
28  * Context object for the bitmap production.
29  */

30 public class ProducerContext {
31
32     private TransformerFactory JavaDoc tFactory;
33     private Templates JavaDoc templates;
34     private int targetResolution;
35     private File JavaDoc targetDir;
36     
37     /**
38      * @return the TransformerFactory to be used.
39      */

40     public TransformerFactory JavaDoc getTransformerFactory() {
41         if (tFactory == null) {
42             tFactory = TransformerFactory.newInstance();
43         }
44         return tFactory;
45     }
46     
47     /**
48      * @return the requested bitmap resolution in dpi for all bitmaps.
49      */

50     public int getTargetResolution() {
51         return targetResolution;
52     }
53
54     /**
55      * Sets the requested bitmap resolution in dpi for all bitmaps.
56      * @param resolution the resolution in dpi
57      */

58     public void setTargetResolution(int resolution) {
59         this.targetResolution = resolution;
60     }
61
62     /**
63      * @return the XSLT stylesheet to preprocess the input files with.
64      */

65     public Templates JavaDoc getTemplates() {
66         return templates;
67     }
68
69     /**
70      * Sets an optional XSLT stylesheet which is used to preprocess all input files with.
71      * @param templates the XSLT stylesheet
72      */

73     public void setTemplates(Templates JavaDoc templates) {
74         this.templates = templates;
75     }
76     
77     /**
78      * @return the target directory for all produced bitmaps
79      */

80     public File JavaDoc getTargetDir() {
81         return targetDir;
82     }
83     
84     /**
85      * Sets the target directory for all produced bitmaps.
86      * @param targetDir the target directory
87      */

88     public void setTargetDir(File JavaDoc targetDir) {
89         this.targetDir = targetDir;
90     }
91 }
92
Popular Tags