- Timestamp:
- 03/19/14 12:05:50 (10 years ago)
- Location:
- branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/DataPreprocessingView.cs
r10586 r10614 23 23 using System.Windows.Forms; 24 24 using HeuristicLab.Common; 25 using HeuristicLab.Core;26 25 using HeuristicLab.Core.Views; 27 26 using HeuristicLab.MainForm; … … 29 28 namespace HeuristicLab.DataPreprocessing.Views { 30 29 [View("DataPreprocessing View")] 31 [Content(typeof(IPreprocessingContext), true)] 30 [Content(typeof(PreprocessingContext), true)] 31 [Content(typeof(IPreprocessingContext), false)] 32 32 public partial class DataPreprocessingView : ItemView { 33 34 private DataGridContent dataGridContent;35 private StatisticsContent statisticsContent;36 private FilterContent filterContent;37 private TransformationContent tranformationContent;38 private LineChartContent lineChartContent;39 private HistogramContent histogramContent;40 41 33 public DataPreprocessingView() { 42 34 InitializeComponent(); 43 35 } 44 36 45 protected override void OnContentChanged() { 46 base.OnContentChanged(); 47 InitializeContents(); 48 } 49 50 //Create list view item for content list view 51 private ListViewItem CreateListViewItem(IItem item) { 52 ListViewItem listViewItem = new ListViewItem(); 53 54 listViewItem.Text = item.ToString(); 55 listViewItem.ToolTipText = item.ItemName + ": " + item.ItemDescription; 56 contentListView.SmallImageList.Images.Add(item.ItemImage); 57 listViewItem.ImageIndex = contentListView.SmallImageList.Images.Count - 1; 58 listViewItem.Tag = item; 59 60 return listViewItem; 61 } 62 63 private void InitializeContents() { 64 65 //create content items 66 ITransactionalPreprocessingData data = Content.Data; 67 ISearchLogic searchLogic = new SearchLogic(data); 68 var dataGridLogic = new DataGridLogic(data); 69 StatisticsLogic statisticsLogic = new StatisticsLogic(data, searchLogic); 70 dataGridContent = new DataGridContent(dataGridLogic, new ManipulationLogic(data, searchLogic, statisticsLogic)); 71 statisticsContent = new StatisticsContent(statisticsLogic); 72 filterContent = new FilterContent(new FilterLogic()); 73 tranformationContent = new TransformationContent(new TransformationLogic(data, searchLogic, statisticsLogic)); 74 lineChartContent = new LineChartContent(new LineChartLogic(data)); 75 histogramContent = new HistogramContent(new HistogramLogic(data)); 76 77 //create view items 78 contentListView.SmallImageList = new ImageList(); 79 ListViewItem contentListViewItem = CreateListViewItem(dataGridContent); 80 ListViewItem statisticsListViewItem = CreateListViewItem(statisticsContent); 81 ListViewItem filterListViewItem = CreateListViewItem(filterContent); 82 ListViewItem transformationListViewItem = CreateListViewItem(tranformationContent); 83 ListViewItem lineChartListViewItem = CreateListViewItem(lineChartContent); 84 ListViewItem histogramListViewItem = CreateListViewItem(histogramContent); 85 86 //add view items to content list view 87 contentListView.Items.Add(statisticsListViewItem); 88 contentListView.Items.Add(contentListViewItem); 89 contentListView.Items.Add(filterListViewItem); 90 contentListView.Items.Add(transformationListViewItem); 91 contentListView.Items.Add(lineChartListViewItem); 92 contentListView.Items.Add(histogramListViewItem); 93 94 //default view -> statistic view 95 contentListView.SelectedIndices.Add(0); 96 } 97 98 public new PreprocessingContext Content { 99 get { return (PreprocessingContext)base.Content; } 37 public new IPreprocessingContext Content { 38 get { return (IPreprocessingContext)base.Content; } 100 39 set { 101 40 base.Content = value; … … 103 42 } 104 43 105 private void listView1_SelectedIndexChanged(object sender, EventArgs e) { 106 107 if (contentListView.SelectedItems.Count > 0) { 108 ListViewItem listViewItem = (ListViewItem)contentListView.SelectedItems[0]; 109 this.viewHost.Content = (IItem)listViewItem.Tag; 44 protected override void OnContentChanged() { 45 base.OnContentChanged(); 46 if (Content != null) { 47 viewShortcutCollectionView.Content = Content.ViewShortcuts; 48 } else { 49 viewShortcutCollectionView.Content = null; 110 50 } 111 51 } 112 52 113 private void listView1_DoubleClick(object sender, EventArgs e) { 114 if (contentListView.SelectedItems.Count > 0) { 115 ListViewItem listViewItem = (ListViewItem)contentListView.SelectedItems[0]; 116 MainFormManager.MainForm.ShowContent((IItem)listViewItem.Tag); 117 } 53 protected override void SetEnabledStateOfControls() { 54 base.SetEnabledStateOfControls(); 55 viewShortcutCollectionView.Enabled = Content != null; 56 applyInNewTabButton.Enabled = Content != null; 57 exportProblemButton.Enabled = Content != null; 58 undoButton.Enabled = Content != null; 118 59 } 119 60 -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/DataPreprocessingView.designer.cs
r10558 r10614 47 47 this.components = new System.ComponentModel.Container(); 48 48 System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DataPreprocessingView)); 49 this.splitContainer1 = new System.Windows.Forms.SplitContainer();50 49 this.undoButton = new System.Windows.Forms.Button(); 51 50 this.applyInNewTabButton = new System.Windows.Forms.Button(); 52 51 this.exportProblemButton = new System.Windows.Forms.Button(); 53 this.contentListView = new System.Windows.Forms.ListView();54 this.viewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();55 52 this.toolTip = new System.Windows.Forms.ToolTip(this.components); 56 ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); 57 this.splitContainer1.Panel1.SuspendLayout(); 58 this.splitContainer1.Panel2.SuspendLayout(); 59 this.splitContainer1.SuspendLayout(); 53 this.viewShortcutCollectionView = new HeuristicLab.DataPreprocessing.Views.ViewShortcutCollectionView(); 60 54 this.SuspendLayout(); 61 //62 // splitContainer163 //64 this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;65 this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;66 this.splitContainer1.Location = new System.Drawing.Point(0, 0);67 this.splitContainer1.Name = "splitContainer1";68 //69 // splitContainer1.Panel170 //71 this.splitContainer1.Panel1.Controls.Add(this.undoButton);72 this.splitContainer1.Panel1.Controls.Add(this.applyInNewTabButton);73 this.splitContainer1.Panel1.Controls.Add(this.exportProblemButton);74 this.splitContainer1.Panel1.Controls.Add(this.contentListView);75 //76 // splitContainer1.Panel277 //78 this.splitContainer1.Panel2.Controls.Add(this.viewHost);79 this.splitContainer1.Size = new System.Drawing.Size(838, 449);80 this.splitContainer1.SplitterDistance = 181;81 this.splitContainer1.TabIndex = 0;82 55 // 83 56 // undoButton 84 57 // 85 58 this.undoButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Undo; 86 this.undoButton.Location = new System.Drawing.Point( 72, 14);59 this.undoButton.Location = new System.Drawing.Point(64, 3); 87 60 this.undoButton.Name = "undoButton"; 88 61 this.undoButton.Size = new System.Drawing.Size(24, 24); … … 95 68 // 96 69 this.applyInNewTabButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Play; 97 this.applyInNewTabButton.Location = new System.Drawing.Point( 42, 14);70 this.applyInNewTabButton.Location = new System.Drawing.Point(34, 3); 98 71 this.applyInNewTabButton.Name = "applyInNewTabButton"; 99 72 this.applyInNewTabButton.Size = new System.Drawing.Size(24, 24); … … 106 79 // 107 80 this.exportProblemButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Save; 108 this.exportProblemButton.Location = new System.Drawing.Point( 12, 14);81 this.exportProblemButton.Location = new System.Drawing.Point(4, 3); 109 82 this.exportProblemButton.Name = "exportProblemButton"; 110 83 this.exportProblemButton.Size = new System.Drawing.Size(24, 24); … … 114 87 this.exportProblemButton.Click += new System.EventHandler(this.exportProblemButton_Click); 115 88 // 116 // contentListView89 // viewShortcutCollectionView 117 90 // 118 this. contentListView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)91 this.viewShortcutCollectionView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 119 92 | System.Windows.Forms.AnchorStyles.Left) 120 93 | System.Windows.Forms.AnchorStyles.Right))); 121 this.contentListView.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 122 this.contentListView.Location = new System.Drawing.Point(12, 44); 123 this.contentListView.Name = "contentListView"; 124 this.contentListView.Size = new System.Drawing.Size(157, 391); 125 this.contentListView.TabIndex = 0; 126 this.contentListView.UseCompatibleStateImageBehavior = false; 127 this.contentListView.View = System.Windows.Forms.View.List; 128 this.contentListView.SelectedIndexChanged += new System.EventHandler(this.listView1_SelectedIndexChanged); 129 this.contentListView.DoubleClick += new System.EventHandler(this.listView1_DoubleClick); 130 // 131 // viewHost 132 // 133 this.viewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 134 | System.Windows.Forms.AnchorStyles.Left) 135 | System.Windows.Forms.AnchorStyles.Right))); 136 this.viewHost.Caption = "View"; 137 this.viewHost.Content = null; 138 this.viewHost.Enabled = false; 139 this.viewHost.Location = new System.Drawing.Point(16, 44); 140 this.viewHost.Name = "viewHost"; 141 this.viewHost.ReadOnly = false; 142 this.viewHost.Size = new System.Drawing.Size(621, 391); 143 this.viewHost.TabIndex = 4; 144 this.viewHost.ViewsLabelVisible = true; 145 this.viewHost.ViewType = null; 94 this.viewShortcutCollectionView.Caption = "ViewShortcutCollection View"; 95 this.viewShortcutCollectionView.Content = null; 96 this.viewShortcutCollectionView.Location = new System.Drawing.Point(4, 33); 97 this.viewShortcutCollectionView.Name = "viewShortcutCollectionView"; 98 this.viewShortcutCollectionView.ReadOnly = true; 99 this.viewShortcutCollectionView.ShowDetails = true; 100 this.viewShortcutCollectionView.Size = new System.Drawing.Size(831, 413); 101 this.viewShortcutCollectionView.TabIndex = 4; 146 102 // 147 103 // DataPreprocessingView … … 149 105 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 150 106 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 151 this.Controls.Add(this.splitContainer1); 107 this.Controls.Add(this.viewShortcutCollectionView); 108 this.Controls.Add(this.undoButton); 109 this.Controls.Add(this.applyInNewTabButton); 110 this.Controls.Add(this.exportProblemButton); 152 111 this.Name = "DataPreprocessingView"; 153 112 this.Size = new System.Drawing.Size(838, 449); 154 this.splitContainer1.Panel1.ResumeLayout(false);155 this.splitContainer1.Panel2.ResumeLayout(false);156 ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();157 this.splitContainer1.ResumeLayout(false);158 113 this.ResumeLayout(false); 159 114 … … 162 117 #endregion 163 118 164 private System.Windows.Forms.ListView contentListView;165 119 private System.Windows.Forms.Button exportProblemButton; 166 120 private System.Windows.Forms.Button applyInNewTabButton; 167 121 private System.Windows.Forms.Button undoButton; 168 private MainForm.WindowsForms.ViewHost viewHost;169 private System.Windows.Forms.SplitContainer splitContainer1;170 122 private System.Windows.Forms.ToolTip toolTip; 123 private ViewShortcutCollectionView viewShortcutCollectionView; 171 124 172 125 } -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/HeuristicLab.DataPreprocessing.Views-3.3.csproj
r10610 r10614 122 122 <DependentUpon>TransformationView.cs</DependentUpon> 123 123 </Compile> 124 <Compile Include="ViewShortcutCollectionView.cs"> 125 <SubType>UserControl</SubType> 126 </Compile> 127 <Compile Include="ViewShortcutCollectionView.Designer.cs"> 128 <DependentUpon>ViewShortcutCollectionView.cs</DependentUpon> 129 </Compile> 124 130 </ItemGroup> 125 131 <ItemGroup> … … 136 142 <Project>{887425B4-4348-49ED-A457-B7D2C26DDBF9}</Project> 137 143 <Name>HeuristicLab.Analysis-3.3</Name> 144 </ProjectReference> 145 <ProjectReference Include="..\..\HeuristicLab.Collections\3.3\HeuristicLab.Collections-3.3.csproj"> 146 <Project>{958b43bc-cc5c-4fa2-8628-2b3b01d890b6}</Project> 147 <Name>HeuristicLab.Collections-3.3</Name> 138 148 </ProjectReference> 139 149 <ProjectReference Include="..\..\HeuristicLab.Common.Resources\3.3\HeuristicLab.Common.Resources-3.3.csproj">
Note: See TracChangeset
for help on using the changeset viewer.