1 | #region License Information
|
---|
2 | /* HeuristicLab
|
---|
3 | * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
|
---|
4 | *
|
---|
5 | * This file is part of HeuristicLab.
|
---|
6 | *
|
---|
7 | * HeuristicLab is free software: you can redistribute it and/or modify
|
---|
8 | * it under the terms of the GNU General Public License as published by
|
---|
9 | * the Free Software Foundation, either version 3 of the License, or
|
---|
10 | * (at your option) any later version.
|
---|
11 | *
|
---|
12 | * HeuristicLab is distributed in the hope that it will be useful,
|
---|
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
15 | * GNU General Public License for more details.
|
---|
16 | *
|
---|
17 | * You should have received a copy of the GNU General Public License
|
---|
18 | * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
|
---|
19 | */
|
---|
20 | #endregion
|
---|
21 |
|
---|
22 | using System.ComponentModel;
|
---|
23 | using HeuristicLab.Common;
|
---|
24 | using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
|
---|
25 |
|
---|
26 | namespace HeuristicLab.Analysis {
|
---|
27 | /// <summary>
|
---|
28 | /// Visual properties of a DataRow.
|
---|
29 | /// </summary>
|
---|
30 | [StorableClass]
|
---|
31 | public class DataRowVisualProperties : DeepCloneable, INotifyPropertyChanged {
|
---|
32 | #region ChartType
|
---|
33 | public enum DataRowChartType {
|
---|
34 | Line,
|
---|
35 | Columns,
|
---|
36 | Points,
|
---|
37 | Bars
|
---|
38 | }
|
---|
39 | #endregion
|
---|
40 |
|
---|
41 | [Storable(DefaultValue = DataRowChartType.Line)]
|
---|
42 | private DataRowChartType chartType;
|
---|
43 | public DataRowChartType ChartType {
|
---|
44 | get { return chartType; }
|
---|
45 | set {
|
---|
46 | if (chartType != value) {
|
---|
47 | chartType = value;
|
---|
48 | OnPropertyChanged("ChartType");
|
---|
49 | }
|
---|
50 | }
|
---|
51 | }
|
---|
52 | [Storable(DefaultValue = false)]
|
---|
53 | private bool secondYAxis;
|
---|
54 | public bool SecondYAxis {
|
---|
55 | get { return secondYAxis; }
|
---|
56 | set {
|
---|
57 | if (secondYAxis != value) {
|
---|
58 | secondYAxis = value;
|
---|
59 | OnPropertyChanged("SecondYAxis");
|
---|
60 | }
|
---|
61 | }
|
---|
62 | }
|
---|
63 |
|
---|
64 | public DataRowVisualProperties() {
|
---|
65 | chartType = DataRowChartType.Line;
|
---|
66 | secondYAxis = false;
|
---|
67 | }
|
---|
68 | public DataRowVisualProperties(DataRowChartType chartType, bool secondYAxis) {
|
---|
69 | this.chartType = chartType;
|
---|
70 | this.secondYAxis = secondYAxis;
|
---|
71 | }
|
---|
72 | [StorableConstructor]
|
---|
73 | protected DataRowVisualProperties(bool deserializing) { }
|
---|
74 |
|
---|
75 | public override IDeepCloneable Clone(Cloner cloner) {
|
---|
76 | DataRowVisualProperties clone = (DataRowVisualProperties)base.Clone(cloner);
|
---|
77 | clone.chartType = chartType;
|
---|
78 | clone.secondYAxis = secondYAxis;
|
---|
79 | return clone;
|
---|
80 | }
|
---|
81 |
|
---|
82 | public event PropertyChangedEventHandler PropertyChanged;
|
---|
83 | protected virtual void OnPropertyChanged(string propertyName) {
|
---|
84 | PropertyChangedEventHandler handler = PropertyChanged;
|
---|
85 | if (handler != null) handler(this, new PropertyChangedEventArgs(propertyName));
|
---|
86 | }
|
---|
87 | }
|
---|
88 | }
|
---|