1 11 12 package com.tonbeller.jpivot.print; 13 14 import java.beans.PropertyChangeListener ; 15 import java.beans.PropertyChangeSupport ; 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 24 public class PrintComponent extends ComponentSupport { 25 26 public final String PRINT_PAGE_WIDTH="pageWidth"; 27 public final String PRINT_PAPER_TYPE="paper.type"; 28 public final String PRINT_PAGE_ORIENTATION="pageOrientation"; 29 public final String PRINT_TABLE_WIDTH="tableWidth"; 30 public final String PRINT_PAGE_HEIGHT="pageHeight"; 31 public final String PRINT_TITLE="reportTitle"; 32 public final String PRINT_CHART_PAGEBREAK="chartPageBreak"; 33 34 private PropertyChangeSupport propertySupport; 35 37 40 private String reportTitle=""; 41 Dispatcher dispatcher = new DispatcherSupport(); 42 43 46 private boolean setPageWidth=false; 47 48 49 52 private double pageWidth=21.0; 53 54 57 private double pageHeight=29.7; 58 59 62 private String pageOrientation="portrait"; 63 64 67 private String paperType="A4"; 68 69 72 private boolean setTableWidth=false; 73 74 77 private boolean chartPageBreak=false; 78 79 82 private double tableWidth; 83 84 public PrintComponent(String id, RequestContext context) { 85 super(id, null); 86 propertySupport = new PropertyChangeSupport (this); 87 getDispatcher().addRequestListener(null, null, dispatcher); 90 } 91 92 93 public void addPropertyChangeListener(PropertyChangeListener listener) { 94 propertySupport.addPropertyChangeListener(listener); 95 } 96 97 public void removePropertyChangeListener(PropertyChangeListener listener) { 98 propertySupport.removePropertyChangeListener(listener); 99 } 100 101 104 public void initialize(RequestContext context) throws Exception { 105 super.initialize(context); 106 } 107 111 public String getReportTitle() { 112 return this.reportTitle; 113 } 114 115 119 public void setReportTitle(String reportTitle) { 120 this.reportTitle = reportTitle; 121 } 122 123 public org.w3c.dom.Document render(RequestContext context) throws Exception { 124 return null; 125 } 126 127 131 public boolean isSetPageWidth() { 132 return this.setPageWidth; 133 } 134 135 139 public void setSetPageWidth(boolean setPageWidth) { 140 this.setPageWidth = setPageWidth; 141 } 142 143 147 public double getPageWidth() { 148 return this.pageWidth; 149 } 150 151 155 public void setPageWidth(double pageWidth) { 156 this.pageWidth = pageWidth; 157 } 158 159 163 public String getPageOrientation() { 164 return this.pageOrientation; 165 } 166 167 171 public void setPageOrientation(String pageOrientation) { 172 this.pageOrientation = pageOrientation; 173 } 174 175 179 public String getPaperType() { 180 return this.paperType; 181 } 182 183 187 public void setPaperType(String paperType) { 188 this.paperType = paperType; 189 } 190 191 195 public boolean isSetTableWidth() { 196 return this.setTableWidth; 197 } 198 199 203 public void setSetTableWidth(boolean setTableWidth) { 204 this.setTableWidth = setTableWidth; 205 } 206 207 211 public boolean isChartPageBreak() { 212 return this.chartPageBreak; 213 } 214 215 219 public void setChartPageBreak(boolean chartPageBreak) { 220 this.chartPageBreak = chartPageBreak; 221 } 222 223 227 public double getPageHeight() { 228 return this.pageHeight; 229 } 230 231 235 public void setPageHeight(double pageHeight) { 236 this.pageHeight = pageHeight; 237 } 238 239 243 public double getTableWidth() { 244 return this.tableWidth; 245 } 246 247 251 public void setTableWidth(double tableWidth) { 252 this.tableWidth = tableWidth; 253 } 254 255 } 256 | Popular Tags |