Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.Visualization/3.2/DataRowBase.cs @ 1975

Last change on this file since 1975 was 1972, checked in by shofstad, 15 years ago

DataRowSettings updated (#636)

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