1 | using HeuristicLab.Visualization.Options;
|
---|
2 |
|
---|
3 | namespace HeuristicLab.Visualization {
|
---|
4 | public abstract class DataRowBase : IDataRow {
|
---|
5 | //private string label = "";
|
---|
6 | //private Color color = Color.Black;
|
---|
7 | //private int thickness = 2;
|
---|
8 | private DrawingStyle style = DrawingStyle.Solid;
|
---|
9 | private DataRowType lineType = DataRowType.Normal;
|
---|
10 | private YAxisDescriptor yAxis;
|
---|
11 | private bool showMarkers = true;
|
---|
12 |
|
---|
13 | private DataRowSettings rowSettings = new DataRowSettings();
|
---|
14 |
|
---|
15 | public DataRowSettings RowSettings {
|
---|
16 | get { return rowSettings; }
|
---|
17 | set { rowSettings = value; }
|
---|
18 | }
|
---|
19 |
|
---|
20 | public bool ShowMarkers {
|
---|
21 | get { return showMarkers; }
|
---|
22 | set {
|
---|
23 | showMarkers = value;
|
---|
24 | OnDataRowChanged(this);
|
---|
25 | }
|
---|
26 | }
|
---|
27 |
|
---|
28 | // public string Label {
|
---|
29 | // get { return label; }
|
---|
30 | // set {
|
---|
31 | // label = value;
|
---|
32 | // OnDataRowChanged(this);
|
---|
33 | // }
|
---|
34 | // }
|
---|
35 | //
|
---|
36 | // public Color Color {
|
---|
37 | // get { return color; }
|
---|
38 | // set {
|
---|
39 | // color = value;
|
---|
40 | // OnDataRowChanged(this);
|
---|
41 | // }
|
---|
42 | // }
|
---|
43 | //
|
---|
44 | // public int Thickness {
|
---|
45 | // get { return thickness; }
|
---|
46 | // set {
|
---|
47 | // thickness = value;
|
---|
48 | // OnDataRowChanged(this);
|
---|
49 | // }
|
---|
50 | // }
|
---|
51 |
|
---|
52 | public DrawingStyle Style {
|
---|
53 | get { return style; }
|
---|
54 | set {
|
---|
55 | style = value;
|
---|
56 | OnDataRowChanged(this);
|
---|
57 | }
|
---|
58 | }
|
---|
59 |
|
---|
60 | public DataRowType LineType {
|
---|
61 | get { return lineType; }
|
---|
62 | set {
|
---|
63 | lineType = value;
|
---|
64 | OnDataRowChanged(this);
|
---|
65 | }
|
---|
66 | }
|
---|
67 |
|
---|
68 | public YAxisDescriptor YAxis {
|
---|
69 | get { return yAxis; }
|
---|
70 | set {
|
---|
71 | yAxis = value;
|
---|
72 | yAxis.AddDataRow(this);
|
---|
73 | yAxis.YAxisDescriptorChanged += delegate { OnDataRowChanged(this); };
|
---|
74 | OnDataRowChanged(this);
|
---|
75 | }
|
---|
76 | }
|
---|
77 |
|
---|
78 | protected void OnDataRowChanged(IDataRow row) {
|
---|
79 | if (DataRowChanged != null) {
|
---|
80 | DataRowChanged(this);
|
---|
81 | }
|
---|
82 | }
|
---|
83 |
|
---|
84 | protected void OnValuesChanged(double[] values, int index, Action action) {
|
---|
85 | if (ValuesChanged != null) {
|
---|
86 | ValuesChanged(this, values, index, action);
|
---|
87 | }
|
---|
88 | }
|
---|
89 |
|
---|
90 | protected void OnValueChanged(double value, int index, Action action) {
|
---|
91 | if (ValueChanged != null) {
|
---|
92 | ValueChanged(this, value, index, action);
|
---|
93 | }
|
---|
94 | }
|
---|
95 |
|
---|
96 | public abstract void AddValue(double value);
|
---|
97 |
|
---|
98 | public abstract void AddValue(double value, int index);
|
---|
99 |
|
---|
100 | public abstract void AddValues(double[] values);
|
---|
101 |
|
---|
102 | public abstract void AddValues(double[] values, int index);
|
---|
103 |
|
---|
104 | public abstract void ModifyValue(double value, int index);
|
---|
105 |
|
---|
106 | public abstract void ModifyValues(double[] values, int index);
|
---|
107 |
|
---|
108 | public abstract void RemoveValue(int index);
|
---|
109 |
|
---|
110 | public abstract void RemoveValues(int index, int count);
|
---|
111 |
|
---|
112 | public abstract int Count { get; }
|
---|
113 |
|
---|
114 | public abstract double this[int index] { get; set; }
|
---|
115 |
|
---|
116 | public abstract double MinValue { get; }
|
---|
117 |
|
---|
118 | public abstract double MaxValue { get; }
|
---|
119 |
|
---|
120 | public event ValuesChangedHandler ValuesChanged;
|
---|
121 |
|
---|
122 | public event ValueChangedHandler ValueChanged;
|
---|
123 |
|
---|
124 | public event DataRowChangedHandler DataRowChanged;
|
---|
125 | }
|
---|
126 | } |
---|