Free cookie consent management tool by TermsFeed Policy Generator

Changeset 13507


Ignore:
Timestamp:
01/13/16 14:51:38 (9 years ago)
Author:
pfleck
Message:

#2559

  • Enabled different export types for preprocessing.
  • Hid unused buttons in ViewShortcutListView.
  • Made data preprocessing a NamedItem to allow naming.
Location:
trunk/sources
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.DataPreprocessing.Views/3.4/DataPreprocessingMenuItem.cs

    r13502 r13507  
    2121
    2222using System.Collections.Generic;
     23using System.Windows.Forms;
    2324using HeuristicLab.MainForm;
    2425using HeuristicLab.Optimizer;
     
    3132      }
    3233      public override IEnumerable<string> Structure {
    33         get { return new string[] { "&Edit" }; }
     34        get { return new string[] { "&Edit", "&Data Analysis" }; }
    3435      }
    3536      public override int Position {
    36         get { return 6000; }
     37        get { return 5500; }
    3738      }
    3839      public override string ToolTipText {
     
    4344        MainFormManager.MainForm.ShowContent(new PreprocessingContext());
    4445      }
     46
     47      public override Keys ShortCutKeys {
     48        get { return Keys.Control | Keys.D; }
     49      }
    4550    }
    4651  }
  • trunk/sources/HeuristicLab.DataPreprocessing.Views/3.4/DataPreprocessingView.cs

    r13502 r13507  
    2121
    2222using System;
     23using System.Collections.Generic;
     24using System.Linq;
    2325using System.Windows.Forms;
    2426using HeuristicLab.Common;
     
    3032  [View("DataPreprocessing View")]
    3133  [Content(typeof(PreprocessingContext), true)]
    32   public partial class DataPreprocessingView : ItemView {
     34  public partial class DataPreprocessingView : NamedItemView {
    3335
    3436    public DataPreprocessingView() {
     
    7072        viewShortcutListView.Select();
    7173
     74        applyComboBox.Items.Clear();
     75        applyComboBox.DataSource = Content.ExportPossibilities.ToList();
     76        applyComboBox.DisplayMember = "Key";
     77        if (applyComboBox.Items.Count > 0)
     78          applyComboBox.SelectedIndex = 0;
    7279      } else {
    7380        viewShortcutListView.Content = null;
     
    98105
    99106    private void exportProblemButton_Click(object sender, EventArgs e) {
    100       // ToDo: select one export probability
    101       var problem = Content.Export();
     107      var exportOption = (KeyValuePair<string, Func<IItem>>)applyComboBox.SelectedItem;
     108      var exportItem = exportOption.Value();
    102109
    103110      var saveFileDialog = new SaveFileDialog {
     
    108115      };
    109116
    110       var content = problem as IStorableContent;
     117      var content = exportItem as IStorableContent;
    111118      if (saveFileDialog.ShowDialog() == DialogResult.OK) {
    112119        bool compressed = saveFileDialog.FilterIndex != 1;
     
    116123
    117124    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();
    119127
    120       MainFormManager.MainForm.ShowContent(item);
     128      MainFormManager.MainForm.ShowContent(exportItem);
    121129    }
    122130
  • trunk/sources/HeuristicLab.DataPreprocessing.Views/3.4/DataPreprocessingView.designer.cs

    r12012 r13507  
    4545    /// </summary>
    4646    private void InitializeComponent() {
    47       this.components = new System.ComponentModel.Container();
    4847      System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DataPreprocessingView));
    4948      this.undoButton = new System.Windows.Forms.Button();
    5049      this.applyInNewTabButton = new System.Windows.Forms.Button();
    5150      this.exportProblemButton = new System.Windows.Forms.Button();
    52       this.toolTip = new System.Windows.Forms.ToolTip(this.components);
    5351      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();
    5455      this.viewShortcutListView = new HeuristicLab.DataPreprocessing.Views.ViewShortcutListView();
     56      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
    5557      this.SuspendLayout();
    5658      //
     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      //
    5769      // undoButton
    5870      //
    5971      this.undoButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Undo;
    60       this.undoButton.Location = new System.Drawing.Point(64, 3);
     72      this.undoButton.Location = new System.Drawing.Point(6, 56);
    6173      this.undoButton.Name = "undoButton";
    6274      this.undoButton.Size = new System.Drawing.Size(24, 24);
    63       this.undoButton.TabIndex = 3;
     75      this.undoButton.TabIndex = 5;
    6476      this.toolTip.SetToolTip(this.undoButton, "Undo");
    6577      this.undoButton.UseVisualStyleBackColor = true;
     
    6981      //
    7082      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);
    7284      this.applyInNewTabButton.Name = "applyInNewTabButton";
    7385      this.applyInNewTabButton.Size = new System.Drawing.Size(24, 24);
    7486      this.applyInNewTabButton.TabIndex = 2;
    75       this.toolTip.SetToolTip(this.applyInNewTabButton, "Apply in new tab");
     87      this.toolTip.SetToolTip(this.applyInNewTabButton, "Apply in new Tab");
    7688      this.applyInNewTabButton.UseVisualStyleBackColor = true;
    7789      this.applyInNewTabButton.Click += new System.EventHandler(this.applyInNewTabButton_Click);
     
    8092      //
    8193      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);
    8395      this.exportProblemButton.Name = "exportProblemButton";
    8496      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");
    8799      this.exportProblemButton.UseVisualStyleBackColor = true;
    88100      this.exportProblemButton.Click += new System.EventHandler(this.exportProblemButton_Click);
     
    91103      //
    92104      this.lblFilterActive.AutoSize = true;
    93       this.lblFilterActive.Location = new System.Drawing.Point(220, 12);
     105      this.lblFilterActive.Location = new System.Drawing.Point(84, 62);
    94106      this.lblFilterActive.Name = "lblFilterActive";
    95107      this.lblFilterActive.Size = new System.Drawing.Size(277, 13);
     
    98110      this.lblFilterActive.Visible = false;
    99111      //
     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      //
    100147      // viewShortcutListView
    101148      //
    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)
    104151            | System.Windows.Forms.AnchorStyles.Right)));
    105152      this.viewShortcutListView.Caption = "ViewShortcutCollection View";
    106153      this.viewShortcutListView.Content = null;
    107       this.viewShortcutListView.Location = new System.Drawing.Point(4, 33);
     154      this.viewShortcutListView.Location = new System.Drawing.Point(4, 86);
    108155      this.viewShortcutListView.Name = "viewShortcutListView";
    109156      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;
    112159      //
    113160      // DataPreprocessingView
     
    115162      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    116163      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);
    117168      this.Controls.Add(this.lblFilterActive);
    118169      this.Controls.Add(this.viewShortcutListView);
     170      this.Controls.Add(this.redoButton);
    119171      this.Controls.Add(this.undoButton);
    120       this.Controls.Add(this.applyInNewTabButton);
    121       this.Controls.Add(this.exportProblemButton);
    122172      this.Name = "DataPreprocessingView";
    123173      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();
    124186      this.ResumeLayout(false);
    125187      this.PerformLayout();
     
    132194    private System.Windows.Forms.Button applyInNewTabButton;
    133195    private System.Windows.Forms.Button undoButton;
    134     private System.Windows.Forms.ToolTip toolTip;
    135196    private ViewShortcutListView viewShortcutListView;
    136197    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;
    138201  }
    139202}
  • trunk/sources/HeuristicLab.DataPreprocessing.Views/3.4/ViewShortcutListView.Designer.cs

    r13502 r13507  
    4545    /// </summary>
    4646    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();
    4753      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;
    48104      //
    49105      // ViewShortcutListView
    50106      //
    51       this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    52107      this.Name = "ViewShortcutListView";
    53108      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);
    54115      this.ResumeLayout(false);
     116
    55117    }
    56118
  • trunk/sources/HeuristicLab.DataPreprocessing/3.4/PreprocessingContext.cs

    r13504 r13507  
    3939        var algorithm = Source as IAlgorithm;
    4040        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));
    4242
    4343        var problem = algorithm != null ? algorithm.Problem as IDataAnalysisProblem : Source as IDataAnalysisProblem;
    4444        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));
    4646
    4747        var problemData = problem != null ? problem.ProblemData : Source as IDataAnalysisProblemData;
    4848        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));
    5050
    5151        // ToDo: Export CSV
     
    6363
    6464
    65     public PreprocessingContext() : this(new RegressionProblemData()) { }
     65    public PreprocessingContext() : this(new RegressionProblemData()) {
     66      Name = "Data Preprocessing";
     67    }
    6668    public PreprocessingContext(IItem source)
    67       : base("PreprocessingContext") {
     69      : base("Data Preprocessing") {
    6870      Import(source);
    6971    }
     
    8587    public void Import(IItem source) {
    8688      Source = source;
     89      var namedSource = source as INamedItem;
     90      if (namedSource != null) Name = "Preprocessing: " + namedSource.Name;
    8791
    8892      var dataSource = ExtractProblemData(source);
     
    100104    #region Export
    101105    public IItem Export() {
    102       var creator = new ProblemDataCreator(this);
    103106      if (Source is IAlgorithm)
    104107        return ExportAlgorithm((IAlgorithm)Source);
     
    124127    private IDataAnalysisProblemData ExportProblemData(IDataAnalysisProblemData source) {
    125128      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;
    127132    }
    128133    private void SetNewProblemData(IDataAnalysisProblem problem) {
Note: See TracChangeset for help on using the changeset viewer.