Changeset 10877
- Timestamp:
- 05/21/14 13:42:43 (11 years ago)
- Location:
- branches/DataPreprocessing
- Files:
-
- 1 added
- 9 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/DataCompletenessView.Designer.cs
r10865 r10877 1 1 namespace HeuristicLab.DataPreprocessing.Views { 2 partial class HistogramView { 2 partial class DataCompletenessView 3 { 3 4 /// <summary> 4 5 /// Required designer variable. … … 24 25 /// </summary> 25 26 private void InitializeComponent() { 26 this.optionsBox = new System.Windows.Forms.GroupBox(); 27 this.allInOneCheckBox = new System.Windows.Forms.CheckBox(); 28 this.optionsBox.SuspendLayout(); 27 this.dataTableView1 = new DataPreprocessing.Views.PreprocessingDataTableView(); 29 28 this.SuspendLayout(); 30 29 // 31 // optionsBox30 // dataTableView1 32 31 // 33 this.optionsBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 34 this.optionsBox.Controls.Add(this.allInOneCheckBox); 35 this.optionsBox.Location = new System.Drawing.Point(4, 263); 36 this.optionsBox.Name = "optionsBox"; 37 this.optionsBox.Size = new System.Drawing.Size(152, 134); 38 this.optionsBox.TabIndex = 7; 39 this.optionsBox.TabStop = false; 40 this.optionsBox.Text = "Options"; 32 this.dataTableView1.Caption = "DataTable View"; 33 this.dataTableView1.Content = null; 34 this.dataTableView1.Location = new System.Drawing.Point(60, 36); 35 this.dataTableView1.Name = "dataTableView1"; 36 this.dataTableView1.ReadOnly = false; 37 this.dataTableView1.Size = new System.Drawing.Size(359, 274); 38 this.dataTableView1.TabIndex = 0; 41 39 // 42 // allInOneCheckBox40 // DataCompletenessView 43 41 // 44 this.allInOneCheckBox.AutoSize = true; 45 this.allInOneCheckBox.Location = new System.Drawing.Point(6, 19); 46 this.allInOneCheckBox.Name = "allInOneCheckBox"; 47 this.allInOneCheckBox.Size = new System.Drawing.Size(69, 17); 48 this.allInOneCheckBox.TabIndex = 0; 49 this.allInOneCheckBox.Text = "All in one"; 50 this.allInOneCheckBox.UseVisualStyleBackColor = true; 51 this.allInOneCheckBox.CheckedChanged += new System.EventHandler(this.allInOneCheckBox_CheckedChanged); 52 // 53 // HistogramView 54 // 55 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 56 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 57 this.Controls.Add(this.optionsBox); 58 this.Name = "HistogramView"; 59 this.Controls.SetChildIndex(this.optionsBox, 0); 60 this.optionsBox.ResumeLayout(false); 61 this.optionsBox.PerformLayout(); 42 this.Controls.Add(this.dataTableView1); 43 this.Name = "DataCompletenessView"; 44 this.Size = new System.Drawing.Size(493, 344); 62 45 this.ResumeLayout(false); 63 46 … … 66 49 #endregion 67 50 68 private System.Windows.Forms.GroupBox optionsBox; 69 private System.Windows.Forms.CheckBox allInOneCheckBox; 51 private HeuristicLab.DataPreprocessing.Views.PreprocessingDataTableView dataTableView1; 70 52 71 53 } -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/DataCompletenessView.cs
r10865 r10877 3 3 using HeuristicLab.Analysis; 4 4 using HeuristicLab.MainForm; 5 using HeuristicLab.Core.Views; 5 6 6 7 namespace HeuristicLab.DataPreprocessing.Views { 7 8 8 9 [View("Histogram View")] 9 [Content(typeof( HistogramContent), true)]10 public partial class HistogramView : PreprocessingChartView {10 [Content(typeof(DataCompletenessChartContent), true)] 11 public partial class DataCompletenessView : ItemView { 11 12 12 private const string HISTOGRAM_CHART_TITLE = "Histogram"; 13 protected DataRowVisualProperties.DataRowChartType chartType; 14 protected string chartTitle; 13 15 14 public HistogramView() { 15 InitializeComponent(); 16 chartType = DataRowVisualProperties.DataRowChartType.Histogram; 17 chartTitle = HISTOGRAM_CHART_TITLE; 18 } 16 private const string DEFAULT_CHART_TITLE = "DataCompletenessChart"; 19 17 20 public new HistogramContent Content { 21 get { return (HistogramContent)base.Content; } 18 public new DataCompletenessChartContent Content 19 { 20 get { return (DataCompletenessChartContent)base.Content; } 22 21 set { base.Content = value; } 23 22 } 24 23 25 private void allInOneCheckBox_CheckedChanged(object sender, EventArgs e) { 26 if (allInOneCheckBox.Checked)27 Content.AllInOneMode = true;28 else29 Content.AllInOneMode = false;30 GenerateChart();24 25 public DataCompletenessView() 26 { 27 InitializeComponent(); 28 chartType = DataRowVisualProperties.DataRowChartType.Line; 29 chartTitle = DEFAULT_CHART_TITLE; 31 30 } 32 31 … … 36 35 if (Content != null) 37 36 { 38 allInOneCheckBox.Checked = Content.AllInOneMode;39 37 } 40 38 } -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/DataPreprocessingView.cs
r10776 r10877 52 52 var histogramLogic = new ChartLogic(data); 53 53 var filterLogic = new FilterLogic(data); 54 var dataCompletenessLogic = new ChartLogic(data); 54 55 55 56 var viewShortcuts = new ItemCollection<IViewShortcut> { … … 60 61 new ManipulationContent(manipulationLogic, searchLogic), 61 62 new LineChartContent(lineChartLogic), 62 new HistogramContent(histogramLogic) 63 new HistogramContent(histogramLogic)//, 64 //new DataCompletenessChartContent(dataCompletenessLogic) 63 65 }; 64 66 -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/FilterView.cs
r10849 r10877 20 20 tbFiltered.Text = "0"; 21 21 tbPercentage.Text = "0%"; 22 checkedFilterView.Content = new CheckedItemCollection<IFilter>(); 23 checkedFilterView.Content.ItemsAdded += Content_ItemsAdded; 24 checkedFilterView.Content.ItemsRemoved += Content_ItemsRemoved; 25 checkedFilterView.Content.CheckedItemsChanged += Content_CheckedItemsChanged; 22 } 23 24 private void InitData() 25 { 26 checkedFilterView.Content = Content.Filters; 27 checkedFilterView.Content.ItemsAdded += Content_ItemsAdded; 28 checkedFilterView.Content.ItemsRemoved += Content_ItemsRemoved; 29 checkedFilterView.Content.CheckedItemsChanged += Content_CheckedItemsChanged; 26 30 } 27 31 … … 36 40 if (Content != null) 37 41 { 38 I mportFiltersFromContent();42 InitData(); 39 43 UpdateFilterInfo(); 40 44 } … … 42 46 43 47 private void Content_CheckedItemsChanged(object sender, Collections.CollectionItemsChangedEventArgs<IFilter> e) { 44 45 foreach (IFilter filter in e.Items) 48 if (Content != null) 46 49 { 47 filter.Active = checkedFilterView.Content.ItemChecked(filter); 50 foreach (IFilter filter in e.Items) 51 { 52 filter.Active = checkedFilterView.Content.ItemChecked(filter); 53 } 54 UpdateFilterInfo(); 48 55 } 49 UpdateFilterInfo();50 ExportFiltersToContent();51 Refresh();52 ResumeRepaint(true);53 56 } 54 57 55 58 private void UpdateFilterInfo() { 56 List<IFilter> filters = checkedFilterView.ItemCollection.ToList<IFilter>(); 59 //List<IFilter> filters = checkedFilterView.ItemCollection.ToList<IFilter>(); 60 List<IFilter> filters = Content.Filters.ToList(); 57 61 58 int activeFilters = filters.Count(c => c.Active);62 int activeFilters = filters.Count(c => c.Active); 59 63 60 applyFilterButton.Enabled = (activeFilters > 0);61 rBtnAnd.Enabled = (activeFilters > 0);62 rBtnOr.Enabled = (activeFilters > 0);63 btnReset.Enabled = (activeFilters > 0);64 Content.FilterLogic.Reset();65 bool[] result = Content.FilterLogic.Preview(filters, rBtnAnd.Checked);66 67 int filteredCnt = result.Count(c => c);68 69 tbFiltered.Text = filteredCnt.ToString();70 double percentage = result.Length == 0 ? 0.0 : filteredCnt * 100 / result.Length;71 tbPercentage.Text = percentage.ToString() + "%";72 tbTotal.Text = result.Length.ToString();64 applyFilterButton.Enabled = (activeFilters > 0); 65 rBtnAnd.Enabled = (activeFilters > 0); 66 rBtnOr.Enabled = (activeFilters > 0); 67 btnReset.Enabled = (activeFilters > 0); 68 Content.FilterLogic.Reset(); 69 bool[] result = Content.FilterLogic.Preview(filters, rBtnAnd.Checked); 70 71 int filteredCnt = result.Count(c => c); 72 73 tbFiltered.Text = filteredCnt.ToString(); 74 double percentage = result.Length == 0 ? 0.0 : filteredCnt * 100 / result.Length; 75 tbPercentage.Text = percentage.ToString() + "%"; 76 tbTotal.Text = result.Length.ToString(); 73 77 } 74 78 75 79 private void applyFilterButton_Click(object sender, EventArgs e) { 76 List<IFilter> filters = checkedFilterView.ItemCollection.ToList<IFilter>(); 77 Content.FilterLogic.Apply(filters, rBtnAnd.Checked); 80 if (Content != null) 81 { 82 List<IFilter> filters = Content.Filters.ToList(); 83 Content.FilterLogic.Apply(filters, rBtnAnd.Checked); 84 } 78 85 } 79 86 80 87 //whenever a new filter is added the preprocessing data is set to the filter 81 88 private void Content_ItemsAdded(object sender, Collections.CollectionItemsChangedEventArgs<IFilter> e) { 82 foreach (IFilter filter in e.Items) { 83 filter.ConstrainedValue = Content.FilterLogic.PreprocessingData; 89 if (Content != null) 90 { 91 foreach (IFilter filter in e.Items) 92 { 93 filter.ConstrainedValue = Content.FilterLogic.PreprocessingData; 94 } 95 UpdateFilterInfo(); 84 96 } 85 UpdateFilterInfo();86 ExportFiltersToContent();87 97 } 88 98 89 99 private void Content_ItemsRemoved(object sender, CollectionItemsChangedEventArgs<IFilter> e) { 90 UpdateFilterInfo(); 91 ExportFiltersToContent(); 100 if (Content != null) 101 { 102 UpdateFilterInfo(); 103 } 92 104 } 93 105 94 106 private void rBtnAnd_CheckedChanged(object sender, EventArgs e) 95 107 { 96 UpdateFilterInfo(); 97 ExportFiltersToContent(); 98 Content.isAndCombination = rBtnAnd.Checked; 108 if (Content != null) 109 { 110 UpdateFilterInfo(); 111 Content.isAndCombination = rBtnAnd.Checked; 112 } 99 113 } 100 114 101 115 private void btnReset_Click(object sender, EventArgs e) 102 116 { 103 Content.FilterLogic.Reset(); 104 } 105 106 private void ImportFiltersFromContent() 107 { 108 checkedFilterView.ItemCollection.AddRange(Content.Filters); 109 110 foreach (IFilter filter in checkedFilterView.ItemCollection) { 111 if (filter.Active) 112 { 113 checkedFilterView.Content.SetItemCheckedState(filter, true); 114 } 115 else 116 { 117 checkedFilterView.Content.SetItemCheckedState(filter, false); 118 } 119 rBtnAnd.Checked = Content.isAndCombination; 120 rBtnOr.Checked = !Content.isAndCombination; 117 if (Content != null) 118 { 119 Content.FilterLogic.Reset(); 121 120 } 122 121 } 123 122 124 private void ExportFiltersToContent()125 {126 Content.Filters = checkedFilterView.ItemCollection.ToList<IFilter>();127 }128 123 } 129 124 } -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/HeuristicLab.DataPreprocessing.Views-3.3.csproj
r10785 r10877 82 82 <DependentUpon>ComparisonFilterView.cs</DependentUpon> 83 83 </Compile> 84 <Compile Include="DataCompletenessView.cs"> 85 <SubType>UserControl</SubType> 86 </Compile> 87 <Compile Include="DataCompletenessView.Designer.cs"> 88 <DependentUpon>DataCompletenessView.cs</DependentUpon> 89 </Compile> 84 90 <Compile Include="DataGridContentView.cs"> 85 91 <SubType>UserControl</SubType> -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/PreprocessingChartView.Designer.cs
r10771 r10877 46 46 /// </summary> 47 47 private void InitializeComponent() { 48 this.dataTableView = new HeuristicLab.Analysis.Views.PreprocessingDataTableView();48 this.dataTableView = new DataPreprocessing.Views.PreprocessingDataTableView(); 49 49 this.tableLayoutPanel = new System.Windows.Forms.TableLayoutPanel(); 50 50 this.checkedItemList = new HeuristicLab.DataPreprocessing.Views.PreprocessingCheckedItemListView(); … … 108 108 109 109 private PreprocessingCheckedItemListView checkedItemList; 110 private Analysis.Views.PreprocessingDataTableView dataTableView;110 private DataPreprocessing.Views.PreprocessingDataTableView dataTableView; 111 111 private System.Windows.Forms.TableLayoutPanel tableLayoutPanel; 112 112 } -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/PreprocessingDataTableView.Designer.cs
r10771 r10877 20 20 #endregion 21 21 22 namespace HeuristicLab.Analysis.Views { 22 namespace HeuristicLab.DataPreprocessing.Views 23 { 23 24 partial class PreprocessingDataTableView { 24 25 /// <summary> -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/PreprocessingDataTableView.cs
r10871 r10877 30 30 using HeuristicLab.DataPreprocessing.Implementations; 31 31 using HeuristicLab.MainForm; 32 33 namespace HeuristicLab.Analysis.Views 32 using HeuristicLab.Analysis; 33 using HeuristicLab.Analysis.Views; 34 35 namespace HeuristicLab.DataPreprocessing.Views 34 36 { 35 37 [View("Preprocessing DataTable View")] … … 150 152 dialog.ShowDialog(this); 151 153 } 152 154 } 153 155 else MessageBox.Show("Nothing to configure."); 154 156 } … … 166 168 if (classification == null) 167 169 { 168 169 170 chart.Series.Add(series); 171 } 170 172 } 171 173 … … 182 184 // add dummy series for selction entry in legend 183 185 if (rows.Count() > 0 && chart.Series.FindByName("(Selection)") == null) { 184 185 186 187 188 189 190 191 192 193 194 186 Series series = new Series("(Selection)"); 187 series.IsVisibleInLegend = true; 188 series.Color = Color.Green; 189 series.BorderWidth = 1; 190 series.BorderDashStyle = ChartDashStyle.Solid; 191 series.BorderColor = Color.Empty; 192 series.ChartType = SeriesChartType.FastLine; 193 chart.Series.Add(series); 194 } 195 196 foreach (var row in rows) { 195 197 row.VisualProperties.IsVisibleInLegend = false; 196 198 row.VisualProperties.Color = Color.Green; … … 201 203 202 204 if (classification == null) { 203 204 205 206 205 chart.Series.Add(series); 206 } 207 } 208 } 207 209 } 208 210 … … 212 214 if (rows.Count() > 0 && rows.ElementAt(0).VisualProperties.ChartType == DataRowVisualProperties.DataRowChartType.Line) 213 215 { 214 215 216 217 218 219 220 221 222 223 224 216 //remove selection entry in legend 217 if (Content.SelectedRows.Count == 0) { 218 Series series = chart.Series["(Selection)"]; 219 chart.Series.Remove(series); 220 } 221 222 foreach (var row in rows) { 223 Series series = chart.Series[row.Name + "(Selected)"]; 224 chart.Series.Remove(series); 225 } 226 } 225 227 } 226 228 … … 755 757 else 756 758 { 757 759 series.Points.Clear(); 758 760 ConfigureSeries(series, row); 759 761 AddPointsToHistogramSeries(series, row, null); -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/HeuristicLab.DataPreprocessing-3.3.csproj
r10803 r10877 72 72 </ItemGroup> 73 73 <ItemGroup> 74 <Compile Include="Implementations\DataCompletenessChartContent.cs" /> 74 75 <Compile Include="Implementations\FilteredPreprocessingData.cs" /> 75 76 <Compile Include="Implementations\ManipulationContent.cs" /> -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/FilterContent.cs
r10842 r10877 30 30 public class FilterContent : Item, IViewShortcut { 31 31 32 private I List<IFilter> filters = new List<IFilter>();32 private ICheckedItemCollection<IFilter> filters = new CheckedItemCollection<IFilter>(); 33 33 34 34 public static new Image StaticItemImage { … … 50 50 } 51 51 52 public I List<IFilter> Filters52 public ICheckedItemCollection<IFilter> Filters 53 53 { 54 54 get -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/PreprocessingChartContent.cs
r10818 r10877 37 37 38 38 private readonly IChartLogic chartLogic; 39 40 39 41 public PreprocessingChartContent(IChartLogic chartLogic) { 40 42 this.chartLogic = chartLogic;
Note: See TracChangeset
for help on using the changeset viewer.