Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.Visualization/3.2/Options/DataRowSettings.cs @ 2960

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

DataRowSettings updated (#636)

File size: 2.3 KB
Line 
1using System.Drawing;
2
3namespace HeuristicLab.Visualization.Options {
4  public class DataRowSettings {
5    public event UpdateDataRowSettingsHandler OnUpdateDataRowSettings;
6    public event DataVisualSettingChangedHandler DataVisualSettingChanged;
7
8    private string label;
9    private Color color;
10    private int thickness;
11    private DrawingStyle style;
12    private DataRowType lineType;
13    private bool showMarkers;
14
15    public DataRowSettings() {
16      label = "";
17      color = Color.Black;
18      thickness = 2;
19      style = DrawingStyle.Solid;
20      lineType = DataRowType.Normal;
21      showMarkers = true;
22    }
23
24    public DataRowSettings(DataRowSettings src) {
25      label = src.label;
26      color = src.color;
27      thickness = src.thickness;
28      style = src.style;
29      lineType = src.lineType;
30      showMarkers = src.showMarkers;
31    }
32
33    public void UpdateView() {
34      if (OnUpdateDataRowSettings != null) {
35        OnUpdateDataRowSettings();
36      }
37    }
38
39    public string Label {
40      get { return label; }
41      set {
42        label = value;
43        OnDataVisualSettingChanged(this);
44      }
45    }
46   
47    public Color Color {
48      get { return color; }
49      set {
50        color = value;
51        OnDataVisualSettingChanged(this);
52      }
53    }
54
55    public int Thickness {
56      get { return thickness; }
57      set {
58        thickness = value;
59        OnDataVisualSettingChanged(this);
60      }
61    }
62
63    public DrawingStyle Style {
64      get { return style; }
65      set {
66        style = value;
67        OnDataVisualSettingChanged(this);
68      }
69    }
70
71    public DataRowType LineType {
72      get { return lineType; }
73      set {
74        lineType = value;
75        OnDataVisualSettingChanged(this);
76      }
77    }
78
79    public bool ShowMarkers {
80      get { return showMarkers; }
81      set {
82        showMarkers = value;
83        OnDataVisualSettingChanged(this);
84      }
85    }
86   
87    protected void OnDataVisualSettingChanged(DataRowSettings row) {
88      if (DataVisualSettingChanged != null) {
89        DataVisualSettingChanged(this);
90      }
91    }
92
93  }
94  public delegate void UpdateDataRowSettingsHandler();
95  public delegate void DataVisualSettingChangedHandler(DataRowSettings row);
96}
Note: See TracBrowser for help on using the repository browser.