1 32 33 package it.businesslogic.ireport.chart; 34 35 import java.awt.Color ; 36 37 41 public class MeterPlot extends Plot{ 42 43 private String shape = "pie"; 44 private int angle = 180; 45 private String units = ""; 46 private double tickInterval = 10.0; 47 private java.awt.Color meterColor = null; 48 private java.awt.Color needleColor = null; 49 private java.awt.Color tickColor = null; 50 51 private java.util.List meterIntervals = new java.util.ArrayList (); 52 53 private ValueDisplay valueDisplay = new ValueDisplay(); 54 55 private DataRange dataRange = new DataRange(); 56 57 58 59 60 public MeterPlot() { 61 } 62 63 64 65 public Plot cloneMe() 66 { 67 MeterPlot obj = new MeterPlot(); 68 copyBasePlot(obj); 69 obj.setShape( new String (getShape()) ); 70 obj.setAngle( getAngle() ); 71 obj.setUnits( new String (getUnits()) ); 72 obj.setTickInterval( getTickInterval() ); 73 if (getTickColor() != null) obj.setTickColor( new Color ( getTickColor().getRGB()) ); 74 if (getNeedleColor() != null) obj.setNeedleColor( new Color ( getNeedleColor().getRGB()) ); 75 if (getMeterColor() != null) obj.setMeterColor( new Color ( getMeterColor().getRGB()) ); 76 obj.setValueDisplay( getValueDisplay().cloneMe() ); 77 obj.setDataRange( getDataRange().cloneMe() ); 78 79 for (int i=0; i<getMeterIntervals().size(); ++i) 80 { 81 obj.getMeterIntervals().add( ((MeterInterval)getMeterIntervals().get(i)).cloneMe() ); 82 } 83 84 return obj; 85 } 86 87 public String getShape() { 88 return shape; 89 } 90 91 public void setShape(String shape) { 92 this.shape = shape; 93 } 94 95 public int getAngle() { 96 return angle; 97 } 98 99 public void setAngle(int angle) { 100 this.angle = angle; 101 } 102 103 public String getUnits() { 104 return units; 105 } 106 107 public void setUnits(String units) { 108 this.units = units; 109 } 110 111 public double getTickInterval() { 112 return tickInterval; 113 } 114 115 public void setTickInterval(double tickInterval) { 116 this.tickInterval = tickInterval; 117 } 118 119 public java.awt.Color getMeterColor() { 120 return meterColor; 121 } 122 123 public void setMeterColor(java.awt.Color meterColor) { 124 this.meterColor = meterColor; 125 } 126 127 public java.awt.Color getNeedleColor() { 128 return needleColor; 129 } 130 131 public void setNeedleColor(java.awt.Color needleColor) { 132 this.needleColor = needleColor; 133 } 134 135 public java.awt.Color getTickColor() { 136 return tickColor; 137 } 138 139 public void setTickColor(java.awt.Color tickColor) { 140 this.tickColor = tickColor; 141 } 142 143 public ValueDisplay getValueDisplay() { 144 return valueDisplay; 145 } 146 147 public void setValueDisplay(ValueDisplay valueDisplay) { 148 this.valueDisplay = valueDisplay; 149 } 150 151 public java.util.List getMeterIntervals() { 152 return meterIntervals; 153 } 154 155 public void setMeterIntervals(java.util.List meterIntervals) { 156 this.meterIntervals = meterIntervals; 157 } 158 159 public DataRange getDataRange() { 160 return dataRange; 161 } 162 163 public void setDataRange(DataRange dataRange) { 164 this.dataRange = dataRange; 165 } 166 167 168 } 169 | Popular Tags |