Changeset 13507
- Timestamp:
- 01/13/16 14:51:38 (9 years ago)
- Location:
- trunk/sources
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.DataPreprocessing.Views/3.4/DataPreprocessingMenuItem.cs
r13502 r13507 21 21 22 22 using System.Collections.Generic; 23 using System.Windows.Forms; 23 24 using HeuristicLab.MainForm; 24 25 using HeuristicLab.Optimizer; … … 31 32 } 32 33 public override IEnumerable<string> Structure { 33 get { return new string[] { "&Edit" }; }34 get { return new string[] { "&Edit", "&Data Analysis" }; } 34 35 } 35 36 public override int Position { 36 get { return 6000; }37 get { return 5500; } 37 38 } 38 39 public override string ToolTipText { … … 43 44 MainFormManager.MainForm.ShowContent(new PreprocessingContext()); 44 45 } 46 47 public override Keys ShortCutKeys { 48 get { return Keys.Control | Keys.D; } 49 } 45 50 } 46 51 } -
trunk/sources/HeuristicLab.DataPreprocessing.Views/3.4/DataPreprocessingView.cs
r13502 r13507 21 21 22 22 using System; 23 using System.Collections.Generic; 24 using System.Linq; 23 25 using System.Windows.Forms; 24 26 using HeuristicLab.Common; … … 30 32 [View("DataPreprocessing View")] 31 33 [Content(typeof(PreprocessingContext), true)] 32 public partial class DataPreprocessingView : ItemView {34 public partial class DataPreprocessingView : NamedItemView { 33 35 34 36 public DataPreprocessingView() { … … 70 72 viewShortcutListView.Select(); 71 73 74 applyComboBox.Items.Clear(); 75 applyComboBox.DataSource = Content.ExportPossibilities.ToList(); 76 applyComboBox.DisplayMember = "Key"; 77 if (applyComboBox.Items.Count > 0) 78 applyComboBox.SelectedIndex = 0; 72 79 } else { 73 80 viewShortcutListView.Content = null; … … 98 105 99 106 private void exportProblemButton_Click(object sender, EventArgs e) { 100 // ToDo: select one export probability101 var problem = Content.Export();107 var exportOption = (KeyValuePair<string, Func<IItem>>)applyComboBox.SelectedItem; 108 var exportItem = exportOption.Value(); 102 109 103 110 var saveFileDialog = new SaveFileDialog { … … 108 115 }; 109 116 110 var content = problem as IStorableContent;117 var content = exportItem as IStorableContent; 111 118 if (saveFileDialog.ShowDialog() == DialogResult.OK) { 112 119 bool compressed = saveFileDialog.FilterIndex != 1; … … 116 123 117 124 private void applyInNewTabButton_Click(object sender, EventArgs e) { 118 var item = Content.Export(); 125 var exportOption = (KeyValuePair<string, Func<IItem>>)applyComboBox.SelectedItem; 126 var exportItem = exportOption.Value(); 119 127 120 MainFormManager.MainForm.ShowContent( item);128 MainFormManager.MainForm.ShowContent(exportItem); 121 129 } 122 130 -
trunk/sources/HeuristicLab.DataPreprocessing.Views/3.4/DataPreprocessingView.designer.cs
r12012 r13507 45 45 /// </summary> 46 46 private void InitializeComponent() { 47 this.components = new System.ComponentModel.Container();48 47 System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DataPreprocessingView)); 49 48 this.undoButton = new System.Windows.Forms.Button(); 50 49 this.applyInNewTabButton = new System.Windows.Forms.Button(); 51 50 this.exportProblemButton = new System.Windows.Forms.Button(); 52 this.toolTip = new System.Windows.Forms.ToolTip(this.components);53 51 this.lblFilterActive = new System.Windows.Forms.Label(); 52 this.applyComboBox = new System.Windows.Forms.ComboBox(); 53 this.exportLabel = new System.Windows.Forms.Label(); 54 this.redoButton = new System.Windows.Forms.Button(); 54 55 this.viewShortcutListView = new HeuristicLab.DataPreprocessing.Views.ViewShortcutListView(); 56 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit(); 55 57 this.SuspendLayout(); 56 58 // 59 // nameTextBox 60 // 61 this.errorProvider.SetIconAlignment(this.nameTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft); 62 this.errorProvider.SetIconPadding(this.nameTextBox, 2); 63 this.nameTextBox.Size = new System.Drawing.Size(755, 20); 64 // 65 // infoLabel 66 // 67 this.infoLabel.Location = new System.Drawing.Point(819, 3); 68 // 57 69 // undoButton 58 70 // 59 71 this.undoButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Undo; 60 this.undoButton.Location = new System.Drawing.Point(6 4, 3);72 this.undoButton.Location = new System.Drawing.Point(6, 56); 61 73 this.undoButton.Name = "undoButton"; 62 74 this.undoButton.Size = new System.Drawing.Size(24, 24); 63 this.undoButton.TabIndex = 3;75 this.undoButton.TabIndex = 5; 64 76 this.toolTip.SetToolTip(this.undoButton, "Undo"); 65 77 this.undoButton.UseVisualStyleBackColor = true; … … 69 81 // 70 82 this.applyInNewTabButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Play; 71 this.applyInNewTabButton.Location = new System.Drawing.Point( 34, 3);83 this.applyInNewTabButton.Location = new System.Drawing.Point(57, 26); 72 84 this.applyInNewTabButton.Name = "applyInNewTabButton"; 73 85 this.applyInNewTabButton.Size = new System.Drawing.Size(24, 24); 74 86 this.applyInNewTabButton.TabIndex = 2; 75 this.toolTip.SetToolTip(this.applyInNewTabButton, "Apply in new tab");87 this.toolTip.SetToolTip(this.applyInNewTabButton, "Apply in new Tab"); 76 88 this.applyInNewTabButton.UseVisualStyleBackColor = true; 77 89 this.applyInNewTabButton.Click += new System.EventHandler(this.applyInNewTabButton_Click); … … 80 92 // 81 93 this.exportProblemButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Save; 82 this.exportProblemButton.Location = new System.Drawing.Point( 4, 3);94 this.exportProblemButton.Location = new System.Drawing.Point(87, 26); 83 95 this.exportProblemButton.Name = "exportProblemButton"; 84 96 this.exportProblemButton.Size = new System.Drawing.Size(24, 24); 85 this.exportProblemButton.TabIndex = 1;86 this.toolTip.SetToolTip(this.exportProblemButton, " Export problem");97 this.exportProblemButton.TabIndex = 3; 98 this.toolTip.SetToolTip(this.exportProblemButton, "Save"); 87 99 this.exportProblemButton.UseVisualStyleBackColor = true; 88 100 this.exportProblemButton.Click += new System.EventHandler(this.exportProblemButton_Click); … … 91 103 // 92 104 this.lblFilterActive.AutoSize = true; 93 this.lblFilterActive.Location = new System.Drawing.Point( 220, 12);105 this.lblFilterActive.Location = new System.Drawing.Point(84, 62); 94 106 this.lblFilterActive.Name = "lblFilterActive"; 95 107 this.lblFilterActive.Size = new System.Drawing.Size(277, 13); … … 98 110 this.lblFilterActive.Visible = false; 99 111 // 112 // applyComboBox 113 // 114 this.applyComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 115 | System.Windows.Forms.AnchorStyles.Right))); 116 this.applyComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 117 this.applyComboBox.FormattingEnabled = true; 118 this.applyComboBox.Items.AddRange(new object[] { 119 "Algorithm", 120 "Problem", 121 "ProblemData"}); 122 this.applyComboBox.Location = new System.Drawing.Point(117, 28); 123 this.applyComboBox.Name = "applyComboBox"; 124 this.applyComboBox.Size = new System.Drawing.Size(696, 21); 125 this.applyComboBox.TabIndex = 4; 126 // 127 // exportLabel 128 // 129 this.exportLabel.AutoSize = true; 130 this.exportLabel.Location = new System.Drawing.Point(5, 31); 131 this.exportLabel.Name = "exportLabel"; 132 this.exportLabel.Size = new System.Drawing.Size(40, 13); 133 this.exportLabel.TabIndex = 8; 134 this.exportLabel.Text = "Export:"; 135 // 136 // redoButton 137 // 138 this.redoButton.Enabled = false; 139 this.redoButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Redo; 140 this.redoButton.Location = new System.Drawing.Point(36, 56); 141 this.redoButton.Name = "redoButton"; 142 this.redoButton.Size = new System.Drawing.Size(24, 24); 143 this.redoButton.TabIndex = 6; 144 this.toolTip.SetToolTip(this.redoButton, "Redo (not implemented yet)"); 145 this.redoButton.UseVisualStyleBackColor = true; 146 // 100 147 // viewShortcutListView 101 148 // 102 this.viewShortcutListView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 103 | System.Windows.Forms.AnchorStyles.Left) 149 this.viewShortcutListView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 150 | System.Windows.Forms.AnchorStyles.Left) 104 151 | System.Windows.Forms.AnchorStyles.Right))); 105 152 this.viewShortcutListView.Caption = "ViewShortcutCollection View"; 106 153 this.viewShortcutListView.Content = null; 107 this.viewShortcutListView.Location = new System.Drawing.Point(4, 33);154 this.viewShortcutListView.Location = new System.Drawing.Point(4, 86); 108 155 this.viewShortcutListView.Name = "viewShortcutListView"; 109 156 this.viewShortcutListView.ReadOnly = false; 110 this.viewShortcutListView.Size = new System.Drawing.Size(831, 413);111 this.viewShortcutListView.TabIndex = 4;157 this.viewShortcutListView.Size = new System.Drawing.Size(831, 360); 158 this.viewShortcutListView.TabIndex = 7; 112 159 // 113 160 // DataPreprocessingView … … 115 162 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 116 163 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 164 this.Controls.Add(this.applyComboBox); 165 this.Controls.Add(this.exportLabel); 166 this.Controls.Add(this.exportProblemButton); 167 this.Controls.Add(this.applyInNewTabButton); 117 168 this.Controls.Add(this.lblFilterActive); 118 169 this.Controls.Add(this.viewShortcutListView); 170 this.Controls.Add(this.redoButton); 119 171 this.Controls.Add(this.undoButton); 120 this.Controls.Add(this.applyInNewTabButton);121 this.Controls.Add(this.exportProblemButton);122 172 this.Name = "DataPreprocessingView"; 123 173 this.Size = new System.Drawing.Size(838, 449); 174 this.Controls.SetChildIndex(this.undoButton, 0); 175 this.Controls.SetChildIndex(this.redoButton, 0); 176 this.Controls.SetChildIndex(this.viewShortcutListView, 0); 177 this.Controls.SetChildIndex(this.lblFilterActive, 0); 178 this.Controls.SetChildIndex(this.nameLabel, 0); 179 this.Controls.SetChildIndex(this.nameTextBox, 0); 180 this.Controls.SetChildIndex(this.infoLabel, 0); 181 this.Controls.SetChildIndex(this.applyInNewTabButton, 0); 182 this.Controls.SetChildIndex(this.exportProblemButton, 0); 183 this.Controls.SetChildIndex(this.exportLabel, 0); 184 this.Controls.SetChildIndex(this.applyComboBox, 0); 185 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit(); 124 186 this.ResumeLayout(false); 125 187 this.PerformLayout(); … … 132 194 private System.Windows.Forms.Button applyInNewTabButton; 133 195 private System.Windows.Forms.Button undoButton; 134 private System.Windows.Forms.ToolTip toolTip;135 196 private ViewShortcutListView viewShortcutListView; 136 197 private System.Windows.Forms.Label lblFilterActive; 137 198 private System.Windows.Forms.Label exportLabel; 199 private System.Windows.Forms.Button redoButton; 200 private System.Windows.Forms.ComboBox applyComboBox; 138 201 } 139 202 } -
trunk/sources/HeuristicLab.DataPreprocessing.Views/3.4/ViewShortcutListView.Designer.cs
r13502 r13507 45 45 /// </summary> 46 46 private void InitializeComponent() { 47 ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit(); 48 this.splitContainer.Panel1.SuspendLayout(); 49 this.splitContainer.Panel2.SuspendLayout(); 50 this.splitContainer.SuspendLayout(); 51 this.itemsGroupBox.SuspendLayout(); 52 this.detailsGroupBox.SuspendLayout(); 47 53 this.SuspendLayout(); 54 // 55 // splitContainer 56 // 57 this.splitContainer.Size = new System.Drawing.Size(526, 364); 58 // 59 // itemsGroupBox 60 // 61 this.itemsGroupBox.Size = new System.Drawing.Size(532, 383); 62 // 63 // itemsListView 64 // 65 this.itemsListView.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left))); 66 this.itemsListView.Dock = System.Windows.Forms.DockStyle.Fill; 67 this.itemsListView.Location = new System.Drawing.Point(0, 0); 68 this.itemsListView.Size = new System.Drawing.Size(200, 364); 69 // 70 // detailsGroupBox 71 // 72 this.detailsGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left))); 73 this.detailsGroupBox.Dock = System.Windows.Forms.DockStyle.Fill; 74 this.detailsGroupBox.Location = new System.Drawing.Point(0, 0); 75 this.detailsGroupBox.Size = new System.Drawing.Size(322, 364); 76 // 77 // addButton 78 // 79 this.toolTip.SetToolTip(this.addButton, "Add"); 80 this.addButton.Visible = false; 81 // 82 // removeButton 83 // 84 this.toolTip.SetToolTip(this.removeButton, "Remove"); 85 this.removeButton.Visible = false; 86 // 87 // moveUpButton 88 // 89 this.toolTip.SetToolTip(this.moveUpButton, "Move Up"); 90 this.moveUpButton.Visible = false; 91 // 92 // moveDownButton 93 // 94 this.toolTip.SetToolTip(this.moveDownButton, "Move Down"); 95 this.moveDownButton.Visible = false; 96 // 97 // viewHost 98 // 99 this.viewHost.Size = new System.Drawing.Size(310, 339); 100 // 101 // showDetailsCheckBox 102 // 103 this.showDetailsCheckBox.Visible = false; 48 104 // 49 105 // ViewShortcutListView 50 106 // 51 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);52 107 this.Name = "ViewShortcutListView"; 53 108 this.Size = new System.Drawing.Size(532, 383); 109 this.splitContainer.Panel1.ResumeLayout(false); 110 this.splitContainer.Panel2.ResumeLayout(false); 111 ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).EndInit(); 112 this.splitContainer.ResumeLayout(false); 113 this.itemsGroupBox.ResumeLayout(false); 114 this.detailsGroupBox.ResumeLayout(false); 54 115 this.ResumeLayout(false); 116 55 117 } 56 118 -
trunk/sources/HeuristicLab.DataPreprocessing/3.4/PreprocessingContext.cs
r13504 r13507 39 39 var algorithm = Source as IAlgorithm; 40 40 if (algorithm != null) 41 yield return new KeyValuePair<string, Func<IItem>>(algorithm. Name, () => ExportAlgorithm(algorithm));41 yield return new KeyValuePair<string, Func<IItem>>(algorithm.GetType().GetPrettyName(), () => ExportAlgorithm(algorithm)); 42 42 43 43 var problem = algorithm != null ? algorithm.Problem as IDataAnalysisProblem : Source as IDataAnalysisProblem; 44 44 if (problem != null) 45 yield return new KeyValuePair<string, Func<IItem>>(problem. Name, () => ExportProblem(problem));45 yield return new KeyValuePair<string, Func<IItem>>(problem.GetType().GetPrettyName(), () => ExportProblem(problem)); 46 46 47 47 var problemData = problem != null ? problem.ProblemData : Source as IDataAnalysisProblemData; 48 48 if (problemData != null) 49 yield return new KeyValuePair<string, Func<IItem>>(problemData. Name, () => ExportProblemData(problemData));49 yield return new KeyValuePair<string, Func<IItem>>(problemData.GetType().GetPrettyName(), () => ExportProblemData(problemData)); 50 50 51 51 // ToDo: Export CSV … … 63 63 64 64 65 public PreprocessingContext() : this(new RegressionProblemData()) { } 65 public PreprocessingContext() : this(new RegressionProblemData()) { 66 Name = "Data Preprocessing"; 67 } 66 68 public PreprocessingContext(IItem source) 67 : base(" PreprocessingContext") {69 : base("Data Preprocessing") { 68 70 Import(source); 69 71 } … … 85 87 public void Import(IItem source) { 86 88 Source = source; 89 var namedSource = source as INamedItem; 90 if (namedSource != null) Name = "Preprocessing: " + namedSource.Name; 87 91 88 92 var dataSource = ExtractProblemData(source); … … 100 104 #region Export 101 105 public IItem Export() { 102 var creator = new ProblemDataCreator(this);103 106 if (Source is IAlgorithm) 104 107 return ExportAlgorithm((IAlgorithm)Source); … … 124 127 private IDataAnalysisProblemData ExportProblemData(IDataAnalysisProblemData source) { 125 128 var creator = new ProblemDataCreator(this); 126 return creator.CreateProblemData(source); 129 var preprocessedProblemData = creator.CreateProblemData(source); 130 preprocessedProblemData.Name = "Preprocessed " + source.Name; 131 return preprocessedProblemData; 127 132 } 128 133 private void SetNewProblemData(IDataAnalysisProblem problem) {
Note: See TracChangeset
for help on using the changeset viewer.