Index: /branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Core/DataSetView.cs
===================================================================
--- /branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Core/DataSetView.cs	(revision 1002)
+++ /branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Core/DataSetView.cs	(revision 1003)
@@ -51,5 +51,4 @@
       base.UpdateControls();
       editorGroupBox.Controls.Clear();
-      editorGroupBox.Enabled = false;
       Control problemControl = (Control)DataSet.Problem.CreateView();
       problemControl.Dock = DockStyle.Fill;
Index: /branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Core/Problem.cs
===================================================================
--- /branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Core/Problem.cs	(revision 1002)
+++ /branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Core/Problem.cs	(revision 1003)
@@ -49,4 +49,5 @@
     public int TrainingSamplesStart {
       get { return trainingSamplesStart; }
+      set { trainingSamplesStart = value; }
     }
 
@@ -54,4 +55,5 @@
     public int TrainingSamplesEnd {
       get { return trainingSamplesEnd; }
+      set { trainingSamplesEnd = value; }
     }
 
@@ -83,8 +85,12 @@
 
     private List<int> allowedInputVariables;
+    public List<int> AllowedInputVariables {
+      get { return allowedInputVariables; }
+    }
+
     private List<int> allowedTargetVariables;
-
-    private List<int> minTimeOffsets;
-    private List<int> maxTimeOffsets;
+    public List<int> AllowedTargetVariables {
+      get { return allowedTargetVariables; }
+    }
 
     private bool autoRegressive;
@@ -104,4 +110,11 @@
     public Problem()
       : base() {
+      dataset = new DataAnalysis.Dataset();
+      allowedInputVariables = new List<int>();
+      allowedTargetVariables = new List<int>();
+    }
+
+    public override IView CreateView() {
+      return new ProblemView(this);
     }
   }
Index: /branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Core/ProblemView.Designer.cs
===================================================================
--- /branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Core/ProblemView.Designer.cs	(revision 1002)
+++ /branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Core/ProblemView.Designer.cs	(revision 1003)
@@ -61,4 +61,5 @@
       this.inputsGroupBox = new System.Windows.Forms.GroupBox();
       this.partitioningGroupBox = new System.Windows.Forms.GroupBox();
+      this.openFileDialog = new System.Windows.Forms.OpenFileDialog();
       this.targetsGroupBox.SuspendLayout();
       this.inputsGroupBox.SuspendLayout();
@@ -74,4 +75,5 @@
       this.importButton.Text = "Import";
       this.importButton.UseVisualStyleBackColor = true;
+      this.importButton.Click += new System.EventHandler(this.importButton_Click);
       // 
       // textBox1
@@ -154,5 +156,5 @@
       this.datasetView.Location = new System.Drawing.Point(3, 32);
       this.datasetView.Name = "datasetView";
-      this.datasetView.Size = new System.Drawing.Size(326, 221);
+      this.datasetView.Size = new System.Drawing.Size(326, 230);
       this.datasetView.TabIndex = 17;
       // 
@@ -181,7 +183,8 @@
       // autoregressiveCheckBox
       // 
+      this.autoregressiveCheckBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
       this.autoregressiveCheckBox.AutoSize = true;
       this.autoregressiveCheckBox.CheckAlign = System.Drawing.ContentAlignment.MiddleRight;
-      this.autoregressiveCheckBox.Location = new System.Drawing.Point(3, 471);
+      this.autoregressiveCheckBox.Location = new System.Drawing.Point(3, 480);
       this.autoregressiveCheckBox.Name = "autoregressiveCheckBox";
       this.autoregressiveCheckBox.Size = new System.Drawing.Size(102, 17);
@@ -192,6 +195,7 @@
       // targetsGroupBox
       // 
+      this.targetsGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
       this.targetsGroupBox.Controls.Add(this.targetsListBox);
-      this.targetsGroupBox.Location = new System.Drawing.Point(3, 365);
+      this.targetsGroupBox.Location = new System.Drawing.Point(3, 374);
       this.targetsGroupBox.Name = "targetsGroupBox";
       this.targetsGroupBox.Size = new System.Drawing.Size(167, 100);
@@ -202,6 +206,7 @@
       // inputsGroupBox
       // 
+      this.inputsGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
       this.inputsGroupBox.Controls.Add(this.inputsListBox);
-      this.inputsGroupBox.Location = new System.Drawing.Point(176, 365);
+      this.inputsGroupBox.Location = new System.Drawing.Point(176, 374);
       this.inputsGroupBox.Name = "inputsGroupBox";
       this.inputsGroupBox.Size = new System.Drawing.Size(153, 100);
@@ -212,4 +217,5 @@
       // partitioningGroupBox
       // 
+      this.partitioningGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
       this.partitioningGroupBox.Controls.Add(this.textBox2);
       this.partitioningGroupBox.Controls.Add(this.trainingLabel);
@@ -221,5 +227,5 @@
       this.partitioningGroupBox.Controls.Add(this.textBox6);
       this.partitioningGroupBox.Controls.Add(this.testLabel);
-      this.partitioningGroupBox.Location = new System.Drawing.Point(3, 259);
+      this.partitioningGroupBox.Location = new System.Drawing.Point(3, 268);
       this.partitioningGroupBox.Name = "partitioningGroupBox";
       this.partitioningGroupBox.Size = new System.Drawing.Size(326, 100);
@@ -227,4 +233,11 @@
       this.partitioningGroupBox.TabStop = false;
       this.partitioningGroupBox.Text = "Data set partitions:";
+      // 
+      // openFileDialog
+      // 
+      this.openFileDialog.DefaultExt = "txt";
+      this.openFileDialog.FileName = "txt";
+      this.openFileDialog.Filter = "Text files|*.txt|All files|*.*";
+      this.openFileDialog.Title = "Import data set from file";
       // 
       // ProblemView
@@ -239,5 +252,5 @@
       this.Controls.Add(this.importButton);
       this.Name = "ProblemView";
-      this.Size = new System.Drawing.Size(337, 569);
+      this.Size = new System.Drawing.Size(337, 500);
       this.targetsGroupBox.ResumeLayout(false);
       this.inputsGroupBox.ResumeLayout(false);
@@ -268,4 +281,5 @@
     private System.Windows.Forms.GroupBox inputsGroupBox;
     private System.Windows.Forms.GroupBox partitioningGroupBox;
+    private System.Windows.Forms.OpenFileDialog openFileDialog;
   }
 }
Index: /branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Core/ProblemView.cs
===================================================================
--- /branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Core/ProblemView.cs	(revision 1002)
+++ /branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Core/ProblemView.cs	(revision 1003)
@@ -29,4 +29,5 @@
 using System.Windows.Forms;
 using HeuristicLab.Core;
+using HeuristicLab.DataAnalysis;
 
 namespace HeuristicLab.CEDMA.Core {
@@ -38,4 +39,77 @@
       InitializeComponent();
     }
+
+    protected override void UpdateControls() {
+      base.UpdateControls();
+      // TASK update text-boxes and datasetview
+    }
+
+    private void importButton_Click(object sender, EventArgs e) {
+      if(openFileDialog.ShowDialog(this) == DialogResult.OK) {
+        DatasetParser parser = new DatasetParser();
+        bool success = false;
+        try {
+          try {
+            parser.Import(openFileDialog.FileName, true);
+            success = true;
+          } catch(DataFormatException ex) {
+            ShowWarningMessageBox(ex);
+            // not possible to parse strictly => clear and try to parse non-strict
+            parser.Reset();
+            parser.Import(openFileDialog.FileName, false);
+            success = true;
+          }
+        } catch(DataFormatException ex) {
+          // if the non-strict parsing also failed then show the exception
+          ShowErrorMessageBox(ex);
+        }
+        if(success) {
+          Dataset dataset = (Dataset)problem.DataSet;
+          dataset.Rows = parser.Rows;
+          dataset.Columns = parser.Columns;
+          dataset.VariableNames = parser.VariableNames;
+          dataset.Name = parser.ProblemName;
+          dataset.Samples = new double[dataset.Rows * dataset.Columns];
+          Array.Copy(parser.Samples, dataset.Samples, dataset.Columns * dataset.Rows);
+          problem.TrainingSamplesStart = parser.TrainingSamplesStart;
+          problem.ValidationSamplesEnd = parser.TrainingSamplesStart;
+          problem.TrainingSamplesEnd = parser.TrainingSamplesEnd;
+          problem.ValidationSamplesStart = parser.ValidationSamplesStart;
+          problem.ValidationSamplesEnd = parser.ValidationSamplesEnd;
+          problem.TestSamplesStart = parser.TestSamplesStart;
+          problem.TestSamplesEnd = parser.TestSamplesEnd;
+          problem.AllowedTargetVariables.Add(parser.TargetVariable);
+
+          List<int> nonInputVariables = parser.NonInputVariables;
+          for(int i = 0; i < dataset.Columns; i++) {
+            if(!nonInputVariables.Contains(i)) problem.AllowedInputVariables.Add(i);
+          }
+          Refresh();
+        }
+      }
+
+    }
+    private void ShowWarningMessageBox(Exception ex) {
+      MessageBox.Show(ex.Message,
+                      "Warning - " + ex.GetType().Name,
+                      MessageBoxButtons.OK,
+                      MessageBoxIcon.Warning);
+    }
+    private void ShowErrorMessageBox(Exception ex) {
+      MessageBox.Show(BuildErrorMessage(ex),
+                      "Error - " + ex.GetType().Name,
+                      MessageBoxButtons.OK,
+                      MessageBoxIcon.Error);
+    }
+    private string BuildErrorMessage(Exception ex) {
+      StringBuilder sb = new StringBuilder();
+      sb.Append("Sorry, but something went wrong!\n\n" + ex.Message + "\n\n" + ex.StackTrace);
+
+      while(ex.InnerException != null) {
+        ex = ex.InnerException;
+        sb.Append("\n\n-----\n\n" + ex.Message + "\n\n" + ex.StackTrace);
+      }
+      return sb.ToString();
+    }
   }
 }
Index: /branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Core/ProblemView.resx
===================================================================
--- /branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Core/ProblemView.resx	(revision 1002)
+++ /branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Core/ProblemView.resx	(revision 1003)
@@ -118,3 +118,6 @@
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
+  <metadata name="openFileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>17, 17</value>
+  </metadata>
 </root>
Index: /branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Server/ServerForm.designer.cs
===================================================================
--- /branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Server/ServerForm.designer.cs	(revision 1002)
+++ /branches/CEDMA-Refactoring-Ticket419/HeuristicLab.CEDMA.Server/ServerForm.designer.cs	(revision 1003)
@@ -47,6 +47,4 @@
       this.addressTextBox = new System.Windows.Forms.TextBox();
       this.externalAddressLabel = new System.Windows.Forms.Label();
-      this.activeAgentsLabel = new System.Windows.Forms.Label();
-      this.activeAgentsTextBox = new System.Windows.Forms.TextBox();
       this.gridAddressLabel = new System.Windows.Forms.Label();
       this.gridAddress = new System.Windows.Forms.TextBox();
@@ -70,23 +68,4 @@
       this.externalAddressLabel.TabIndex = 3;
       this.externalAddressLabel.Text = "&Address:";
-      // 
-      // activeAgentsLabel
-      // 
-      this.activeAgentsLabel.AutoSize = true;
-      this.activeAgentsLabel.Location = new System.Drawing.Point(12, 61);
-      this.activeAgentsLabel.Name = "activeAgentsLabel";
-      this.activeAgentsLabel.Size = new System.Drawing.Size(75, 13);
-      this.activeAgentsLabel.TabIndex = 7;
-      this.activeAgentsLabel.Text = "A&ctive agents:";
-      // 
-      // activeAgentsTextBox
-      // 
-      this.activeAgentsTextBox.Location = new System.Drawing.Point(106, 58);
-      this.activeAgentsTextBox.Name = "activeAgentsTextBox";
-      this.activeAgentsTextBox.ReadOnly = true;
-      this.activeAgentsTextBox.Size = new System.Drawing.Size(90, 20);
-      this.activeAgentsTextBox.TabIndex = 6;
-      this.activeAgentsTextBox.Text = "0";
-      this.activeAgentsTextBox.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
       // 
       // gridAddressLabel
@@ -124,10 +103,8 @@
       this.Controls.Add(this.gridAddressLabel);
       this.Controls.Add(this.gridAddress);
-      this.Controls.Add(this.activeAgentsLabel);
-      this.Controls.Add(this.activeAgentsTextBox);
       this.Controls.Add(this.externalAddressLabel);
       this.Controls.Add(this.addressTextBox);
       this.Name = "ServerForm";
-      this.Text = "Agent Server";
+      this.Text = "CEDMA Server";
       this.ResumeLayout(false);
       this.PerformLayout();
@@ -139,6 +116,4 @@
     private System.Windows.Forms.TextBox addressTextBox;
     private System.Windows.Forms.Label externalAddressLabel;
-    private System.Windows.Forms.Label activeAgentsLabel;
-    private System.Windows.Forms.TextBox activeAgentsTextBox;
     private System.Windows.Forms.Label gridAddressLabel;
     private System.Windows.Forms.TextBox gridAddress;
