[1962] | 1 | using System.Drawing;
|
---|
| 2 |
|
---|
| 3 | namespace HeuristicLab.Visualization.Options {
|
---|
| 4 | public class DataRowSettings {
|
---|
| 5 | public event UpdateDataRowSettingsHandler OnUpdateDataRowSettings;
|
---|
[1972] | 6 | public event DataVisualSettingChangedHandler DataVisualSettingChanged;
|
---|
[1962] | 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;
|
---|
[1972] | 43 | OnDataVisualSettingChanged(this);
|
---|
[1962] | 44 | }
|
---|
| 45 | }
|
---|
[1972] | 46 |
|
---|
[1962] | 47 | public Color Color {
|
---|
| 48 | get { return color; }
|
---|
| 49 | set {
|
---|
| 50 | color = value;
|
---|
[1972] | 51 | OnDataVisualSettingChanged(this);
|
---|
[1962] | 52 | }
|
---|
| 53 | }
|
---|
| 54 |
|
---|
| 55 | public int Thickness {
|
---|
| 56 | get { return thickness; }
|
---|
| 57 | set {
|
---|
| 58 | thickness = value;
|
---|
[1972] | 59 | OnDataVisualSettingChanged(this);
|
---|
[1962] | 60 | }
|
---|
| 61 | }
|
---|
| 62 |
|
---|
[1972] | 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 |
|
---|
[1962] | 93 | }
|
---|
| 94 | public delegate void UpdateDataRowSettingsHandler();
|
---|
[1972] | 95 | public delegate void DataVisualSettingChangedHandler(DataRowSettings row);
|
---|
[1962] | 96 | }
|
---|