1 28 package net.sf.jasperreports.charts.design; 29 30 import net.sf.jasperreports.charts.JRDataRange; 31 import net.sf.jasperreports.charts.JRMeterPlot; 32 import net.sf.jasperreports.charts.JRValueDisplay; 33 import net.sf.jasperreports.charts.base.JRBaseMeterPlot; 34 import net.sf.jasperreports.charts.util.JRMeterInterval; 35 import net.sf.jasperreports.engine.JRChartPlot; 36 import net.sf.jasperreports.engine.JRConstants; 37 import net.sf.jasperreports.engine.JRException; 38 39 import java.awt.Color ; 40 41 48 public class JRDesignMeterPlot extends JRBaseMeterPlot 49 { 50 51 52 55 private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID; 56 57 58 63 public JRDesignMeterPlot(JRChartPlot meterPlot) 64 { 65 super(meterPlot); 66 } 67 68 76 public void setDataRange(JRDataRange dataRange) throws JRException 77 { 78 this.dataRange = dataRange; 79 } 80 81 86 public void setValueDisplay(JRValueDisplay valueDisplay) 87 { 88 this.valueDisplay = valueDisplay; 89 } 90 91 99 public void setShape(byte shape) throws JRException 100 { 101 if (shape < 0 || shape > JRMeterPlot.SHAPE_PIE) 102 { 103 throw new JRException("Unknown shape for MeterPlot"); 104 } 105 106 this.shape = shape; 107 } 108 109 115 public void addInterval(JRMeterInterval interval) 116 { 117 intervals.add(interval); 118 } 119 120 123 public void clearIntervals() 124 { 125 intervals.clear(); 126 } 127 128 129 134 public void setMeterAngle(int meterAngle) 135 { 136 this.meterAngle = meterAngle; 137 } 138 139 145 public void setUnits(String units) 146 { 147 this.units = units; 148 } 149 150 158 public void setTickInterval(double tickInterval) 159 { 160 this.tickInterval = tickInterval; 161 } 162 163 168 public void setMeterBackgroundColor(Color meterBackgroundColor) 169 { 170 this.meterBackgroundColor = meterBackgroundColor; 171 } 172 173 178 public void setNeedleColor(Color needleColor) 179 { 180 this.needleColor = needleColor; 181 } 182 183 188 public void setTickColor(Color tickColor) 189 { 190 this.tickColor = tickColor; 191 } 192 } 193 | Popular Tags |