1 28 package net.sf.jasperreports.charts.base; 29 30 import net.sf.jasperreports.charts.JRDataRange; 31 import net.sf.jasperreports.charts.JRThermometerPlot; 32 import net.sf.jasperreports.charts.JRValueDisplay; 33 import net.sf.jasperreports.charts.base.JRBaseDataRange; 34 import net.sf.jasperreports.charts.base.JRBaseValueDisplay; 35 import net.sf.jasperreports.engine.JRChartPlot; 36 import net.sf.jasperreports.engine.JRConstants; 37 import net.sf.jasperreports.engine.JRExpressionCollector; 38 import net.sf.jasperreports.engine.base.JRBaseChartPlot; 39 import net.sf.jasperreports.engine.base.JRBaseObjectFactory; 40 41 import java.awt.Color ; 42 43 49 public class JRBaseThermometerPlot extends JRBaseChartPlot implements JRThermometerPlot 50 { 51 54 private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; 55 56 60 protected JRDataRange dataRange = null; 61 62 66 protected JRValueDisplay valueDisplay = null; 67 68 71 protected boolean showValueLines = false; 72 73 76 protected byte valueLocation = JRThermometerPlot.LOCATION_BULB; 77 78 81 protected Color mercuryColor = null; 82 83 86 protected JRDataRange lowRange = null; 87 88 91 protected JRDataRange mediumRange = null; 92 93 96 protected JRDataRange highRange = null; 97 98 103 public JRBaseThermometerPlot(JRChartPlot thermoPlot) 104 { 105 super(thermoPlot); 106 } 107 108 115 public JRBaseThermometerPlot(JRThermometerPlot thermoPlot, JRBaseObjectFactory factory) 116 { 117 super(thermoPlot, factory); 118 119 dataRange = new JRBaseDataRange(thermoPlot.getDataRange(), factory); 120 121 valueDisplay = new JRBaseValueDisplay(thermoPlot.getValueDisplay(), factory); 122 123 showValueLines = thermoPlot.isShowValueLines(); 124 125 valueLocation = thermoPlot.getValueLocation(); 126 127 mercuryColor = thermoPlot.getMercuryColor(); 128 129 if (thermoPlot.getLowRange() != null) 130 lowRange = new JRBaseDataRange(thermoPlot.getLowRange(), factory); 131 if (thermoPlot.getMediumRange() != null) 132 mediumRange = new JRBaseDataRange(thermoPlot.getMediumRange(), factory); 133 if (thermoPlot.getHighRange() != null) 134 highRange = new JRBaseDataRange(thermoPlot.getHighRange(), factory); 135 } 136 137 140 public JRDataRange getDataRange() 141 { 142 return dataRange; 143 } 144 145 148 public JRValueDisplay getValueDisplay() 149 { 150 return valueDisplay; 151 } 152 153 156 public boolean isShowValueLines() 157 { 158 return showValueLines; 159 } 160 161 164 public byte getValueLocation() 165 { 166 return valueLocation; 167 } 168 169 172 public Color getMercuryColor() 173 { 174 return mercuryColor; 175 } 176 177 180 public JRDataRange getLowRange() 181 { 182 return lowRange; 183 } 184 185 188 public JRDataRange getMediumRange() 189 { 190 return mediumRange; 191 } 192 193 196 public JRDataRange getHighRange() 197 { 198 return highRange; 199 } 200 201 208 public void collectExpressions(JRExpressionCollector collector) 209 { 210 collector.collect(this); 211 } 212 } 213 | Popular Tags |