Changeset 4644
- Timestamp:
- 10/25/10 15:06:21 (14 years ago)
- Location:
- trunk/sources
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Analysis.Views/3.3/DataTableView.cs
r4637 r4644 107 107 private void AddDataRow(DataRow row) { 108 108 Series series = new Series(row.Name); 109 series.ChartType = SeriesChartType.FastLine; 109 switch (row.VisualProperties.ChartType) { 110 case DataRowVisualProperties.DataRowChartType.Line: 111 series.ChartType = SeriesChartType.FastLine; 112 break; 113 case DataRowVisualProperties.DataRowChartType.Bars: 114 series.ChartType = SeriesChartType.Bar; 115 break; 116 case DataRowVisualProperties.DataRowChartType.Columns: 117 series.ChartType = SeriesChartType.Column; 118 break; 119 case DataRowVisualProperties.DataRowChartType.Points: 120 series.ChartType = SeriesChartType.FastPoint; 121 break; 122 default: 123 series.ChartType = SeriesChartType.FastPoint; 124 break; 125 } 126 series.YAxisType = row.VisualProperties.SecondYAxis ? AxisType.Secondary : AxisType.Primary; 110 127 series.ToolTip = row.Name + " X = #INDEX, Y = #VAL"; 111 128 FillSeriesWithRowValues(series, row); … … 142 159 private void RegisterDataRowEvents(DataRow row) { 143 160 row.NameChanged += new EventHandler(Row_NameChanged); 161 row.VisualPropertiesChanged += new EventHandler(Row_VisualPropertiesChanged); 144 162 valuesRowsTable.Add(row.Values, row); 145 163 row.Values.ItemsAdded += new CollectionItemsChangedEventHandler<IndexedItem<double>>(Values_ItemsAdded); … … 156 174 row.Values.CollectionReset -= new CollectionItemsChangedEventHandler<IndexedItem<double>>(Values_CollectionReset); 157 175 valuesRowsTable.Remove(row.Values); 176 row.VisualPropertiesChanged -= new EventHandler(Row_VisualPropertiesChanged); 158 177 row.NameChanged -= new EventHandler(Row_NameChanged); 159 178 } … … 212 231 RegisterDataRowEvents(row); 213 232 } 233 } 234 } 235 private void Row_VisualPropertiesChanged(object sender, EventArgs e) { 236 if (InvokeRequired) 237 Invoke(new EventHandler(Row_VisualPropertiesChanged), sender, e); 238 else { 239 DataRow row = (DataRow)sender; 240 switch (row.VisualProperties.ChartType) { 241 case DataRowVisualProperties.DataRowChartType.Line: 242 chart.Series[row.Name].ChartType = SeriesChartType.FastLine; 243 break; 244 case DataRowVisualProperties.DataRowChartType.Bars: 245 chart.Series[row.Name].ChartType = SeriesChartType.Bar; 246 break; 247 case DataRowVisualProperties.DataRowChartType.Columns: 248 chart.Series[row.Name].ChartType = SeriesChartType.Column; 249 break; 250 case DataRowVisualProperties.DataRowChartType.Points: 251 chart.Series[row.Name].ChartType = SeriesChartType.FastPoint; 252 break; 253 default: 254 chart.Series[row.Name].ChartType = SeriesChartType.FastPoint; 255 break; 256 } 257 chart.Series[row.Name].YAxisType = row.VisualProperties.SecondYAxis ? AxisType.Secondary : AxisType.Primary; 214 258 } 215 259 } -
trunk/sources/HeuristicLab.Analysis/3.3/DataRow.cs
r3431 r4644 20 20 #endregion 21 21 22 using System; 23 using System.Collections.Generic; 24 using System.ComponentModel; 22 25 using HeuristicLab.Collections; 23 26 using HeuristicLab.Common; … … 32 35 [StorableClass] 33 36 public sealed class DataRow : NamedItem { 34 [Storable] 37 private DataRowVisualProperties visualProperties; 38 public DataRowVisualProperties VisualProperties { 39 get { return visualProperties; } 40 set { 41 if (visualProperties != value) { 42 if (value == null) throw new ArgumentNullException("VisualProperties"); 43 if (visualProperties != null) visualProperties.PropertyChanged -= new PropertyChangedEventHandler(VisualProperties_PropertyChanged); 44 visualProperties = value; 45 visualProperties.PropertyChanged += new PropertyChangedEventHandler(VisualProperties_PropertyChanged); 46 OnVisualPropertiesChanged(); 47 } 48 } 49 } 35 50 private ObservableList<double> values; 36 51 public IObservableList<double> Values { … … 38 53 } 39 54 55 #region Persistence Properties 56 [Storable(Name = "VisualProperties")] 57 private DataRowVisualProperties StorableVisualProperties { 58 get { return VisualProperties; } 59 set { VisualProperties = value; } 60 } 61 [Storable(Name = "values")] 62 private IEnumerable<double> StorableValues { 63 get { return values; } 64 set { values = new ObservableList<double>(value); } 65 } 66 #endregion 67 40 68 public DataRow() 41 69 : base() { 70 VisualProperties = new DataRowVisualProperties(); 42 71 values = new ObservableList<double>(); 43 72 } 44 73 public DataRow(string name) 45 74 : base(name) { 75 VisualProperties = new DataRowVisualProperties(); 46 76 values = new ObservableList<double>(); 47 77 } 48 78 public DataRow(string name, string description) 49 79 : base(name, description) { 80 VisualProperties = new DataRowVisualProperties(); 50 81 values = new ObservableList<double>(); 51 82 } 83 public DataRow(string name, string description, DataRowVisualProperties visualProperties) 84 : base(name, description) { 85 VisualProperties = visualProperties; 86 values = new ObservableList<double>(); 87 } 88 [StorableConstructor] 89 private DataRow(bool deserializing) { } 90 91 // BackwardsCompatibility3.3 92 #region Backwards compatible code, remove with 3.4 93 [StorableHook(HookType.AfterDeserialization)] 94 private void AfterDeserialization() { 95 if (VisualProperties == null) VisualProperties = new DataRowVisualProperties(); 96 } 97 #endregion 52 98 53 99 public override IDeepCloneable Clone(Cloner cloner) { 54 100 DataRow clone = new DataRow(Name, Description); 55 101 cloner.RegisterClonedObject(this, clone); 102 clone.VisualProperties = (DataRowVisualProperties)cloner.Clone(visualProperties); 56 103 clone.values.AddRange(values); 57 104 return clone; 58 105 } 106 107 public event EventHandler VisualPropertiesChanged; 108 private void OnVisualPropertiesChanged() { 109 EventHandler handler = VisualPropertiesChanged; 110 if (handler != null) handler(this, EventArgs.Empty); 111 } 112 113 private void VisualProperties_PropertyChanged(object sender, PropertyChangedEventArgs e) { 114 OnVisualPropertiesChanged(); 115 } 59 116 } 60 117 } -
trunk/sources/HeuristicLab.Analysis/3.3/HeuristicLab.Analysis-3.3.csproj
r4641 r4644 118 118 <Compile Include="Allele.cs" /> 119 119 <Compile Include="AlleleFrequency.cs" /> 120 <Compile Include="DataRowVisualProperties.cs" /> 120 121 <Compile Include="QualityAnalyzer.cs" /> 121 122 <Compile Include="MinAverageMaxValueAnalyzer.cs" />
Note: See TracChangeset
for help on using the changeset viewer.