1 28 package net.sf.jasperreports.crosstabs.design; 29 30 import java.beans.PropertyChangeListener ; 31 import java.beans.PropertyChangeSupport ; 32 33 import net.sf.jasperreports.crosstabs.base.JRBaseCrosstabMeasure; 34 import net.sf.jasperreports.engine.JRConstants; 35 import net.sf.jasperreports.engine.JRExpression; 36 import net.sf.jasperreports.engine.JRVariable; 37 import net.sf.jasperreports.engine.design.JRDesignVariable; 38 39 45 public class JRDesignCrosstabMeasure extends JRBaseCrosstabMeasure 46 { 47 private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; 48 49 public static final String PROPERTY_VALUE_CLASS = "valueClassName"; 50 51 52 private transient PropertyChangeSupport propSupport; 53 54 private JRDesignVariable designVariable; 55 56 57 60 public JRDesignCrosstabMeasure() 61 { 62 super(); 63 64 variable = designVariable = new JRDesignVariable(); 65 designVariable.setCalculation(JRVariable.CALCULATION_SYSTEM); 66 designVariable.setSystemDefined(true); 67 } 68 69 70 76 public void setCalculation(byte calculation) 77 { 78 this.calculation = calculation; 79 } 80 81 82 88 public void setValueExpression(JRExpression expression) 89 { 90 this.expression = expression; 91 } 92 93 94 100 public void setIncrementerFactoryClassName(String incrementerFactoryClassName) 101 { 102 this.incrementerFactoryClassName = incrementerFactoryClassName; 103 this.incrementerFactoryClass = null; 104 } 105 106 107 113 public void setName(String name) 114 { 115 this.name = name; 116 designVariable.setName(name); 117 } 118 119 120 126 public void setPercentageOfType(byte percentageOfType) 127 { 128 this.percentageOfType = percentageOfType; 129 } 130 131 132 138 public void setPercentageCalculatorClassName(String percentageCalculatorClassName) 139 { 140 this.percentageCalculatorClassName = percentageCalculatorClassName; 141 this.percentageCalculatorClass = null; 142 } 143 144 145 151 public void setValueClassName(String valueClassName) 152 { 153 String oldValue = this.valueClassName; 154 155 this.valueClassName = valueClassName; 156 this.valueClass = null; 157 designVariable.setValueClassName(valueClassName); 158 159 getPropertyChangeSupport().firePropertyChange(PROPERTY_VALUE_CLASS, oldValue, 160 this.valueClassName); 161 } 162 163 164 172 public void addPropertyChangeListener(PropertyChangeListener l) 173 { 174 getPropertyChangeSupport().addPropertyChangeListener(l); 175 } 176 177 188 public void addPropertyChangeListener(String propName, PropertyChangeListener l) 189 { 190 getPropertyChangeSupport().addPropertyChangeListener(propName, l); 191 } 192 193 203 public void removePropertyChangeListener(PropertyChangeListener l) 204 { 205 getPropertyChangeSupport().removePropertyChangeListener(l); 206 } 207 208 216 public void removePropertyChangeListener(String propName, PropertyChangeListener l) 217 { 218 getPropertyChangeSupport().removePropertyChangeListener(propName, l); 219 } 220 221 228 protected PropertyChangeSupport getPropertyChangeSupport() 229 { 230 if (propSupport == null) 231 { 232 propSupport = new PropertyChangeSupport (this); 233 } 234 return propSupport; 235 } 236 } 237 | Popular Tags |