Changeset 1350 for trunk/sources/HeuristicLab.Visualization/DataRow.cs
- Timestamp:
- 03/16/09 19:42:17 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Visualization/DataRow.cs
r1343 r1350 15 15 public delegate void ValueChangedHandler(IDataRow row, double value, int index, Action action); 16 16 17 public class DataRow : IDataRow { 18 private string label = ""; 19 private Color color = Color.Black; 20 private int thickness = 2; 21 private DrawingStyle style = DrawingStyle.Solid; 22 private DataRowType lineType = DataRowType.Normal; 17 public class DataRow : DataRowBase { 23 18 private readonly List<double> dataRow = new List<double>(); 24 25 private ILabelProvider labelProvider = new ContinuousLabelProvider("0.##");26 19 27 20 // TODO implement calculation of min and max values 28 21 private double minValue = double.MaxValue; 29 22 private double maxValue = double.MinValue; 30 31 public DataRowType LineType{32 get { return lineType; }33 set {34 lineType = value;35 OnDataRowChanged(this);36 }37 }38 39 public ILabelProvider YAxisLabelProvider {40 get { return labelProvider; }41 set {42 this.labelProvider = value;43 OnDataRowChanged(this);44 }45 }46 23 47 24 public DataRow() { … … 60 37 } 61 38 62 public event DataRowChangedHandler DataRowChanged; 63 64 protected void OnDataRowChanged(IDataRow row) { 65 if (DataRowChanged != null) { 66 DataRowChanged(this); 67 } 68 } 69 70 public event ValuesChangedHandler ValuesChanged; 71 72 protected void OnValuesChanged(double[] values, int index, Action action) { 73 if (ValuesChanged != null) { 74 ValuesChanged(this, values, index, action); 75 } 76 } 77 78 public event ValueChangedHandler ValueChanged; 79 80 protected void OnValueChanged(double value, int index, Action action) { 81 if (ValueChanged != null) { 82 ValueChanged(this, value, index, action); 83 } 84 } 85 86 public string Label { 87 get { return label; } 88 set { 89 label = value; 90 OnDataRowChanged(this); 91 } 92 } 93 94 95 public Color Color { 96 get { return color; } 97 set { 98 color = value; 99 OnDataRowChanged(this); 100 } 101 } 102 103 public int Thickness { 104 get { return thickness; } 105 set { 106 thickness = value; 107 OnDataRowChanged(this); 108 } 109 } 110 111 public DrawingStyle Style { 112 get { return style; } 113 set { 114 style = value; 115 OnDataRowChanged(this); 116 } 117 } 118 119 private bool showYAxis = true; 120 121 public virtual bool ShowYAxis { 122 get { return showYAxis; } 123 set { 124 showYAxis = value; 125 OnDataRowChanged(this); 126 } 127 } 128 129 public void AddValue(double value) { 39 public override void AddValue(double value) { 130 40 UpdateMinMaxValue(value); 131 41 … … 134 44 } 135 45 136 public void AddValue(double value, int index) {46 public override void AddValue(double value, int index) { 137 47 //check if index is valid 138 48 if (index >= 0 && index < dataRow.Count) { … … 144 54 } 145 55 146 public void AddValues(double[] values) {56 public override void AddValues(double[] values) { 147 57 int startInd = dataRow.Count; 148 58 … … 153 63 } 154 64 155 public void AddValues(double[] values, int index) {65 public override void AddValues(double[] values, int index) { 156 66 int j = index; 157 67 … … 168 78 } 169 79 170 public void ModifyValue(double value, int index) {80 public override void ModifyValue(double value, int index) { 171 81 //check if index is valid 172 82 if (index >= 0 && index < dataRow.Count) { … … 178 88 } 179 89 180 public void ModifyValues(double[] values, int index) {90 public override void ModifyValues(double[] values, int index) { 181 91 int startInd = index; 182 92 int modInd = index; … … 194 104 } 195 105 196 public void RemoveValue(int index) {106 public override void RemoveValue(int index) { 197 107 double remVal = dataRow[index]; 198 108 //check if index is valid … … 205 115 } 206 116 207 public void RemoveValues(int index, int count) {117 public override void RemoveValues(int index, int count) { 208 118 double[] remValues = new double[count]; //removed values 209 119 int j = 0; … … 227 137 } 228 138 229 public int Count {139 public override int Count { 230 140 get { return dataRow.Count; } 231 141 } 232 142 233 public double this[int index] {143 public override double this[int index] { 234 144 get { return dataRow[index]; } 235 145 set { … … 239 149 } 240 150 241 public double MinValue {151 public override double MinValue { 242 152 get { return minValue; } 243 153 } 244 154 245 public double MaxValue {155 public override double MaxValue { 246 156 get { return maxValue; } 247 157 }
Note: See TracChangeset
for help on using the changeset viewer.