Free cookie consent management tool by TermsFeed Policy Generator

source: branches/histogram/HeuristicLab.Analysis/3.3/DataVisualization/DataTableVisualProperties.cs @ 6012

Last change on this file since 6012 was 6012, checked in by abeham, 12 years ago

#1465

  • fine tuned UI for setting data(table|row) visual properties
  • added control for the data table visual properties
  • added a few more visual properties
File size: 4.2 KB
Line 
1#region License Information
2/* HeuristicLab
3 * Copyright (C) 2002-2011 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
22using System.ComponentModel;
23using HeuristicLab.Common;
24using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
25
26namespace HeuristicLab.Analysis {
27  /// <summary>
28  /// Visual properties of a DataTable.
29  /// </summary>
30  [StorableClass]
31  public class DataTableVisualProperties : DeepCloneable, INotifyPropertyChanged {
32    private string xAxisTitle;
33    public string XAxisTitle {
34      get { return xAxisTitle; }
35      set {
36        if (value == null) value = string.Empty;
37        if (xAxisTitle != value) {
38          xAxisTitle = value;
39          OnPropertyChanged("XAxisTitle");
40        }
41      }
42    }
43
44    private string yAxisTitle;
45    public string YAxisTitle {
46      get { return yAxisTitle; }
47      set {
48        if (value == null) value = string.Empty;
49        if (yAxisTitle != value) {
50          yAxisTitle = value;
51          OnPropertyChanged("YAxisTitle");
52        }
53      }
54    }
55
56    private string secondXAxisTitle;
57    public string SecondXAxisTitle {
58      get { return secondXAxisTitle; }
59      set {
60        if (value == null) value = string.Empty;
61        if (secondXAxisTitle != value) {
62          secondXAxisTitle = value;
63          OnPropertyChanged("SecondXAxisTitle");
64        }
65      }
66    }
67
68    private string secondYAxisTitle;
69    public string SecondYAxisTitle {
70      get { return secondYAxisTitle; }
71      set {
72        if (value == null) value = string.Empty;
73        if (secondYAxisTitle != value) {
74          secondYAxisTitle = value;
75          OnPropertyChanged("SecondYAxisTitle");
76        }
77      }
78    }
79
80    #region Persistence Properties
81    [Storable(Name = "XAxisTitle")]
82    private string StorableXAxisTitle {
83      get { return xAxisTitle; }
84      set { xAxisTitle = value; }
85    }
86    [Storable(Name = "YAxisTitle")]
87    private string StorableYAxisTitle {
88      get { return yAxisTitle; }
89      set { yAxisTitle = value; }
90    }
91    [Storable(Name = "SecondXAxisTitle")]
92    private string StorableSecondXAxisTitle {
93      get { return secondXAxisTitle; }
94      set { secondXAxisTitle = value; }
95    }
96    [Storable(Name = "SecondYAxisTitle")]
97    private string StorableSecondYAxisTitle {
98      get { return secondYAxisTitle; }
99      set { secondYAxisTitle = value; }
100    }
101    #endregion
102
103    [StorableConstructor]
104    protected DataTableVisualProperties(bool deserializing) : base() { }
105    protected DataTableVisualProperties(DataTableVisualProperties original, Cloner cloner)
106      : base(original, cloner) {
107      this.xAxisTitle = original.xAxisTitle;
108      this.yAxisTitle = original.yAxisTitle;
109      this.secondXAxisTitle = original.secondXAxisTitle;
110      this.secondYAxisTitle = original.secondYAxisTitle;
111    }
112    public DataTableVisualProperties() {
113      this.xAxisTitle = string.Empty;
114      this.yAxisTitle = string.Empty;
115      this.secondXAxisTitle = string.Empty;
116      this.secondYAxisTitle = string.Empty;
117    }
118
119    public override IDeepCloneable Clone(Cloner cloner) {
120      return new DataTableVisualProperties(this, cloner);
121    }
122
123    public event PropertyChangedEventHandler PropertyChanged;
124    protected virtual void OnPropertyChanged(string propertyName) {
125      PropertyChangedEventHandler handler = PropertyChanged;
126      if (handler != null) handler(this, new PropertyChangedEventArgs(propertyName));
127    }
128  }
129}
Note: See TracBrowser for help on using the repository browser.