Changeset 12676 for trunk/sources/HeuristicLab.Data.Views/3.3
- Timestamp:
- 07/08/15 12:53:55 (9 years ago)
- Location:
- trunk/sources/HeuristicLab.Data.Views
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Data.Views
-
Property
svn:mergeinfo
set to
(toggle deleted branches)
/branches/DataPreprocessingImprovements/HeuristicLab.Data.Views merged eligible /branches/HLScript/HeuristicLab.Data.Views merged eligible /stable/HeuristicLab.Data.Views merged eligible /branches/1721-RandomForestPersistence/HeuristicLab.Data.Views 10321-10322 /branches/Algorithms.GradientDescent/HeuristicLab.Data.Views 5516-5520 /branches/Benchmarking/sources/HeuristicLab.Data.Views 6917-7005 /branches/CloningRefactoring/HeuristicLab.Data.Views 4656-4721 /branches/CodeEditor/HeuristicLab.Data.Views 11700-11806 /branches/DataAnalysis Refactoring/HeuristicLab.Data.Views 5471-5808 /branches/DataAnalysis SolutionEnsembles/HeuristicLab.Data.Views 5815-6180 /branches/DataAnalysis/HeuristicLab.Data.Views 4458-4459,4462,4464 /branches/DataPreprocessing/HeuristicLab.Data.Views 10085-11101 /branches/GP.Grammar.Editor/HeuristicLab.Data.Views 6284-6795 /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Data.Views 5060 /branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Data.Views 6123-9799 /branches/LogResidualEvaluator/HeuristicLab.Data.Views 10202-10483 /branches/NET40/sources/HeuristicLab.Data.Views 5138-5162 /branches/NSGA-II Changes/HeuristicLab.Data.Views 12033-12122 /branches/ParallelEngine/HeuristicLab.Data.Views 5175-5192 /branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Data.Views 7568-7810 /branches/QAPAlgorithms/HeuristicLab.Data.Views 6350-6627 /branches/Restructure trunk solution/HeuristicLab.Data.Views 6828 /branches/RuntimeOptimizer/HeuristicLab.Data.Views 8943-9078 /branches/ScatterSearch (trunk integration)/HeuristicLab.Data.Views 7787-8333 /branches/SlaveShutdown/HeuristicLab.Data.Views 8944-8956 /branches/SpectralKernelForGaussianProcesses/HeuristicLab.Data.Views 10204-10479 /branches/SuccessProgressAnalysis/HeuristicLab.Data.Views 5370-5682 /branches/Trunk/HeuristicLab.Data.Views 6829-6865 /branches/UnloadJobs/HeuristicLab.Data.Views 9168-9215 /branches/VNS/HeuristicLab.Data.Views 5594-5752 /branches/histogram/HeuristicLab.Data.Views 5959-6341
-
Property
svn:mergeinfo
set to
(toggle deleted branches)
-
trunk/sources/HeuristicLab.Data.Views/3.3
- Property svn:mergeinfo changed
/branches/DataPreprocessingImprovements/HeuristicLab.Data.Views/3.3 (added) merged: 12161,12164-12165,12168,12500,12633
- Property svn:mergeinfo changed
-
trunk/sources/HeuristicLab.Data.Views/3.3/HeuristicLab.Data.Views-3.3.csproj
r12602 r12676 41 41 <DebugType>full</DebugType> 42 42 <Optimize>false</Optimize> 43 <OutputPath> $(SolutionDir)\bin\</OutputPath>43 <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath> 44 44 <DefineConstants>DEBUG;TRACE</DefineConstants> 45 45 <ErrorReport>prompt</ErrorReport> … … 105 105 </PropertyGroup> 106 106 <ItemGroup> 107 <Reference Include="HeuristicLab.Common-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 108 <SpecificVersion>False</SpecificVersion> 109 <HintPath>..\..\..\..\..\..\HL Preprocessing\trunk\sources\bin\HeuristicLab.Common-3.3.dll</HintPath> 110 </Reference> 111 <Reference Include="HeuristicLab.Common.Resources-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 112 <SpecificVersion>False</SpecificVersion> 113 <HintPath>..\..\..\..\..\..\HL Preprocessing\trunk\sources\bin\HeuristicLab.Common.Resources-3.3.dll</HintPath> 114 </Reference> 115 <Reference Include="HeuristicLab.Core-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 116 <SpecificVersion>False</SpecificVersion> 117 <HintPath>..\..\..\..\..\..\HL Preprocessing\trunk\sources\bin\HeuristicLab.Core-3.3.dll</HintPath> 118 </Reference> 119 <Reference Include="HeuristicLab.Core.Views-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 120 <SpecificVersion>False</SpecificVersion> 121 <HintPath>..\..\..\..\..\..\HL Preprocessing\trunk\sources\bin\HeuristicLab.Core.Views-3.3.dll</HintPath> 122 </Reference> 123 <Reference Include="HeuristicLab.Data-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 124 <SpecificVersion>False</SpecificVersion> 125 <HintPath>..\..\..\..\..\..\HL Preprocessing\trunk\sources\bin\HeuristicLab.Data-3.3.dll</HintPath> 126 </Reference> 127 <Reference Include="HeuristicLab.MainForm-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 128 <SpecificVersion>False</SpecificVersion> 129 <HintPath>..\..\..\..\..\..\HL Preprocessing\trunk\sources\bin\HeuristicLab.MainForm-3.3.dll</HintPath> 130 </Reference> 131 <Reference Include="HeuristicLab.MainForm.WindowsForms-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 132 <SpecificVersion>False</SpecificVersion> 133 <HintPath>..\..\..\..\..\..\HL Preprocessing\trunk\sources\bin\HeuristicLab.MainForm.WindowsForms-3.3.dll</HintPath> 134 </Reference> 135 <Reference Include="HeuristicLab.PluginInfrastructure-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 136 <SpecificVersion>False</SpecificVersion> 137 <HintPath>..\..\..\..\..\..\HL Preprocessing\trunk\sources\bin\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath> 138 </Reference> 107 139 <Reference Include="System" /> 108 140 <Reference Include="System.Core"> … … 230 262 <None Include="HeuristicLab.snk" /> 231 263 <None Include="Properties\AssemblyInfo.cs.frame" /> 232 </ItemGroup>233 <ItemGroup>234 <ProjectReference Include="..\..\HeuristicLab.Common.Resources\3.3\HeuristicLab.Common.Resources-3.3.csproj">235 <Project>{0e27a536-1c4a-4624-a65e-dc4f4f23e3e1}</Project>236 <Name>HeuristicLab.Common.Resources-3.3</Name>237 <Private>False</Private>238 </ProjectReference>239 <ProjectReference Include="..\..\HeuristicLab.Common\3.3\HeuristicLab.Common-3.3.csproj">240 <Project>{A9AD58B9-3EF9-4CC1-97E5-8D909039FF5C}</Project>241 <Name>HeuristicLab.Common-3.3</Name>242 <Private>False</Private>243 </ProjectReference>244 <ProjectReference Include="..\..\HeuristicLab.Core.Views\3.3\HeuristicLab.Core.Views-3.3.csproj">245 <Project>{E226881D-315F-423D-B419-A766FE0D8685}</Project>246 <Name>HeuristicLab.Core.Views-3.3</Name>247 <Private>False</Private>248 </ProjectReference>249 <ProjectReference Include="..\..\HeuristicLab.Core\3.3\HeuristicLab.Core-3.3.csproj">250 <Project>{C36BD924-A541-4A00-AFA8-41701378DDC5}</Project>251 <Name>HeuristicLab.Core-3.3</Name>252 <Private>False</Private>253 </ProjectReference>254 <ProjectReference Include="..\..\HeuristicLab.Data\3.3\HeuristicLab.Data-3.3.csproj">255 <Project>{BBAB9DF5-5EF3-4BA8-ADE9-B36E82114937}</Project>256 <Name>HeuristicLab.Data-3.3</Name>257 <Private>False</Private>258 </ProjectReference>259 <ProjectReference Include="..\..\HeuristicLab.MainForm.WindowsForms\3.3\HeuristicLab.MainForm.WindowsForms-3.3.csproj">260 <Project>{AB687BBE-1BFE-476B-906D-44237135431D}</Project>261 <Name>HeuristicLab.MainForm.WindowsForms-3.3</Name>262 <Private>False</Private>263 </ProjectReference>264 <ProjectReference Include="..\..\HeuristicLab.MainForm\3.3\HeuristicLab.MainForm-3.3.csproj">265 <Project>{3BD61258-31DA-4B09-89C0-4F71FEF5F05A}</Project>266 <Name>HeuristicLab.MainForm-3.3</Name>267 <Private>False</Private>268 </ProjectReference>269 <ProjectReference Include="..\..\HeuristicLab.PluginInfrastructure\3.3\HeuristicLab.PluginInfrastructure-3.3.csproj">270 <Project>{94186A6A-5176-4402-AE83-886557B53CCA}</Project>271 <Name>HeuristicLab.PluginInfrastructure-3.3</Name>272 <Private>False</Private>273 </ProjectReference>274 264 </ItemGroup> 275 265 <ItemGroup> -
trunk/sources/HeuristicLab.Data.Views/3.3/StringConvertibleMatrixView.cs
r12151 r12676 109 109 dataGridView.Columns.Clear(); 110 110 virtualRowIndices = new int[0]; 111 } else 111 } else if (!dataGridView.IsCurrentCellInEditMode) { 112 112 UpdateData(); 113 } 113 114 } 114 115 … … 295 296 } 296 297 297 pr ivatevoid dataGridView_KeyDown(object sender, KeyEventArgs e) {298 protected virtual void dataGridView_KeyDown(object sender, KeyEventArgs e) { 298 299 if (!ReadOnly && e.Control && e.KeyCode == Keys.V) 299 300 PasteValuesToDataGridView(); … … 398 399 } 399 400 400 pr ivatevoid dataGridView_ColumnHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e) {401 protected virtual void dataGridView_ColumnHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e) { 401 402 if (Content != null) { 402 403 if (e.Button == MouseButtons.Left && Content.SortableView) { 403 bool addToSortedIndices = (Control.ModifierKeys & Keys.Control) == Keys.Control; 404 SortOrder newSortOrder = SortOrder.Ascending; 405 if (sortedColumnIndices.Any(x => x.Key == e.ColumnIndex)) { 406 SortOrder oldSortOrder = sortedColumnIndices.Where(x => x.Key == e.ColumnIndex).First().Value; 407 int enumLength = Enum.GetValues(typeof(SortOrder)).Length; 408 newSortOrder = oldSortOrder = (SortOrder)Enum.Parse(typeof(SortOrder), ((((int)oldSortOrder) + 1) % enumLength).ToString()); 409 } 410 411 if (!addToSortedIndices) 412 sortedColumnIndices.Clear(); 413 414 if (sortedColumnIndices.Any(x => x.Key == e.ColumnIndex)) { 415 int sortedIndex = sortedColumnIndices.FindIndex(x => x.Key == e.ColumnIndex); 416 if (newSortOrder != SortOrder.None) 417 sortedColumnIndices[sortedIndex] = new KeyValuePair<int, SortOrder>(e.ColumnIndex, newSortOrder); 418 else 419 sortedColumnIndices.RemoveAt(sortedIndex); 420 } else 421 if (newSortOrder != SortOrder.None) 422 sortedColumnIndices.Add(new KeyValuePair<int, SortOrder>(e.ColumnIndex, newSortOrder)); 423 Sort(); 404 SortColumn(e.ColumnIndex); 424 405 } 425 406 } … … 438 419 dataGridView.Invalidate(); 439 420 } 421 422 protected virtual void SortColumn(int columnIndex) { 423 bool addToSortedIndices = (Control.ModifierKeys & Keys.Control) == Keys.Control; 424 SortOrder newSortOrder = SortOrder.Ascending; 425 if (sortedColumnIndices.Any(x => x.Key == columnIndex)) { 426 SortOrder oldSortOrder = sortedColumnIndices.Where(x => x.Key == columnIndex).First().Value; 427 int enumLength = Enum.GetValues(typeof(SortOrder)).Length; 428 newSortOrder = oldSortOrder = (SortOrder)Enum.Parse(typeof(SortOrder), ((((int)oldSortOrder) + 1) % enumLength).ToString()); 429 } 430 431 if (!addToSortedIndices) 432 sortedColumnIndices.Clear(); 433 434 if (sortedColumnIndices.Any(x => x.Key == columnIndex)) { 435 int sortedIndex = sortedColumnIndices.FindIndex(x => x.Key == columnIndex); 436 if (newSortOrder != SortOrder.None) 437 sortedColumnIndices[sortedIndex] = new KeyValuePair<int, SortOrder>(columnIndex, newSortOrder); 438 else 439 sortedColumnIndices.RemoveAt(sortedIndex); 440 } else 441 if (newSortOrder != SortOrder.None) 442 sortedColumnIndices.Add(new KeyValuePair<int, SortOrder>(columnIndex, newSortOrder)); 443 Sort(); 444 } 445 440 446 protected virtual int[] Sort(IEnumerable<KeyValuePair<int, SortOrder>> sortedColumns) { 441 447 int[] newSortedIndex = Enumerable.Range(0, Content.Rows).ToArray(); … … 510 516 } 511 517 512 pr ivatevoid dataGridView_MouseClick(object sender, System.Windows.Forms.MouseEventArgs e) {518 protected virtual void dataGridView_MouseClick(object sender, System.Windows.Forms.MouseEventArgs e) { 513 519 if (Content == null) return; 514 520 if (e.Button == MouseButtons.Right && Content.ColumnNames.Count() != 0) … … 543 549 544 550 protected virtual void dataGridView_SelectionChanged(object sender, EventArgs e) { 545 string stringFormat = "{0,20:0.0000}";546 551 statisticsTextBox.Text = string.Empty; 547 552 if (dataGridView.SelectedCells.Count > 1) { … … 553 558 } 554 559 if (selectedValues.Count > 1) { 555 StringBuilder labelText = new StringBuilder(); 556 labelText.Append("Count: " + string.Format(stringFormat, selectedValues.Count) + " "); 557 labelText.Append("Sum: " + string.Format(stringFormat, selectedValues.Sum()) + " "); 558 labelText.Append("Min: " + string.Format(stringFormat, selectedValues.Min()) + " "); 559 labelText.Append("Max: " + string.Format(stringFormat, selectedValues.Max()) + " "); 560 labelText.Append("Average: " + string.Format(stringFormat, selectedValues.Average()) + " "); 561 labelText.Append("Standard Deviation: " + string.Format(stringFormat, selectedValues.StandardDeviation()) + " "); 562 563 statisticsTextBox.Text = labelText.ToString(); 564 } 565 } 560 statisticsTextBox.Text = CreateStatisticsText(selectedValues); 561 } 562 } 563 } 564 565 protected virtual string CreateStatisticsText(ICollection<double> values) { 566 string stringFormat = "{0,20:0.0000}"; 567 int overallCount = values.Count; 568 values = values.Where(x => !double.IsNaN(x)).ToList(); 569 if (!values.Any()) { 570 return ""; 571 } 572 StringBuilder statisticsText = new StringBuilder(); 573 statisticsText.Append("Count: " + values.Count + " "); 574 statisticsText.Append("Sum: " + string.Format(stringFormat, values.Sum()) + " "); 575 statisticsText.Append("Min: " + string.Format(stringFormat, values.Min()) + " "); 576 statisticsText.Append("Max: " + string.Format(stringFormat, values.Max()) + " "); 577 statisticsText.Append("Average: " + string.Format(stringFormat, values.Average()) + " "); 578 statisticsText.Append("Standard Deviation: " + string.Format(stringFormat, values.StandardDeviation()) + " "); 579 if (overallCount > 0) 580 statisticsText.Append("Missing Values: " + string.Format(stringFormat, ((overallCount - values.Count) / (double)overallCount) * 100) + "% "); 581 return statisticsText.ToString(); 566 582 } 567 583 }
Note: See TracChangeset
for help on using the changeset viewer.