Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.Visualization/DataRow.cs @ 796

Last change on this file since 796 was 761, checked in by mstoeger, 16 years ago

changed interface between model and view (#316)

File size: 3.2 KB
Line 
1using System;
2using System.Drawing;
3
4namespace HeuristicLab.Visualization {
5  public delegate void DataRowChangedHandler(IDataRow row);
6  public delegate void ValuesChangedHandler(IDataRow row, double[] values, int index);
7  public delegate void ValueChangedHandler(IDataRow row, double value, int index);
8
9  public class DataRow : IDataRow {
10    private string label = "";
11    private Color color = Color.Black;
12    private int thickness = 2;
13    private DrawingStyle style = DrawingStyle.Solid;
14
15    /// <summary>
16    /// Raised when data row data changed. Should cause redraw in the view.
17    /// </summary>
18    public event DataRowChangedHandler DataRowChanged;
19
20    protected void OnDataRowChanged(IDataRow row) {
21      if (DataRowChanged != null) {
22        DataRowChanged(this);
23      }
24    }
25
26    public event ValuesChangedHandler ValuesChanged;
27
28    protected void OnValuesChanged(double[] values, int index) {
29      if (ValuesChanged != null) {
30        ValuesChanged(this, values, index);
31      }
32    }
33
34    public event ValueChangedHandler ValueChanged;
35
36    protected void OnValueChanged(double value, int index) {
37      if (ValueChanged != null) {
38        ValueChanged(this, value, index);
39      }
40    }
41
42    public string Label {
43      get { return label; }
44      set {
45        label = value;
46        OnDataRowChanged(this);
47      }
48    }
49
50    public Color Color {
51      get { return color; }
52      set {
53        color = value;
54        OnDataRowChanged(this);
55      }
56    }
57
58    public int Thickness {
59      get { return thickness; }
60      set {
61        thickness = value;
62        OnDataRowChanged(this);
63      }
64    }
65
66    public DrawingStyle Style {
67      get { return style; }
68      set {
69        style = value;
70        OnDataRowChanged(this);
71      }
72    }
73
74    public void AddValue(double value) {
75      throw new NotImplementedException();
76      // TODO ValueChangedEvent auslösen
77    }
78
79    public void AddValue(double value, int index) {
80      throw new NotImplementedException();
81      // TODO ValueChangedEvent auslösen
82    }
83
84    public void AddValues(double[] values) {
85      throw new NotImplementedException();
86      // TODO ValuesChangedEvent auslösen
87    }
88
89    public void AddValues(double[] values, int index) {
90      throw new NotImplementedException();
91      // TODO ValuesChangedEvent auslösen
92    }
93
94    public void ModifyValue(double value, int index) {
95      throw new NotImplementedException();
96      // TODO ValueChangedEvent auslösen
97    }
98
99    public void ModifyValues(double[] values, int index) {
100      throw new NotImplementedException();
101      // TODO ValuesChangedEvent auslösen
102    }
103
104    public void RemoveValue(int index) {
105      throw new NotImplementedException();
106      // TODO ValueChangedEvent auslösen
107    }
108
109    public void RemoveValues(int index, int count) {
110      throw new NotImplementedException();
111      // TODO ValuesChangedEvent auslösen
112    }
113
114    public int Count {
115      get { throw new NotImplementedException(); }
116    }
117
118    public double this[int index] {
119      get { throw new NotImplementedException(); }
120      set {
121        throw new NotImplementedException();
122        // TODO ValueChangedEvent auslösen
123      }
124    }
125  }
126}
Note: See TracBrowser for help on using the repository browser.