Changeset 4870
- Timestamp:
- 11/20/10 02:44:45 (14 years ago)
- Location:
- trunk/sources
- Files:
-
- 1 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Analysis.Views/3.3/DataTableView.cs
r4849 r4870 67 67 foreach (DataRow row in Content.Rows) 68 68 DeregisterDataRowEvents(row); 69 Content.VisualPropertiesChanged -= new EventHandler(Content_VisualPropertiesChanged); 69 70 Content.Rows.ItemsAdded -= new CollectionItemsChangedEventHandler<DataRow>(Rows_ItemsAdded); 70 71 Content.Rows.ItemsRemoved -= new CollectionItemsChangedEventHandler<DataRow>(Rows_ItemsRemoved); … … 80 81 protected override void RegisterContentEvents() { 81 82 base.RegisterContentEvents(); 83 Content.VisualPropertiesChanged += new EventHandler(Content_VisualPropertiesChanged); 82 84 Content.Rows.ItemsAdded += new CollectionItemsChangedEventHandler<DataRow>(Rows_ItemsAdded); 83 85 Content.Rows.ItemsRemoved += new CollectionItemsChangedEventHandler<DataRow>(Rows_ItemsRemoved); … … 92 94 invisibleSeries.Clear(); 93 95 chart.Titles[0].Text = string.Empty; 96 chart.ChartAreas[0].AxisX.Title = string.Empty; 97 chart.ChartAreas[0].AxisY.Title = string.Empty; 98 chart.ChartAreas[0].AxisY2.Title = string.Empty; 94 99 chart.Series.Clear(); 95 100 if (Content != null) { … … 97 102 foreach (DataRow row in Content.Rows) 98 103 AddDataRow(row); 104 chart.ChartAreas[0].AxisX.Title = Content.VisualProperties.XAxisTitle; 105 chart.ChartAreas[0].AxisY.Title = Content.VisualProperties.YAxisTitle; 106 chart.ChartAreas[0].AxisY2.Title = Content.VisualProperties.SecondYAxisTitle; 99 107 } 100 108 } … … 188 196 } 189 197 } 198 private void Content_VisualPropertiesChanged(object sender, EventArgs e) { 199 if (InvokeRequired) 200 Invoke(new EventHandler(Content_VisualPropertiesChanged), sender, e); 201 else { 202 chart.ChartAreas[0].AxisX.Title = Content.VisualProperties.XAxisTitle; 203 chart.ChartAreas[0].AxisY.Title = Content.VisualProperties.YAxisTitle; 204 chart.ChartAreas[0].AxisY2.Title = Content.VisualProperties.SecondYAxisTitle; 205 } 206 } 190 207 private void Rows_ItemsAdded(object sender, CollectionItemsChangedEventArgs<DataRow> e) { 191 208 if (InvokeRequired) -
trunk/sources/HeuristicLab.Analysis/3.3/AlleleFrequencyAnalyzer.cs
r4849 r4870 172 172 if (!results.ContainsKey("Alleles")) { 173 173 allelesTable = new DataTable("Alleles"); 174 results.Add(new Result("Alleles", allelesTable)); 174 allelesTable.VisualProperties.XAxisTitle = "Iteration"; 175 allelesTable.VisualProperties.YAxisTitle = "Number of Alleles"; 176 allelesTable.VisualProperties.SecondYAxisTitle = "Number of Alleles"; 175 177 176 178 allelesTable.Rows.Add(new DataRow("Unique Alleles")); … … 192 194 allelesTable.Rows["Lost Alleles of Best Known Solution"].VisualProperties.SecondYAxis = true; 193 195 allelesTable.Rows["Lost Alleles of Best Known Solution"].VisualProperties.StartIndexZero = true; 196 197 results.Add(new Result("Alleles", allelesTable)); 194 198 } else { 195 199 allelesTable = (DataTable)results["Alleles"].Value; -
trunk/sources/HeuristicLab.Analysis/3.3/DataRowVisualProperties.cs
r4777 r4870 119 119 startIndexZero = false; 120 120 } 121 public DataRowVisualProperties(DataRowChartType chartType, bool secondYAxis, Color color, bool startIndexZero) {122 this.chartType = chartType;123 this.secondYAxis = secondYAxis;124 this.color = color;125 this.startIndexZero = startIndexZero;126 }127 121 128 122 public override IDeepCloneable Clone(Cloner cloner) { -
trunk/sources/HeuristicLab.Analysis/3.3/DataTable.cs
r4774 r4870 22 22 using System; 23 23 using System.Collections.Generic; 24 using System.ComponentModel; 24 25 using System.Drawing; 25 26 using System.Linq; … … 41 42 } 42 43 43 [Storable] 44 private DataTableVisualProperties visualProperties; 45 public DataTableVisualProperties VisualProperties { 46 get { return visualProperties; } 47 set { 48 if (visualProperties != value) { 49 if (value == null) throw new ArgumentNullException("VisualProperties"); 50 if (visualProperties != null) visualProperties.PropertyChanged -= new PropertyChangedEventHandler(VisualProperties_PropertyChanged); 51 visualProperties = value; 52 visualProperties.PropertyChanged += new PropertyChangedEventHandler(VisualProperties_PropertyChanged); 53 OnVisualPropertiesChanged(); 54 } 55 } 56 } 57 44 58 private NamedItemCollection<DataRow> rows; 45 59 public NamedItemCollection<DataRow> Rows { … … 47 61 } 48 62 49 #region Storing & Cloning 63 #region Persistence Properties 64 [Storable(Name = "VisualProperties")] 65 private DataTableVisualProperties StorableVisualProperties { 66 get { return VisualProperties; } 67 set { VisualProperties = value; } 68 } 69 [Storable(Name = "rows")] 70 private IEnumerable<DataRow> StorableRows { 71 get { return rows; } 72 set { rows = new NamedItemCollection<DataRow>(value); } 73 } 74 #endregion 75 50 76 [StorableConstructor] 51 77 private DataTable(bool deserializing) : base(deserializing) { } 52 78 private DataTable(DataTable original, Cloner cloner) 53 79 : base(original, cloner) { 80 this.VisualProperties = (DataTableVisualProperties)cloner.Clone(original.visualProperties); 54 81 this.rows = cloner.Clone(original.rows); 55 82 this.RegisterRowsEvents(); 56 83 } 84 public DataTable() 85 : base() { 86 VisualProperties = new DataTableVisualProperties(); 87 rows = new NamedItemCollection<DataRow>(); 88 this.RegisterRowsEvents(); 89 } 90 public DataTable(string name) 91 : base(name) { 92 VisualProperties = new DataTableVisualProperties(); 93 rows = new NamedItemCollection<DataRow>(); 94 this.RegisterRowsEvents(); 95 } 96 public DataTable(string name, string description) 97 : base(name, description) { 98 VisualProperties = new DataTableVisualProperties(); 99 rows = new NamedItemCollection<DataRow>(); 100 this.RegisterRowsEvents(); 101 } 102 103 // BackwardsCompatibility3.3 104 #region Backwards compatible code, remove with 3.4 105 [StorableHook(HookType.AfterDeserialization)] 106 private void AfterDeserialization() { 107 if (VisualProperties == null) VisualProperties = new DataTableVisualProperties(); 108 } 109 #endregion 110 57 111 public override IDeepCloneable Clone(Cloner cloner) { 58 112 return new DataTable(this, cloner); 59 113 } 60 #endregion 61 public DataTable() 62 : base() { 63 rows = new NamedItemCollection<DataRow>(); 64 this.RegisterRowsEvents(); 65 } 66 public DataTable(string name) 67 : base(name) { 68 rows = new NamedItemCollection<DataRow>(); 69 this.RegisterRowsEvents(); 70 } 71 public DataTable(string name, string description) 72 : base(name, description) { 73 rows = new NamedItemCollection<DataRow>(); 74 this.RegisterRowsEvents(); 114 115 public event EventHandler VisualPropertiesChanged; 116 private void OnVisualPropertiesChanged() { 117 EventHandler handler = VisualPropertiesChanged; 118 if (handler != null) handler(this, EventArgs.Empty); 119 } 120 121 private void VisualProperties_PropertyChanged(object sender, PropertyChangedEventArgs e) { 122 OnVisualPropertiesChanged(); 75 123 } 76 124 -
trunk/sources/HeuristicLab.Analysis/3.3/HeuristicLab.Analysis-3.3.csproj
r4703 r4870 118 118 <Compile Include="Allele.cs" /> 119 119 <Compile Include="AlleleFrequency.cs" /> 120 <Compile Include="DataTableVisualProperties.cs" /> 120 121 <Compile Include="DataTableHistory.cs" /> 121 122 <Compile Include="HeatMapHistory.cs" /> -
trunk/sources/HeuristicLab.Analysis/3.3/PopulationDiversityAnalyzer.cs
r4862 r4870 186 186 if (!results.ContainsKey("Average Minimum/Average/Maximum Solution Similarity")) { 187 187 minAvgMaxSimilarityDataTable = new DataTable("Average Minimum/Average/Maximum Solution Similarity"); 188 results.Add(new Result("Average Minimum/Average/Maximum Solution Similarity", minAvgMaxSimilarityDataTable)); 188 minAvgMaxSimilarityDataTable.VisualProperties.XAxisTitle = "Iteration"; 189 minAvgMaxSimilarityDataTable.VisualProperties.YAxisTitle = "Solution Similarity"; 189 190 minAvgMaxSimilarityDataTable.Rows.Add(new DataRow("Average Minimum Solution Similarity", null)); 190 191 minAvgMaxSimilarityDataTable.Rows["Average Minimum Solution Similarity"].VisualProperties.StartIndexZero = true; … … 193 194 minAvgMaxSimilarityDataTable.Rows.Add(new DataRow("Average Maximum Solution Similarity", null)); 194 195 minAvgMaxSimilarityDataTable.Rows["Average Maximum Solution Similarity"].VisualProperties.StartIndexZero = true; 196 results.Add(new Result("Average Minimum/Average/Maximum Solution Similarity", minAvgMaxSimilarityDataTable)); 195 197 } else { 196 198 minAvgMaxSimilarityDataTable = (DataTable)results["Average Minimum/Average/Maximum Solution Similarity"].Value; … … 202 204 // store minimum, average, maximum similarities data table 203 205 DataTable minAvgMaxSimilaritiesDataTable = new DataTable("Minimum/Average/Maximum Solution Similarities"); 206 minAvgMaxSimilaritiesDataTable.VisualProperties.XAxisTitle = "Solution Index"; 207 minAvgMaxSimilaritiesDataTable.VisualProperties.YAxisTitle = "Solution Similarity"; 204 208 minAvgMaxSimilaritiesDataTable.Rows.Add(new DataRow("Minimum Solution Similarity", null, minSimilarities)); 205 209 minAvgMaxSimilaritiesDataTable.Rows["Minimum Solution Similarity"].VisualProperties.ChartType = DataRowVisualProperties.DataRowChartType.Points;
Note: See TracChangeset
for help on using the changeset viewer.