1 28 package net.sf.jasperreports.engine; 29 30 import net.sf.jasperreports.engine.fill.JRBaseFiller; 31 import net.sf.jasperreports.engine.fill.JRFillChart; 32 import net.sf.jasperreports.engine.fill.JRFillChartDataset; 33 34 41 public abstract class JRAbstractChartCustomizer implements JRChartCustomizer 42 { 43 private JRBaseFiller filler; 44 private JRFillChartDataset chartDataset; 45 46 47 50 protected JRAbstractChartCustomizer() 51 { 52 } 53 54 55 61 public void init(JRBaseFiller chartFiller, JRFillChart chart) 62 { 63 this.filler = chartFiller; 64 this.chartDataset = (JRFillChartDataset) chart.getDataset(); 65 } 66 67 68 74 protected final Object getParameterValue(String parameterName) 75 { 76 return getParameterValue(parameterName, false); 77 } 78 79 80 93 protected final Object getParameterValue(String parameterName, boolean fromInputDataset) 94 { 95 return (fromInputDataset ? chartDataset.getInputDataset() : filler.getMainDataset()).getParameterValue(parameterName); 96 } 97 98 99 105 protected final Object getVariableValue(String variableName) 106 { 107 return getVariableValue(variableName, false); 108 } 109 110 111 124 protected final Object getVariableValue(String variableName, boolean fromInputDataset) 125 { 126 return (fromInputDataset ? chartDataset.getInputDataset() : filler.getMainDataset()).getVariableValue(variableName); 127 } 128 129 130 136 protected final Object getFieldValue(String fieldName) 137 { 138 return getFieldValue(fieldName, false); 139 } 140 141 142 155 protected final Object getFieldValue(String fieldName, boolean fromInputDataset) 156 { 157 return (fromInputDataset ? chartDataset.getInputDataset() : filler.getMainDataset()).getFieldValue(fieldName); 158 } 159 } 160 | Popular Tags |