Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/24/11 23:56:39 (13 years ago)
Author:
mkommend
Message:

#1313: Implemented new views for data analysis solutions.

Location:
trunk/sources/HeuristicLab.Algorithms.DataAnalysis.Views/3.4
Files:
1 edited
2 copied

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/HeuristicLab.Algorithms.DataAnalysis.Views-3.4.csproj

    r5809 r5829  
    114114  </ItemGroup>
    115115  <ItemGroup>
     116    <Compile Include="SupportVectorMachineModelSupportVectorsView.cs">
     117      <SubType>UserControl</SubType>
     118    </Compile>
     119    <Compile Include="SupportVectorMachineModelSupportVectorsView.Designer.cs">
     120      <DependentUpon>SupportVectorMachineModelSupportVectorsView.cs</DependentUpon>
     121    </Compile>
    116122    <Compile Include="CrossValidationView.cs">
    117123      <SubType>UserControl</SubType>
     
    127133    <Compile Include="SupportVectorMachineModelView.Designer.cs">
    128134      <DependentUpon>SupportVectorMachineModelView.cs</DependentUpon>
    129     </Compile>
    130     <Compile Include="SupportVectorRegressionSolutionView.cs">
    131       <SubType>UserControl</SubType>
    132     </Compile>
    133     <Compile Include="SupportVectorRegressionSolutionView.Designer.cs">
    134       <DependentUpon>SupportVectorRegressionSolutionView.cs</DependentUpon>
    135135    </Compile>
    136136  </ItemGroup>
  • trunk/sources/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/SupportVectorMachineModelSupportVectorsView.Designer.cs

    r5827 r5829  
    2121
    2222namespace HeuristicLab.Algorithms.DataAnalysis.Views {
    23   partial class SupportVectorMachineModelView {
     23  partial class SupportVectorMachineModelSupportVectorsView {
    2424    /// <summary>
    2525    /// Required designer variable.
     
    4545    /// </summary>
    4646    private void InitializeComponent() {
    47       this.textBox = new System.Windows.Forms.TextBox();
     47      this.stringConvertibleMatrixView = new HeuristicLab.Data.Views.StringConvertibleMatrixView();
    4848      this.SuspendLayout();
    4949      //
    50       // textBox
     50      // stringConvertibleMatrixView
    5151      //
    52       this.textBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    53                   | System.Windows.Forms.AnchorStyles.Left)
    54                   | System.Windows.Forms.AnchorStyles.Right)));
    55       this.textBox.Location = new System.Drawing.Point(3, 3);
    56       this.textBox.Multiline = true;
    57       this.textBox.Name = "textBox";
    58       this.textBox.ReadOnly = true;
    59       this.textBox.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
    60       this.textBox.Size = new System.Drawing.Size(247, 245);
    61       this.textBox.TabIndex = 0;
     52      this.stringConvertibleMatrixView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     53            | System.Windows.Forms.AnchorStyles.Left)
     54            | System.Windows.Forms.AnchorStyles.Right)));
     55      this.stringConvertibleMatrixView.Caption = "StringConvertibleMatrix View";
     56      this.stringConvertibleMatrixView.Content = null;
     57      this.stringConvertibleMatrixView.Location = new System.Drawing.Point(3, 3);
     58      this.stringConvertibleMatrixView.Name = "stringConvertibleMatrixView";
     59      this.stringConvertibleMatrixView.ReadOnly = false;
     60      this.stringConvertibleMatrixView.ShowRowsAndColumnsTextBox = true;
     61      this.stringConvertibleMatrixView.ShowStatisticalInformation = false;
     62      this.stringConvertibleMatrixView.Size = new System.Drawing.Size(381, 230);
     63      this.stringConvertibleMatrixView.TabIndex = 0;
    6264      //
    63       // SupportVectorMachineModelView
     65      // SupportVectorMachineModelSupportVectorsView
    6466      //
    65       this.AllowDrop = true;
    6667      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    67       this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    68       this.Controls.Add(this.textBox);
    69       this.Name = "SupportVectorMachineModelView";
    70       this.Size = new System.Drawing.Size(253, 251);
     68      this.Controls.Add(this.stringConvertibleMatrixView);
     69      this.Name = "SupportVectorMachineModelSupportVectorsView";
     70      this.Size = new System.Drawing.Size(387, 236);
    7171      this.ResumeLayout(false);
    72       this.PerformLayout();
    7372
    7473    }
     
    7675    #endregion
    7776
    78     private System.Windows.Forms.TextBox textBox;
    79 
    80 
     77    private Data.Views.StringConvertibleMatrixView stringConvertibleMatrixView;
    8178  }
    8279}
  • trunk/sources/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/SupportVectorMachineModelSupportVectorsView.cs

    r5827 r5829  
    2020#endregion
    2121using System;
    22 using System.IO;
    2322using System.Windows.Forms;
    2423using HeuristicLab.MainForm;
     
    2625
    2726namespace HeuristicLab.Algorithms.DataAnalysis.Views {
    28   [View("Support vector machine model view")]
    29   [Content(typeof(SupportVectorMachineModel), true)]
    30   public partial class SupportVectorMachineModelView : AsynchronousContentView {
     27  [View("Support vectors view")]
     28  [Content(typeof(SupportVectorMachineModel), false)]
     29  public partial class SupportVectorMachineModelSupportVectorsView : AsynchronousContentView {
    3130
    3231    public new SupportVectorMachineModel Content {
     
    3534    }
    3635
    37     public SupportVectorMachineModelView()
     36    public SupportVectorMachineModelSupportVectorsView()
    3837      : base() {
    3938      InitializeComponent();
     
    4241    protected override void OnContentChanged() {
    4342      base.OnContentChanged();
    44       if (Content == null)
    45         textBox.Text = string.Empty;
     43      if (Content != null)
     44        stringConvertibleMatrixView.Content = Content.SupportVectors;
    4645      else
    47         UpdateTextBox();
     46        stringConvertibleMatrixView.Content = null;
    4847    }
    4948
     
    5756    }
    5857    private void Content_Changed(object sender, EventArgs e) {
    59       UpdateTextBox();
    60     }
    61 
    62     private void UpdateTextBox() {
    63       using (MemoryStream s = new MemoryStream()) {
    64         StreamWriter writer = new StreamWriter(s);
    65         writer.WriteLine("RangeTransform:");
    66         writer.Flush();
    67         using (MemoryStream memStream = new MemoryStream()) {
    68           SVM.RangeTransform.Write(memStream, Content.RangeTransform);
    69           memStream.Seek(0, SeekOrigin.Begin);
    70           memStream.WriteTo(s);
    71         }
    72         writer.WriteLine("Model:");
    73         writer.Flush();
    74         using (MemoryStream memStream = new MemoryStream()) {
    75           SVM.Model.Write(memStream, Content.Model);
    76           memStream.Seek(0, SeekOrigin.Begin);
    77           memStream.WriteTo(s);
    78         }
    79         s.Flush();
    80         s.Seek(0, SeekOrigin.Begin);
    81 
    82         StreamReader reader = new StreamReader(s);
    83         textBox.Text = reader.ReadToEnd();
    84       }
     58      OnContentChanged();
    8559    }
    8660  }
Note: See TracChangeset for help on using the changeset viewer.