Changeset 10658 for branches/DataPreprocessing
- Timestamp:
- 03/26/14 10:52:55 (11 years ago)
- Location:
- branches/DataPreprocessing
- Files:
-
- 4 added
- 3 deleted
- 5 edited
- 3 copied
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/DataPreprocessingView.cs
r10636 r10658 50 50 var manipulationLogic = new ManipulationLogic(data, searchLogic, statisticsLogic); 51 51 var transformationLogic = new TransformationLogic(data, searchLogic, statisticsLogic); 52 var lineChartLogic = new LineChartLogic(data);53 var histogramLogic = new HistogramLogic(data);52 var lineChartLogic = new ChartLogic(data); 53 var histogramLogic = new ChartLogic(data); 54 54 var filterLogic = new FilterLogic(data); 55 55 -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/HeuristicLab.DataPreprocessing.Views-3.3.csproj
r10657 r10658 91 91 <DependentUpon>FindAndReplaceDialog.cs</DependentUpon> 92 92 </Compile> 93 <Compile Include="HistogramView.cs"> 94 <SubType>UserControl</SubType> 95 </Compile> 93 <Compile Include="HistogramView.cs" /> 96 94 <Compile Include="HistogramView.Designer.cs"> 97 95 <DependentUpon>HistogramView.cs</DependentUpon> 98 96 </Compile> 99 <Compile Include="LineChartView.cs"> 100 <SubType>UserControl</SubType> 101 </Compile> 97 <Compile Include="LineChartView.cs" /> 102 98 <Compile Include="LineChartView.Designer.cs"> 103 99 <DependentUpon>LineChartView.cs</DependentUpon> 104 100 </Compile> 105 101 <Compile Include="Plugin.cs" /> 102 <Compile Include="PreprocessingChartView.cs" /> 103 <Compile Include="PreprocessingChartView.Designer.cs"> 104 <DependentUpon>PreprocessingChartView.cs</DependentUpon> 105 </Compile> 106 106 <Compile Include="PreprocessingCheckedItemListView.cs"> 107 107 <SubType>UserControl</SubType> … … 220 220 <Name>HeuristicLab.Visualization.ChartControlsExtensions-3.3</Name> 221 221 </ProjectReference> 222 </ItemGroup>223 <ItemGroup>224 <EmbeddedResource Include="DataPreprocessingView.resx">225 <DependentUpon>DataPreprocessingView.cs</DependentUpon>226 </EmbeddedResource>227 222 </ItemGroup> 228 223 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/PreprocessingChartView.Designer.cs
r10657 r10658 22 22 using HeuristicLab.Data; 23 23 namespace HeuristicLab.DataPreprocessing.Views { 24 partial class LineChartView {24 partial class PreprocessingChartView { 25 25 /// <summary> 26 26 /// Required designer variable. … … 46 46 /// </summary> 47 47 private void InitializeComponent() { 48 this.viewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();49 this.groupBoxOptions = new System.Windows.Forms.GroupBox();50 48 this.checkedItemList = new HeuristicLab.DataPreprocessing.Views.PreprocessingCheckedItemListView(); 49 this.chartPanel = new System.Windows.Forms.Panel(); 50 this.dataTableView = new HeuristicLab.Analysis.Views.DataTableView(); 51 this.chartPanel.SuspendLayout(); 51 52 this.SuspendLayout(); 52 //53 // viewHost54 //55 this.viewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)56 | System.Windows.Forms.AnchorStyles.Left)57 | System.Windows.Forms.AnchorStyles.Right)));58 this.viewHost.Caption = "View";59 this.viewHost.Content = null;60 this.viewHost.Enabled = false;61 this.viewHost.Location = new System.Drawing.Point(162, 4);62 this.viewHost.Name = "viewHost";63 this.viewHost.ReadOnly = false;64 this.viewHost.Size = new System.Drawing.Size(489, 396);65 this.viewHost.TabIndex = 0;66 this.viewHost.ViewsLabelVisible = true;67 this.viewHost.ViewType = null;68 //69 // groupBoxOptions70 //71 this.groupBoxOptions.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));72 this.groupBoxOptions.Location = new System.Drawing.Point(4, 262);73 this.groupBoxOptions.Name = "groupBoxOptions";74 this.groupBoxOptions.Size = new System.Drawing.Size(152, 138);75 this.groupBoxOptions.TabIndex = 3;76 this.groupBoxOptions.TabStop = false;77 this.groupBoxOptions.Text = "Options";78 53 // 79 54 // checkedItemList … … 89 64 this.checkedItemList.TabIndex = 4; 90 65 // 66 // chartPanel 67 // 68 this.chartPanel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 69 | System.Windows.Forms.AnchorStyles.Left) 70 | System.Windows.Forms.AnchorStyles.Right))); 71 this.chartPanel.Controls.Add(this.dataTableView); 72 this.chartPanel.Location = new System.Drawing.Point(163, 4); 73 this.chartPanel.Name = "chartPanel"; 74 this.chartPanel.Size = new System.Drawing.Size(488, 396); 75 this.chartPanel.TabIndex = 5; 76 // 77 // dataTableView 78 // 79 this.dataTableView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 80 | System.Windows.Forms.AnchorStyles.Left) 81 | System.Windows.Forms.AnchorStyles.Right))); 82 this.dataTableView.Caption = "DataTable View"; 83 this.dataTableView.Content = null; 84 this.dataTableView.Location = new System.Drawing.Point(3, 3); 85 this.dataTableView.Name = "dataTableView"; 86 this.dataTableView.ReadOnly = false; 87 this.dataTableView.Size = new System.Drawing.Size(482, 390); 88 this.dataTableView.TabIndex = 0; 89 // 91 90 // LineChartView 92 91 // 93 92 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 94 93 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 94 this.Controls.Add(this.chartPanel); 95 95 this.Controls.Add(this.checkedItemList); 96 this.Controls.Add(this.groupBoxOptions);97 this.Controls.Add(this.viewHost);98 96 this.Name = "LineChartView"; 99 97 this.Size = new System.Drawing.Size(654, 403); 98 this.chartPanel.ResumeLayout(false); 100 99 this.ResumeLayout(false); 101 100 … … 104 103 #endregion 105 104 106 private MainForm.WindowsForms.ViewHost viewHost;107 private System.Windows.Forms.GroupBox groupBoxOptions;108 105 private PreprocessingCheckedItemListView checkedItemList; 106 private System.Windows.Forms.Panel chartPanel; 107 private Analysis.Views.DataTableView dataTableView; 109 108 } 110 109 } -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/PreprocessingChartView.cs
r10633 r10658 30 30 namespace HeuristicLab.DataPreprocessing.Views { 31 31 32 [View(" LineChart View")]33 [Content(typeof( LineChartContent), false)]34 public partial class LineChartView : ItemView {32 [View("Preprocessing Chart View")] 33 [Content(typeof(PreprocessingChartContent), false)] 34 public partial class PreprocessingChartView : ItemView { 35 35 36 private I LineChartLogic logic;36 private IChartLogic logic; 37 37 private DataTable dataTable; 38 private ICheckedItemList<StringValue> itemList; 39 private const string LINE_CHART_TITLE = "LineChart"; 38 private ICheckedItemList<StringValue> variableItemList; 39 protected DataRowVisualProperties.DataRowChartType chartType; 40 protected string chartTitle; 40 41 41 public LineChartView() { 42 private const string DEFAULT_CHART_TITLE = "Chart"; 43 44 45 public PreprocessingChartView() { 42 46 InitializeComponent(); 47 chartType = DataRowVisualProperties.DataRowChartType.Line; 48 chartTitle = DEFAULT_CHART_TITLE; 43 49 } 44 50 … … 50 56 dataTable.Rows.Remove(variableName); 51 57 } else { 52 dataTable.Rows.Add(logic.CreateDataRow(variableName ));58 dataTable.Rows.Add(logic.CreateDataRow(variableName, chartType)); 53 59 } 54 60 } … … 65 71 66 72 private void InitDataTable() { 67 dataTable = logic.CreateDataTable( LINE_CHART_TITLE);68 viewHost.Content = dataTable;73 dataTable = logic.CreateDataTable(chartTitle, chartType); 74 dataTableView.Content = dataTable; 69 75 } 70 76 71 77 private void InitVariablesListBox() { 72 itemList = logic.CreateVariableItemList();73 checkedItemList.Content = itemList;78 variableItemList = logic.CreateVariableItemList(); 79 checkedItemList.Content = variableItemList; 74 80 } 75 81 … … 85 91 86 92 void Content_Changed(object sender, DataPreprocessingChangedEventArgs e) { 87 viewHost.Refresh();93 dataTableView.Refresh(); 88 94 } 89 95 90 public new LineChartContent Content {91 get { return ( LineChartContent)base.Content; }96 public new PreprocessingChartContent Content { 97 get { return (PreprocessingChartContent)base.Content; } 92 98 set { base.Content = value; } 93 99 } … … 96 102 base.OnContentChanged(); 97 103 if (Content != null) { 98 logic = Content. LineChartLogic;104 logic = Content.ChartLogic; 99 105 InitDataTable(); 100 106 InitVariablesListBox(); 101 itemList.CheckedItemsChanged += CheckedItemsChanged;107 variableItemList.CheckedItemsChanged += CheckedItemsChanged; 102 108 logic.Changed += PreprocessingData_Changed; 103 109 } … … 116 122 case DataPreprocessingChangedEventType.ChangeItem: 117 123 dataTable.Rows.Remove(logic.GetVariableNameByIndex(e.Column)); 118 dataTable.Rows.Add(logic.CreateDataRow( (logic.GetVariableNameByIndex(e.Column))));124 dataTable.Rows.Add(logic.CreateDataRow(logic.GetVariableNameByIndex(e.Column),chartType)); 119 125 break; 120 126 case DataPreprocessingChangedEventType.DeleteRow: … … 127 133 // add variable to data table and item list 128 134 private void AddVariable(string name) { 129 dataTable.Rows.Add(logic.CreateDataRow(name ));130 itemList.Add(new StringValue(name));135 dataTable.Rows.Add(logic.CreateDataRow(name, chartType)); 136 variableItemList.Add(new StringValue(name)); 131 137 } 132 138 … … 137 143 StringValue stringValue = FindVariableItemList(name); 138 144 if (stringValue != null) 139 itemList.Remove(stringValue);145 variableItemList.Remove(stringValue); 140 146 141 147 } 142 148 143 149 private StringValue FindVariableItemList(string name) { 144 foreach (StringValue stringValue in itemList) {150 foreach (StringValue stringValue in variableItemList) { 145 151 if (stringValue.Value == name) 146 152 return stringValue; -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/HeuristicLab.DataPreprocessing-3.3.csproj
r10638 r10658 72 72 </ItemGroup> 73 73 <ItemGroup> 74 <Compile Include="Implementations\PreprocessingChartContent.cs" /> 74 75 <Compile Include="Implementations\PreprocessingData.cs" /> 75 76 <Compile Include="Implementations\DataGridLogic.cs" /> … … 83 84 <Compile Include="Implementations\FilterLogic.cs" /> 84 85 <Compile Include="Implementations\HistogramContent.cs" /> 85 <Compile Include="Implementations\HistogramLogic.cs" />86 86 <Compile Include="Implementations\LineChartContent.cs" /> 87 <Compile Include="Implementations\ LineChartLogic.cs" />87 <Compile Include="Implementations\ChartLogic.cs" /> 88 88 <Compile Include="Implementations\StatisticsContent.cs" /> 89 89 <Compile Include="Implementations\TransformationContent.cs" /> 90 90 <Compile Include="Implementations\TransformationLogic.cs" /> 91 91 <Compile Include="Interfaces\IFilterLogic.cs" /> 92 <Compile Include="Interfaces\IHistogramLogic.cs" /> 93 <Compile Include="Interfaces\ILineChartLogic.cs" /> 92 <Compile Include="Interfaces\IChartLogic.cs" /> 94 93 <Compile Include="Interfaces\IManipulationLogic.cs" /> 95 94 <Compile Include="Interfaces\ITransformationLogic.cs" /> -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/ChartLogic.cs
r10633 r10658 27 27 28 28 namespace HeuristicLab.DataPreprocessing { 29 public class LineChartLogic : ILineChartLogic { 29 30 public class ChartLogic : IChartLogic { 30 31 31 32 private ITransactionalPreprocessingData preprocessingData; 32 33 33 public LineChartLogic(ITransactionalPreprocessingData preprocessingData) {34 public ChartLogic(ITransactionalPreprocessingData preprocessingData) { 34 35 this.preprocessingData = preprocessingData; 35 36 } 36 37 37 public DataTable CreateDataTable(String title ) {38 public DataTable CreateDataTable(String title, DataRowVisualProperties.DataRowChartType chartType) { 38 39 DataTable dataTable = new DataTable(title); 39 40 IEnumerable<string> variableNames = GetVariableNames(); 40 41 41 42 foreach (string variableName in variableNames) { 42 DataRow row = CreateDataRow(variableName );43 DataRow row = CreateDataRow(variableName,chartType); 43 44 dataTable.Rows.Add(row); 44 45 } … … 46 47 } 47 48 48 public DataRow CreateDataRow(string variableName ) {49 public DataRow CreateDataRow(string variableName, DataRowVisualProperties.DataRowChartType chartType) { 49 50 IList<double> values = preprocessingData.GetValues<double>(variableName); 50 51 DataRow row = new DataRow(variableName, "", values); 52 row.VisualProperties.ChartType = chartType; 51 53 return row; 52 54 } -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/HistogramContent.cs
r10614 r10658 26 26 namespace HeuristicLab.DataPreprocessing { 27 27 [Item("Histogram", "Represents the histogram grid.")] 28 public class HistogramContent : Item, IViewShortcut {28 public class HistogramContent : PreprocessingChartContent { 29 29 30 private readonly IHistogramLogic histogramLogic; 31 public HistogramContent(IHistogramLogic theHistogramLogic) { 32 histogramLogic = theHistogramLogic; 30 public HistogramContent(IChartLogic chartlogic) :base(chartlogic) { 33 31 } 34 32 … … 36 34 : base(content, cloner) { 37 35 38 }39 40 public IHistogramLogic HistogramLogic {41 get {42 return histogramLogic;43 }44 36 } 45 37 -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/LineChartContent.cs
r10614 r10658 26 26 namespace HeuristicLab.DataPreprocessing { 27 27 [Item("LineChart", "Represents the line chart grid.")] 28 public class LineChartContent : Item, IViewShortcut {28 public class LineChartContent : PreprocessingChartContent { 29 29 30 private readonly ILineChartLogic lineChartLogic; 31 public LineChartContent(ILineChartLogic theLineChartLogic) { 32 lineChartLogic = theLineChartLogic; 30 public LineChartContent(IChartLogic chartlogic) :base(chartlogic) { 33 31 } 34 32 … … 36 34 : base(content, cloner) { 37 35 38 }39 40 public ILineChartLogic LineChartLogic {41 get {42 return lineChartLogic;43 }44 36 } 45 37 … … 52 44 } 53 45 54 public event DataPreprocessingChangedEventHandler Changed {55 add { lineChartLogic.Changed += value; }56 remove { lineChartLogic.Changed -= value; }57 }58 46 } 59 47 } -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Implementations/PreprocessingChartContent.cs
r10633 r10658 25 25 26 26 namespace HeuristicLab.DataPreprocessing { 27 [Item(" LineChart", "Represents the line chart grid.")]28 public class LineChartContent : Item, IViewShortcut {27 [Item("PreprocessingChart", "Represents a preprocessing chart.")] 28 public class PreprocessingChartContent : Item, IViewShortcut { 29 29 30 private readonly I LineChartLogic lineChartLogic;31 public LineChartContent(ILineChartLogic theLineChartLogic) {32 lineChartLogic = theLineChartLogic;30 private readonly IChartLogic chartLogic; 31 public PreprocessingChartContent(IChartLogic chartLogic) { 32 this.chartLogic = chartLogic; 33 33 } 34 34 35 public LineChartContent(LineChartContent content, Cloner cloner)35 public PreprocessingChartContent(PreprocessingChartContent content, Cloner cloner) 36 36 : base(content, cloner) { 37 38 37 } 39 38 40 public I LineChartLogic LineChartLogic {39 public IChartLogic ChartLogic { 41 40 get { 42 return lineChartLogic;41 return chartLogic; 43 42 } 44 43 } … … 49 48 50 49 public override IDeepCloneable Clone(Cloner cloner) { 51 return new LineChartContent(this, cloner);50 return new PreprocessingChartContent(this, cloner); 52 51 } 53 52 54 53 public event DataPreprocessingChangedEventHandler Changed { 55 add { lineChartLogic.Changed += value; }56 remove { lineChartLogic.Changed -= value; }54 add { chartLogic.Changed += value; } 55 remove { chartLogic.Changed -= value; } 57 56 } 58 57 } -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/Interfaces/IChartLogic.cs
r10628 r10658 26 26 27 27 namespace HeuristicLab.DataPreprocessing { 28 public interface I LineChartLogic {28 public interface IChartLogic { 29 29 30 DataTable CreateDataTable(string title );30 DataTable CreateDataTable(string title, DataRowVisualProperties.DataRowChartType chartType); 31 31 32 32 event DataPreprocessingChangedEventHandler Changed; … … 34 34 ICheckedItemList<StringValue> CreateVariableItemList(); 35 35 36 DataRow CreateDataRow(string variableName );36 DataRow CreateDataRow(string variableName,DataRowVisualProperties.DataRowChartType chartType); 37 37 38 38 string GetVariableNameByIndex(int index);
Note: See TracChangeset
for help on using the changeset viewer.