KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tonbeller > jpivot > print > PrintComponent


1 /*
2  * ====================================================================
3  * This software is subject to the terms of the Common Public License
4  * Agreement, available at the following URL:
5  * http://www.opensource.org/licenses/cpl.html .
6  * Copyright (C) 2003-2004 TONBELLER AG.
7  * All Rights Reserved.
8  * You must accept the terms of that agreement to use this software.
9  * ====================================================================
10  */

11
12 package com.tonbeller.jpivot.print;
13
14 import java.beans.PropertyChangeListener JavaDoc;
15 import java.beans.PropertyChangeSupport JavaDoc;
16
17 import com.tonbeller.wcf.component.ComponentSupport;
18 import com.tonbeller.wcf.controller.Dispatcher;
19 import com.tonbeller.wcf.controller.DispatcherSupport;
20 import com.tonbeller.wcf.controller.RequestContext;
21 /**
22  * @author Ati
23  */

24 public class PrintComponent extends ComponentSupport {
25     
26     public final String JavaDoc PRINT_PAGE_WIDTH="pageWidth";
27     public final String JavaDoc PRINT_PAPER_TYPE="paper.type";
28     public final String JavaDoc PRINT_PAGE_ORIENTATION="pageOrientation";
29     public final String JavaDoc PRINT_TABLE_WIDTH="tableWidth";
30     public final String JavaDoc PRINT_PAGE_HEIGHT="pageHeight";
31     public final String JavaDoc PRINT_TITLE="reportTitle";
32     public final String JavaDoc PRINT_CHART_PAGEBREAK="chartPageBreak";
33         
34     private PropertyChangeSupport JavaDoc propertySupport;
35     //String ref;
36

37     /**
38      * Holds value of property reportTitle.
39      */

40     private String JavaDoc reportTitle="";
41     Dispatcher dispatcher = new DispatcherSupport();
42     
43     /**
44      * Holds value of property setPageWidth.
45      */

46     private boolean setPageWidth=false;
47     
48     
49     /**
50      * Holds value of property pageWidth.
51      */

52     private double pageWidth=21.0;
53     
54      /**
55      * Holds value of property pageHeight.
56      */

57     private double pageHeight=29.7;
58     
59     /**
60      * Holds value of property pageOrientation.
61      */

62     private String JavaDoc pageOrientation="portrait";
63     
64     /**
65      * Holds value of property paperType.
66      */

67     private String JavaDoc paperType="A4";
68     
69     /**
70      * Holds value of property setTableWidth.
71      */

72     private boolean setTableWidth=false;
73     
74     /**
75      * Holds value of property chartPageBreak.
76      */

77     private boolean chartPageBreak=false;
78     
79     /**
80      * Holds value of property tableWidth.
81      */

82     private double tableWidth;
83     
84     public PrintComponent(String JavaDoc id, RequestContext context) {
85         super(id, null);
86         propertySupport = new PropertyChangeSupport JavaDoc(this);
87         //this.locale = context.getLocale();
88
// extend the controller
89
getDispatcher().addRequestListener(null, null, dispatcher);
90     }
91     
92     
93     public void addPropertyChangeListener(PropertyChangeListener JavaDoc listener) {
94         propertySupport.addPropertyChangeListener(listener);
95     }
96     
97     public void removePropertyChangeListener(PropertyChangeListener JavaDoc listener) {
98         propertySupport.removePropertyChangeListener(listener);
99     }
100
101     /**
102      * called once by the creating tag
103      */

104     public void initialize(RequestContext context) throws Exception JavaDoc {
105             super.initialize(context);
106     }
107     /**
108      * Getter for property reportTitle.
109      * @return Value of property reportTitle.
110      */

111     public String JavaDoc getReportTitle() {
112         return this.reportTitle;
113     }
114     
115     /**
116      * Setter for property reportTitle.
117      * @param reportTitle New value of property reportTitle.
118      */

119     public void setReportTitle(String JavaDoc reportTitle) {
120         this.reportTitle = reportTitle;
121     }
122     
123     public org.w3c.dom.Document JavaDoc render(RequestContext context) throws Exception JavaDoc {
124         return null;
125     }
126     
127     /**
128      * Getter for property setPageWidth.
129      * @return Value of property setPageWidth.
130      */

131     public boolean isSetPageWidth() {
132         return this.setPageWidth;
133     }
134     
135     /**
136      * Setter for property setPageWidth.
137      * @param setPageWidth New value of property setPageWidth.
138      */

139     public void setSetPageWidth(boolean setPageWidth) {
140         this.setPageWidth = setPageWidth;
141     }
142     
143     /**
144      * Getter for property pageWidth.
145      * @return Value of property pageWidth.
146      */

147     public double getPageWidth() {
148         return this.pageWidth;
149     }
150     
151     /**
152      * Setter for property pageWidth.
153      * @param pageWidth New value of property pageWidth.
154      */

155     public void setPageWidth(double pageWidth) {
156         this.pageWidth = pageWidth;
157     }
158     
159     /**
160      * Getter for property pageOrientation.
161      * @return Value of property pageOrientation.
162      */

163     public String JavaDoc getPageOrientation() {
164         return this.pageOrientation;
165     }
166     
167     /**
168      * Setter for property pageOrientation.
169      * @param pageOrientation New value of property pageOrientation.
170      */

171     public void setPageOrientation(String JavaDoc pageOrientation) {
172         this.pageOrientation = pageOrientation;
173     }
174     
175     /**
176      * Getter for property paperType.
177      * @return Value of property paperType.
178      */

179     public String JavaDoc getPaperType() {
180         return this.paperType;
181     }
182     
183     /**
184      * Setter for property paperType.
185      * @param paperType New value of property paperType.
186      */

187     public void setPaperType(String JavaDoc paperType) {
188         this.paperType = paperType;
189     }
190     
191     /**
192      * Getter for property setTableWidth.
193      * @return Value of property setTableWidth.
194      */

195     public boolean isSetTableWidth() {
196         return this.setTableWidth;
197     }
198     
199     /**
200      * Setter for property setTableWidth.
201      * @param setTableWidth New value of property setTableWidth.
202      */

203     public void setSetTableWidth(boolean setTableWidth) {
204         this.setTableWidth = setTableWidth;
205     }
206     
207     /**
208      * Getter for property chartPageBreak.
209      * @return Value of property chartPageBreak.
210      */

211     public boolean isChartPageBreak() {
212         return this.chartPageBreak;
213     }
214     
215     /**
216      * Setter for property chartPageBreak.
217      * @param chartPageBreak New value of property chartPageBreak.
218      */

219     public void setChartPageBreak(boolean chartPageBreak) {
220         this.chartPageBreak = chartPageBreak;
221     }
222     
223     /**
224      * Getter for property pageHeight.
225      * @return Value of property pageHeight.
226      */

227     public double getPageHeight() {
228         return this.pageHeight;
229     }
230     
231     /**
232      * Setter for property pageHeight.
233      * @param pageHeight New value of property pageHeight.
234      */

235     public void setPageHeight(double pageHeight) {
236         this.pageHeight = pageHeight;
237     }
238     
239     /**
240      * Getter for property tableWidth.
241      * @return Value of property tableWidth.
242      */

243     public double getTableWidth() {
244         return this.tableWidth;
245     }
246     
247     /**
248      * Setter for property tableWidth.
249      * @param tableWidth New value of property tableWidth.
250      */

251     public void setTableWidth(double tableWidth) {
252         this.tableWidth = tableWidth;
253     }
254     
255 }
256
Popular Tags