Free cookie consent management tool by TermsFeed Policy Generator

Changeset 4011


Ignore:
Timestamp:
07/07/10 14:36:22 (14 years ago)
Author:
mkommend
Message:
  • refactored ViewHost and various views to use fewer nested controls
  • added UnitTests for ContentViews to ensure proper using of the ContentAttribute
  • fixed some views which could not handle null as Content

(ticket #972)

Location:
trunk/sources
Files:
8 added
2 deleted
21 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab 3.3.sln

    r3920 r4011  
    66    ConfigMerger.exe = ConfigMerger.exe
    77    ..\documentation\License\gpl-3.0.txt = ..\documentation\License\gpl-3.0.txt
     8    HeuristicLab 3.31.vsmdi = HeuristicLab 3.31.vsmdi
    89    LocalTestRun.testrunconfig = LocalTestRun.testrunconfig
    910    PreBuildEvent.cmd = PreBuildEvent.cmd
     
    307308Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Problems.VehicleRouting.Views-3.3", "HeuristicLab.Problems.VehicleRouting.Views\3.3\HeuristicLab.Problems.VehicleRouting.Views-3.3.csproj", "{D1386FE7-682D-4E18-8C4F-CFD423FA5DD0}"
    308309EndProject
     310Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.MainForm.WindowsForms-3.3.Tests", "HeuristicLab.MainForm.WindowsForms\3.3\Tests\HeuristicLab.MainForm.WindowsForms-3.3.Tests.csproj", "{9F3D601F-E39A-42BE-AEF7-2BF5AD2942D9}"
     311EndProject
    309312Global
     313  GlobalSection(TestCaseManagementSettings) = postSolution
     314    CategoryFile = HeuristicLab 3.31.vsmdi
     315  EndGlobalSection
    310316  GlobalSection(SolutionConfigurationPlatforms) = preSolution
    311317    Debug|Any CPU = Debug|Any CPU
     
    20492055    {D1386FE7-682D-4E18-8C4F-CFD423FA5DD0}.Silverlight2|x64.Build.0 = Release|x64
    20502056    {D1386FE7-682D-4E18-8C4F-CFD423FA5DD0}.Silverlight2|x86.ActiveCfg = Release|x64
     2057    {9F3D601F-E39A-42BE-AEF7-2BF5AD2942D9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
     2058    {9F3D601F-E39A-42BE-AEF7-2BF5AD2942D9}.Debug|Any CPU.Build.0 = Debug|Any CPU
     2059    {9F3D601F-E39A-42BE-AEF7-2BF5AD2942D9}.Debug|x64.ActiveCfg = Debug|x64
     2060    {9F3D601F-E39A-42BE-AEF7-2BF5AD2942D9}.Debug|x86.ActiveCfg = Debug|x86
     2061    {9F3D601F-E39A-42BE-AEF7-2BF5AD2942D9}.Release|Any CPU.ActiveCfg = Release|Any CPU
     2062    {9F3D601F-E39A-42BE-AEF7-2BF5AD2942D9}.Release|Any CPU.Build.0 = Release|Any CPU
     2063    {9F3D601F-E39A-42BE-AEF7-2BF5AD2942D9}.Release|x64.ActiveCfg = Release|x64
     2064    {9F3D601F-E39A-42BE-AEF7-2BF5AD2942D9}.Release|x64.Build.0 = Release|x64
     2065    {9F3D601F-E39A-42BE-AEF7-2BF5AD2942D9}.Release|x86.ActiveCfg = Release|x86
     2066    {9F3D601F-E39A-42BE-AEF7-2BF5AD2942D9}.Services|Any CPU.ActiveCfg = Release|Any CPU
     2067    {9F3D601F-E39A-42BE-AEF7-2BF5AD2942D9}.Services|Any CPU.Build.0 = Release|Any CPU
     2068    {9F3D601F-E39A-42BE-AEF7-2BF5AD2942D9}.Services|x64.ActiveCfg = Release|Any CPU
     2069    {9F3D601F-E39A-42BE-AEF7-2BF5AD2942D9}.Services|x86.ActiveCfg = Release|Any CPU
     2070    {9F3D601F-E39A-42BE-AEF7-2BF5AD2942D9}.Silverlight2|Any CPU.ActiveCfg = Release|Any CPU
     2071    {9F3D601F-E39A-42BE-AEF7-2BF5AD2942D9}.Silverlight2|Any CPU.Build.0 = Release|Any CPU
     2072    {9F3D601F-E39A-42BE-AEF7-2BF5AD2942D9}.Silverlight2|x64.ActiveCfg = Release|Any CPU
     2073    {9F3D601F-E39A-42BE-AEF7-2BF5AD2942D9}.Silverlight2|x86.ActiveCfg = Release|Any CPU
    20512074  EndGlobalSection
    20522075  GlobalSection(SolutionProperties) = preSolution
  • trunk/sources/HeuristicLab.Data.Views/3.3/BoolValueView.cs

    r3904 r4011  
    7878
    7979    private void valueCheckBox_CheckedChanged(object sender, EventArgs e) {
    80       if (!Content.ReadOnly) Content.Value = valueCheckBox.Checked;
     80      if (Content != null && !Content.ReadOnly) Content.Value = valueCheckBox.Checked;
    8181    }
    8282  }
  • trunk/sources/HeuristicLab.Data.Views/3.3/StringConvertibleMatrixView.cs

    r3936 r4011  
    135135    private void UpdateRowHeaders() {
    136136      int firstDisplayedRowIndex = dataGridView.FirstDisplayedScrollingRowIndex;
    137       if(firstDisplayedRowIndex == -1)
     137      if (firstDisplayedRowIndex == -1)
    138138        firstDisplayedRowIndex = 0;
    139139      int lastDisplaydRowIndex = firstDisplayedRowIndex + dataGridView.DisplayedRowCount(true);
     
    241241    }
    242242    private void dataGridView_CellValueNeeded(object sender, DataGridViewCellValueEventArgs e) {
    243       if (e.RowIndex < Content.Rows && e.ColumnIndex < Content.Columns) {
     243      if (Content != null && e.RowIndex < Content.Rows && e.ColumnIndex < Content.Columns) {
    244244        int rowIndex = virtualRowIndizes[e.RowIndex];
    245245        e.Value = Content.GetValue(rowIndex, e.ColumnIndex);
  • trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3/HeuristicLab.MainForm.WindowsForms-3.3.csproj

    r3832 r4011  
    164164      <DependentUpon>ViewHost.cs</DependentUpon>
    165165    </Compile>
    166     <Compile Include="ViewHostPanel.cs">
    167       <SubType>Component</SubType>
    168     </Compile>
    169     <Compile Include="ViewHostPanel.Designer.cs">
    170       <DependentUpon>ViewHostPanel.cs</DependentUpon>
    171     </Compile>
    172166  </ItemGroup>
    173167  <ItemGroup>
  • trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3/HeuristicLabMainFormWindowsFormsPlugin.cs.frame

    r3702 r4011  
    3232  [PluginDependency("HeuristicLab.MainForm", "3.3")]
    3333  [PluginDependency("HeuristicLab.WinFormsUI", "2.3.1")]
    34   public class HeuristicLabMainFormTestPlugin : PluginBase {
     34  public class HeuristicLabMainFormPlugin : PluginBase {
    3535  }
    3636}
  • trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3/ViewHost.Designer.cs

    r3658 r4011  
    4646    private void InitializeComponent() {
    4747      this.components = new System.ComponentModel.Container();
    48       this.viewPanel = new HeuristicLab.MainForm.WindowsForms.ViewHostPanel();
    4948      this.messageLabel = new System.Windows.Forms.Label();
    5049      this.viewsLabel = new System.Windows.Forms.Label();
     
    5251      this.toolTip = new System.Windows.Forms.ToolTip(this.components);
    5352      this.SuspendLayout();
    54       //
    55       // viewPanel
    56       //
    57       this.viewPanel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    58                   | System.Windows.Forms.AnchorStyles.Left)
    59                   | System.Windows.Forms.AnchorStyles.Right)));
    60       this.viewPanel.Location = new System.Drawing.Point(0, 0);
    61       this.viewPanel.Name = "viewPanel";
    62       this.viewPanel.Size = new System.Drawing.Size(205, 184);
    63       this.viewPanel.TabIndex = 1;
    64       this.viewPanel.Resize += new System.EventHandler(this.viewPanel_Resize);
    6553      //
    6654      // messageLabel
     
    8068      this.viewsLabel.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Windows;
    8169      this.viewsLabel.Location = new System.Drawing.Point(211, 0);
     70      this.viewsLabel.Margin = new System.Windows.Forms.Padding(3);
    8271      this.viewsLabel.Name = "viewsLabel";
    8372      this.viewsLabel.Size = new System.Drawing.Size(16, 16);
     
    10089      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    10190      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    102       this.Controls.Add(this.viewPanel);
    10391      this.Controls.Add(this.viewsLabel);
    10492      this.Controls.Add(this.messageLabel);
     
    10694      this.Size = new System.Drawing.Size(227, 184);
    10795      this.ResumeLayout(false);
    108 
    10996    }
    11097
    11198    #endregion
    112 
    113     private ViewHostPanel viewPanel;
    11499    private System.Windows.Forms.Label viewsLabel;
    115100    private System.Windows.Forms.Label messageLabel;
  • trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3/ViewHost.cs

    r3924 r4011  
    3333      InitializeComponent();
    3434      cachedViews = new Dictionary<Type, IContentView>();
    35       viewType = null;
    3635      startDragAndDrop = false;
    3736      viewContextMenuStrip.IgnoredViewTypes = new List<Type>() { typeof(ViewHost) };
     37
     38      viewType = null;
    3839      activeView = null;
    3940      Content = null;
    40       OnContentChanged();
    41     }
    42 
    43     private bool viewShown;
     41      messageLabel.Visible = false;
     42      viewsLabel.Visible = false;
     43    }
     44
    4445    private Dictionary<Type, IContentView> cachedViews;
    4546    public IEnumerable<IContentView> Views {
     
    5758            if (view != null)
    5859              view.OnHidden(EventArgs.Empty);
     60            if (ActiveViewControl != null)
     61              ActiveViewControl.Visible = false;
    5962          }
    6063          activeView = value;
    6164          if (activeView != null) {
    62             ViewType = activeView.GetType();
     65            viewType = activeView.GetType();
    6366            RegisterActiveViewEvents();
    6467            View view = activeView as View;
    6568            if (view != null)
    6669              view.OnShown(new ViewShownEventArgs(view, false));
     70            if (ActiveViewControl != null) {
     71              ActiveViewControl.Visible = true;
     72              ActiveViewControl.BringToFront();
     73            }
    6774          }
    68           ActiveViewChanged();
    69         }
    70       }
    71     }
     75          OnActiveViewChanged();
     76        }
     77      }
     78    }
     79
     80    private Control ActiveViewControl {
     81      get { return ActiveView as Control; }
     82    }
     83
    7284    private Type viewType;
    7385    public Type ViewType {
     
    7587      set {
    7688        if (viewType != value) {
    77           if (value != null && !ViewCanShowContent(value, Content))
     89          if (value != null && Content != null && !ViewCanShowContent(value, Content))
    7890            throw new ArgumentException(string.Format("View \"{0}\" cannot display content \"{1}\".",
    7991                                                      value, Content.GetType()));
     
    96108    protected override void OnContentChanged() {
    97109      viewContextMenuStrip.Item = Content;
    98 
    99       if (Content != null) {
    100         if (viewContextMenuStrip.Items.Count == 0) {
    101           messageLabel.Visible = true;
    102           viewsLabel.Visible = false;
    103           viewPanel.Visible = false;
    104         } else {
    105           messageLabel.Visible = false;
    106           viewsLabel.Visible = true;
    107           viewPanel.Visible = true;
    108         }
    109 
     110      //remove cached views which cannot show the content
     111      foreach (Type type in cachedViews.Keys.ToList()) {
     112        if (!ViewCanShowContent(type, Content)) {
     113          Control c = cachedViews[type] as Control;
     114          if (c != null) {
     115            this.Controls.Remove(c);
     116            c.Dispose();
     117          }
     118          cachedViews.Remove(type);
     119        }
     120      }
     121
     122      //change ViewType if view of ViewType can not show content or is null
     123      if (Content != null && !ViewCanShowContent(viewType, Content)) {
    110124        Type defaultViewType = MainFormManager.GetDefaultViewType(Content.GetType());
    111         if (ViewType == null || !ViewCanShowContent(viewType, Content)) {
    112           cachedViews.Clear();
    113           if (defaultViewType == null) {
    114             if (viewContextMenuStrip.Items.Count > 0)  // create first available view if default view is not available
    115               ViewType = (Type)viewContextMenuStrip.Items[0].Tag;
    116           } else ViewType = defaultViewType;
    117         } else {
    118           foreach (Type type in cachedViews.Keys.ToList()) {
    119             if (!ViewCanShowContent(type, Content)) {
    120               Control c = cachedViews[type] as Control;
    121               if (c != null)
    122                 c.Dispose();
    123               cachedViews.Remove(type);
    124             }
    125           }
    126         }
    127         UpdateActiveMenuItem();
    128         foreach (IContentView view in cachedViews.Values)
    129           view.Content = this.Content;
     125        if (defaultViewType != null)
     126          ViewType = defaultViewType;
     127        else if (viewContextMenuStrip.Items.Count > 0)  // create first available view if no default view is available
     128          ViewType = (Type)viewContextMenuStrip.Items[0].Tag;
     129        else
     130          ViewType = null;
     131      }
     132
     133      foreach (IContentView view in cachedViews.Values)
     134        view.Content = this.Content;
     135
     136      if (Content != null && viewType != null)
     137        ActiveView = cachedViews[viewType];
     138      else
     139        ActiveView = null;
     140
     141      if (Content != null && viewContextMenuStrip.Items.Count > 0) {
     142        messageLabel.Visible = false;
     143        viewsLabel.Visible = true;
     144      } else if (Content != null) {
     145        messageLabel.Visible = true;
     146        viewsLabel.Visible = false;
    130147      } else {
    131148        messageLabel.Visible = false;
    132149        viewsLabel.Visible = false;
    133         viewPanel.Visible = false;
    134150      }
    135151    }
    136152
    137153    private void OnViewTypeChanged() {
    138       for (int i = viewPanel.Controls.Count - 1; i > 0; i--)
    139         viewPanel.Controls[i].Dispose();
    140       viewPanel.Controls.Clear();
    141 
    142       if (viewType == null || Content == null)
    143         return;
    144       if (!ViewCanShowContent(viewType, Content))
    145         throw new InvalidOperationException(string.Format("View \"{0}\" cannot display content \"{1}\".",
    146                                                           viewType, Content.GetType()));
    147       if (viewPanel.Height <= 10 || viewPanel.Width <= 10) {
    148         viewShown = false;
    149         return;
    150       }
    151 
    152       viewShown = true;
    153       UpdateActiveMenuItem();
    154       IContentView view;
    155       if (cachedViews.ContainsKey(ViewType))
    156         view = cachedViews[ViewType];
    157       else {
    158         view = MainFormManager.CreateView(viewType);
    159         view.ReadOnly = this.ReadOnly;
    160         view.Locked = this.Locked;
    161         view.Content = Content;
    162         cachedViews.Add(viewType, view);
    163       }
    164       this.ActiveView = view;
    165       Control control = (Control)view;
    166       control.Dock = DockStyle.Fill;
    167       viewPanel.Controls.Add(control);
    168       viewPanel.Visible = true;
    169     }
    170 
    171     private void viewPanel_Resize(object sender, EventArgs e) {
    172       if (!viewShown)
    173         this.OnViewTypeChanged();
     154      if (viewType != null) {
     155        if (!ViewCanShowContent(viewType, Content))
     156          throw new InvalidOperationException(string.Format("View \"{0}\" cannot display content \"{1}\".",
     157                                                            viewType, Content.GetType()));
     158        IContentView view;
     159        if (!cachedViews.ContainsKey(ViewType)) {
     160          view = MainFormManager.CreateView(viewType);
     161          view.ReadOnly = this.ReadOnly;
     162          view.Locked = this.Locked;
     163          view.Content = Content;
     164          cachedViews.Add(viewType, view);
     165          Control c = view as Control;
     166          if (c != null)
     167            this.Controls.Add(c);
     168        }
     169        UpdateActiveMenuItem();
     170        ActiveView = cachedViews[viewType];
     171      }
     172    }
     173
     174    private void OnActiveViewChanged() {
     175      this.SuspendRepaint();
     176      if (activeView != null) {
     177        UpdateActiveMenuItem();
     178        this.ActiveViewControl.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right;
     179        this.ActiveViewControl.Size = new System.Drawing.Size(this.Width - this.viewsLabel.Width - this.viewsLabel.Margin.Left - this.viewsLabel.Margin.Right, this.Height);
     180        this.ActiveViewChanged();
     181      }
     182      this.ResumeRepaint(true);
     183    }
     184
     185    protected override void OnSizeChanged(EventArgs e) {
     186      //mkommend: solution to resizing issues. taken from http://support.microsoft.com/kb/953934
     187      //not implemented with a panel to reduce the number of nested controls
     188      if (this.Handle != null)
     189        this.BeginInvoke((Action<EventArgs>)OnSizeChangedHelper, e);
     190    }
     191    private void OnSizeChangedHelper(EventArgs e) {
     192      base.OnSizeChanged(e);
     193      this.viewsLabel.Location = new System.Drawing.Point(this.Width - this.viewsLabel.Margin.Right - this.viewsLabel.Width, this.viewsLabel.Margin.Top);
    174194    }
    175195
     
    194214      }
    195215    }
     216
    196217    #region forwarding of view events
    197218    protected override void OnReadOnlyChanged() {
  • trunk/sources/HeuristicLab.Operators.Views.GraphVisualization/3.3/OperatorGraphVisualization/OperatorGraphView.cs

    r3904 r4011  
    4242    public OperatorGraphView() {
    4343      InitializeComponent();
    44  
     44
    4545      this.graphVisualizationInfoView.Controller.OnShowContextMenu += new EventHandler<EntityMenuEventArgs>(Controller_OnShowContextMenu);
    4646      this.graphVisualizationInfoView.Controller.Model.Selection.OnNewSelection += new EventHandler(Controller_SelectionChanged);
     
    5858
    5959    protected override void OnContentChanged() {
    60       bool createdVisualizationInfo = false;
    61       if (this.VisualizationInfo == null) {
    62         this.VisualizationInfo = new OperatorGraphVisualizationInfo(this.Content);
    63         createdVisualizationInfo = true;
    64       }
    65       this.graphVisualizationInfoView.Content = this.VisualizationInfo;
    66       if (createdVisualizationInfo)
    67         this.graphVisualizationInfoView.RelayoutGraph();
     60      if (Content != null) {
     61        bool createdVisualizationInfo = false;
     62        if (this.VisualizationInfo == null) {
     63          this.VisualizationInfo = new OperatorGraphVisualizationInfo(this.Content);
     64          createdVisualizationInfo = true;
     65        }
     66        this.graphVisualizationInfoView.Content = this.VisualizationInfo;
     67        if (createdVisualizationInfo)
     68          this.graphVisualizationInfoView.RelayoutGraph();
     69      } else {
     70        this.graphVisualizationInfoView.Content = null;
     71      }
    6872    }
    6973
     
    188192
    189193    private void initialOperatorToolStripMenuItem_Click(object sender, EventArgs e) {
    190         IOperatorShapeInfo shapeInfo = this.shapeContextMenu.Tag as IOperatorShapeInfo;
    191         if (this.VisualizationInfo.InitialShape == shapeInfo)
    192           this.VisualizationInfo.InitialShape = null;
    193         else
    194           this.VisualizationInfo.InitialShape = shapeInfo;
     194      IOperatorShapeInfo shapeInfo = this.shapeContextMenu.Tag as IOperatorShapeInfo;
     195      if (this.VisualizationInfo.InitialShape == shapeInfo)
     196        this.VisualizationInfo.InitialShape = null;
     197      else
     198        this.VisualizationInfo.InitialShape = shapeInfo;
    195199    }
    196200
    197201    private void breakPointToolStripMenuItem_Click(object sender, EventArgs e) {
    198         IOperatorShapeInfo shapeInfo = this.shapeContextMenu.Tag as IOperatorShapeInfo;
    199         if (shapeInfo != null) {
    200           IOperator op = this.VisualizationInfo.GetOperatorForShapeInfo(shapeInfo);
    201           op.Breakpoint = !op.Breakpoint;
    202         }
     202      IOperatorShapeInfo shapeInfo = this.shapeContextMenu.Tag as IOperatorShapeInfo;
     203      if (shapeInfo != null) {
     204        IOperator op = this.VisualizationInfo.GetOperatorForShapeInfo(shapeInfo);
     205        op.Breakpoint = !op.Breakpoint;
     206      }
    203207    }
    204208    #endregion
  • trunk/sources/HeuristicLab.Optimization.Views/3.3/AlgorithmView.Designer.cs

    r3764 r4011  
    5050      this.parameterCollectionView = new HeuristicLab.Core.Views.ParameterCollectionView();
    5151      this.problemTabPage = new System.Windows.Forms.TabPage();
    52       this.problemPanel = new System.Windows.Forms.Panel();
    5352      this.problemViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
    5453      this.openProblemButton = new System.Windows.Forms.Button();
     
    6968      this.parametersTabPage.SuspendLayout();
    7069      this.problemTabPage.SuspendLayout();
    71       this.problemPanel.SuspendLayout();
    7270      this.resultsTabPage.SuspendLayout();
    7371      this.runsTabPage.SuspendLayout();
     
    123121      // problemTabPage
    124122      //
    125       this.problemTabPage.Controls.Add(this.problemPanel);
     123      this.problemTabPage.Controls.Add(this.problemViewHost);
    126124      this.problemTabPage.Controls.Add(this.openProblemButton);
    127125      this.problemTabPage.Controls.Add(this.newProblemButton);
     
    134132      this.problemTabPage.UseVisualStyleBackColor = true;
    135133      //
    136       // problemPanel
    137       //
    138       this.problemPanel.AllowDrop = true;
    139       this.problemPanel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    140                   | System.Windows.Forms.AnchorStyles.Left)
    141                   | System.Windows.Forms.AnchorStyles.Right)));
    142       this.problemPanel.Controls.Add(this.problemViewHost);
    143       this.problemPanel.Location = new System.Drawing.Point(6, 36);
    144       this.problemPanel.Name = "problemPanel";
    145       this.problemPanel.Size = new System.Drawing.Size(659, 332);
    146       this.problemPanel.TabIndex = 3;
    147       this.problemPanel.DragOver += new System.Windows.Forms.DragEventHandler(this.problemPanel_DragEnterOver);
    148       this.problemPanel.DragDrop += new System.Windows.Forms.DragEventHandler(this.problemPanel_DragDrop);
    149       this.problemPanel.DragEnter += new System.Windows.Forms.DragEventHandler(this.problemPanel_DragEnterOver);
    150       //
    151134      // problemViewHost
    152135      //
     136      this.problemViewHost.AllowDrop = true;
    153137      this.problemViewHost.Content = null;
    154       this.problemViewHost.Dock = System.Windows.Forms.DockStyle.Fill;
    155       this.problemViewHost.Location = new System.Drawing.Point(0, 0);
     138      this.problemViewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     139                  | System.Windows.Forms.AnchorStyles.Left)
     140                  | System.Windows.Forms.AnchorStyles.Right)));
     141      this.problemViewHost.Location = new System.Drawing.Point(6, 36);
    156142      this.problemViewHost.Name = "problemViewHost";
    157143      this.problemViewHost.Size = new System.Drawing.Size(659, 332);
    158       this.problemViewHost.TabIndex = 0;
     144      this.problemViewHost.TabIndex = 3;
    159145      this.problemViewHost.ViewType = null;
     146      this.problemViewHost.DragOver += new System.Windows.Forms.DragEventHandler(this.problemViewHost_DragEnterOver);
     147      this.problemViewHost.DragDrop += new System.Windows.Forms.DragEventHandler(this.problemViewHost_DragDrop);
     148      this.problemViewHost.DragEnter += new System.Windows.Forms.DragEventHandler(this.problemViewHost_DragEnterOver);
    160149      //
    161150      // openProblemButton
     
    327316      this.parametersTabPage.ResumeLayout(false);
    328317      this.problemTabPage.ResumeLayout(false);
    329       this.problemPanel.ResumeLayout(false);
    330318      this.resultsTabPage.ResumeLayout(false);
    331319      this.runsTabPage.ResumeLayout(false);
     
    355343    protected System.Windows.Forms.TabPage runsTabPage;
    356344    protected RunCollectionView runsView;
    357     protected System.Windows.Forms.Panel problemPanel;
    358 
    359345  }
    360346}
  • trunk/sources/HeuristicLab.Optimization.Views/3.3/AlgorithmView.cs

    r3904 r4011  
    216216      Content.Prepare(false);
    217217    }
    218     protected virtual void problemPanel_DragEnterOver(object sender, DragEventArgs e) {
     218    protected virtual void problemViewHost_DragEnterOver(object sender, DragEventArgs e) {
    219219      e.Effect = DragDropEffects.None;
    220220      Type type = e.Data.GetData("Type") as Type;
     
    227227      }
    228228    }
    229     protected virtual void problemPanel_DragDrop(object sender, DragEventArgs e) {
     229    protected virtual void problemViewHost_DragDrop(object sender, DragEventArgs e) {
    230230      if (e.Effect != DragDropEffects.None) {
    231231        IProblem problem = e.Data.GetData("Value") as IProblem;
  • trunk/sources/HeuristicLab.Optimization.Views/3.3/BatchRunView.Designer.cs

    r3764 r4011  
    4848      this.tabControl = new System.Windows.Forms.TabControl();
    4949      this.algorithmTabPage = new System.Windows.Forms.TabPage();
    50       this.algorithmPanel = new System.Windows.Forms.Panel();
    5150      this.algorithmViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
    5251      this.openAlgorithmButton = new System.Windows.Forms.Button();
     
    6665      this.tabControl.SuspendLayout();
    6766      this.algorithmTabPage.SuspendLayout();
    68       this.algorithmPanel.SuspendLayout();
    6967      this.runsTabPage.SuspendLayout();
    7068      ((System.ComponentModel.ISupportInitialize)(this.repetitionsNumericUpDown)).BeginInit();
     
    9694      // algorithmTabPage
    9795      //
    98       this.algorithmTabPage.Controls.Add(this.algorithmPanel);
     96      this.algorithmTabPage.Controls.Add(this.algorithmViewHost);
    9997      this.algorithmTabPage.Controls.Add(this.openAlgorithmButton);
    10098      this.algorithmTabPage.Controls.Add(this.newAlgorithmButton);
     
    107105      this.algorithmTabPage.UseVisualStyleBackColor = true;
    108106      //
    109       // algorithmPanel
    110       //
    111       this.algorithmPanel.AllowDrop = true;
    112       this.algorithmPanel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     107      // algorithmViewHost
     108      //
     109      this.algorithmViewHost.Content = null;
     110      this.algorithmViewHost.AllowDrop = true;
     111      this.algorithmViewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    113112                  | System.Windows.Forms.AnchorStyles.Left)
    114113                  | System.Windows.Forms.AnchorStyles.Right)));
    115       this.algorithmPanel.Controls.Add(this.algorithmViewHost);
    116       this.algorithmPanel.Location = new System.Drawing.Point(6, 36);
    117       this.algorithmPanel.Name = "algorithmPanel";
    118       this.algorithmPanel.Size = new System.Drawing.Size(659, 306);
    119       this.algorithmPanel.TabIndex = 3;
    120       this.algorithmPanel.DragOver += new System.Windows.Forms.DragEventHandler(this.algorithmPanel_DragEnterOver);
    121       this.algorithmPanel.DragDrop += new System.Windows.Forms.DragEventHandler(this.algorithmPanel_DragDrop);
    122       this.algorithmPanel.DragEnter += new System.Windows.Forms.DragEventHandler(this.algorithmPanel_DragEnterOver);
    123       //
    124       // algorithmViewHost
    125       //
    126       this.algorithmViewHost.Content = null;
    127       this.algorithmViewHost.Dock = System.Windows.Forms.DockStyle.Fill;
    128       this.algorithmViewHost.Location = new System.Drawing.Point(0, 0);
     114      this.algorithmViewHost.Location = new System.Drawing.Point(6, 36);
    129115      this.algorithmViewHost.Name = "algorithmViewHost";
    130116      this.algorithmViewHost.Size = new System.Drawing.Size(659, 306);
    131       this.algorithmViewHost.TabIndex = 0;
     117      this.algorithmViewHost.TabIndex = 3;
    132118      this.algorithmViewHost.ViewType = null;
     119      this.algorithmViewHost.DragOver += new System.Windows.Forms.DragEventHandler(this.algorithmViewHost_DragEnterOver);
     120      this.algorithmViewHost.DragDrop += new System.Windows.Forms.DragEventHandler(this.algorithmViewHost_DragDrop);
     121      this.algorithmViewHost.DragEnter += new System.Windows.Forms.DragEventHandler(this.algorithmViewHost_DragEnterOver);
    133122      //
    134123      // openAlgorithmButton
     
    317306      this.tabControl.ResumeLayout(false);
    318307      this.algorithmTabPage.ResumeLayout(false);
    319       this.algorithmPanel.ResumeLayout(false);
    320308      this.runsTabPage.ResumeLayout(false);
    321309      ((System.ComponentModel.ISupportInitialize)(this.repetitionsNumericUpDown)).EndInit();
     
    342330    private RunCollectionView runsView;
    343331    private System.Windows.Forms.Button pauseButton;
    344     private System.Windows.Forms.Panel algorithmPanel;
    345 
    346332  }
    347333}
  • trunk/sources/HeuristicLab.Optimization.Views/3.3/BatchRunView.cs

    r3904 r4011  
    140140    }
    141141    private void repetitionsNumericUpDown_ValueChanged(object sender, EventArgs e) {
    142       Content.Repetitions = (int)repetitionsNumericUpDown.Value;
     142      if (Content != null)
     143        Content.Repetitions = (int)repetitionsNumericUpDown.Value;
    143144    }
    144145    private void newAlgorithmButton_Click(object sender, EventArgs e) {
     
    197198      Content.Prepare(false);
    198199    }
    199     private void algorithmPanel_DragEnterOver(object sender, DragEventArgs e) {
     200    private void algorithmViewHost_DragEnterOver(object sender, DragEventArgs e) {
    200201      e.Effect = DragDropEffects.None;
    201202      if (ReadOnly)
     
    210211      }
    211212    }
    212     private void algorithmPanel_DragDrop(object sender, DragEventArgs e) {
     213    private void algorithmViewHost_DragDrop(object sender, DragEventArgs e) {
    213214      if (e.Effect != DragDropEffects.None) {
    214215        IAlgorithm algorithm = e.Data.GetData("Value") as IAlgorithm;
  • trunk/sources/HeuristicLab.Optimization.Views/3.3/EngineAlgorithmView.Designer.cs

    r3764 r4011  
    5858      this.resultsTabPage.SuspendLayout();
    5959      this.runsTabPage.SuspendLayout();
    60       this.problemPanel.SuspendLayout();
    6160      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
    6261      this.engineTabPage.SuspendLayout();
     
    148147      // problemPanel
    149148      //
    150       this.problemPanel.Size = new System.Drawing.Size(693, 399);
     149      this.problemViewHost.Size = new System.Drawing.Size(693, 399);
    151150      //
    152151      // nameTextBox
     
    276275      this.resultsTabPage.ResumeLayout(false);
    277276      this.runsTabPage.ResumeLayout(false);
    278       this.problemPanel.ResumeLayout(false);
    279277      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
    280278      this.engineTabPage.ResumeLayout(false);
  • trunk/sources/HeuristicLab.Optimization.Views/3.3/RunView.cs

    r3904 r4011  
    103103    }
    104104
     105    private string selectedName;
    105106    private void FillListView() {
    106       string selectedName = null;
    107107      if (listView.SelectedItems.Count == 1) selectedName = listView.SelectedItems[0].SubItems[0].Text;
    108108
     
    117117          for (int i = 0; i < listView.Columns.Count; i++)
    118118            listView.Columns[i].AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent);
     119          selectedName = null;
    119120        }
    120121      }
  • trunk/sources/HeuristicLab.Optimization.Views/3.3/UserDefinedAlgorithmView.Designer.cs

    r3770 r4011  
    5454      this.resultsTabPage.SuspendLayout();
    5555      this.runsTabPage.SuspendLayout();
    56       this.problemPanel.SuspendLayout();
    5756      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
    5857      this.globalScopeTabPage.SuspendLayout();
     
    152151      this.resultsTabPage.ResumeLayout(false);
    153152      this.runsTabPage.ResumeLayout(false);
    154       this.problemPanel.ResumeLayout(false);
    155153      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
    156154      this.globalScopeTabPage.ResumeLayout(false);
  • trunk/sources/HeuristicLab.Parameters.Views/3.3/ValueLookupParameterView.Designer.cs

    r3306 r4011  
    4747    private void InitializeComponent() {
    4848      this.valueGroupBox = new System.Windows.Forms.GroupBox();
    49       this.valuePanel = new System.Windows.Forms.Panel();
    50       this.viewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
     49      this.valueViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
    5150      this.clearValueButton = new System.Windows.Forms.Button();
    5251      this.setValueButton = new System.Windows.Forms.Button();
     
    5554      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
    5655      this.valueGroupBox.SuspendLayout();
    57       this.valuePanel.SuspendLayout();
    5856      this.SuspendLayout();
    5957      //
     
    9290                  | System.Windows.Forms.AnchorStyles.Left)
    9391                  | System.Windows.Forms.AnchorStyles.Right)));
    94       this.valueGroupBox.Controls.Add(this.valuePanel);
     92      this.valueGroupBox.Controls.Add(this.valueViewHost);
    9593      this.valueGroupBox.Controls.Add(this.clearValueButton);
    9694      this.valueGroupBox.Controls.Add(this.setValueButton);
     
    102100      this.valueGroupBox.Text = "Value";
    103101      //
    104       // valuePanel
     102      // viewHost
    105103      //
    106       this.valuePanel.AllowDrop = true;
    107       this.valuePanel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     104      this.valueViewHost.AllowDrop = true;
     105      this.valueViewHost.Content = null;
     106      this.valueViewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    108107                  | System.Windows.Forms.AnchorStyles.Left)
    109108                  | System.Windows.Forms.AnchorStyles.Right)));
    110       this.valuePanel.Controls.Add(this.viewHost);
    111       this.valuePanel.Location = new System.Drawing.Point(6, 49);
    112       this.valuePanel.Name = "valuePanel";
    113       this.valuePanel.Size = new System.Drawing.Size(374, 156);
    114       this.valuePanel.TabIndex = 0;
    115       this.valuePanel.DragOver += new System.Windows.Forms.DragEventHandler(this.valuePanel_DragEnterOver);
    116       this.valuePanel.DragDrop += new System.Windows.Forms.DragEventHandler(this.valuePanel_DragDrop);
    117       this.valuePanel.DragEnter += new System.Windows.Forms.DragEventHandler(this.valuePanel_DragEnterOver);
    118       //
    119       // viewHost
    120       //
    121       this.viewHost.Content = null;
    122       this.viewHost.Dock = System.Windows.Forms.DockStyle.Fill;
    123       this.viewHost.Location = new System.Drawing.Point(0, 0);
    124       this.viewHost.Name = "viewHost";
    125       this.viewHost.Size = new System.Drawing.Size(374, 156);
    126       this.viewHost.TabIndex = 0;
    127       this.viewHost.ViewType = null;
     109      this.valueViewHost.Location = new System.Drawing.Point(6, 49);
     110      this.valueViewHost.Name = "valueViewHost";
     111      this.valueViewHost.Size = new System.Drawing.Size(374, 156);
     112      this.valueViewHost.TabIndex = 0;
     113      this.valueViewHost.ViewType = null;
     114      this.valueViewHost.DragOver += new System.Windows.Forms.DragEventHandler(this.valueViewHostPanel_DragEnterOver);
     115      this.valueViewHost.DragDrop += new System.Windows.Forms.DragEventHandler(this.valueViewHost_DragDrop);
     116      this.valueViewHost.DragEnter += new System.Windows.Forms.DragEventHandler(this.valueViewHostPanel_DragEnterOver);
    128117      //
    129118      // clearValueButton
     
    189178      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
    190179      this.valueGroupBox.ResumeLayout(false);
    191       this.valuePanel.ResumeLayout(false);
    192180      this.ResumeLayout(false);
    193181      this.PerformLayout();
     
    198186
    199187    protected System.Windows.Forms.GroupBox valueGroupBox;
    200     protected System.Windows.Forms.Panel valuePanel;
    201     protected HeuristicLab.MainForm.WindowsForms.ViewHost viewHost;
     188    protected HeuristicLab.MainForm.WindowsForms.ViewHost valueViewHost;
    202189    protected System.Windows.Forms.Button setValueButton;
    203190    protected System.Windows.Forms.Button clearValueButton;
  • trunk/sources/HeuristicLab.Parameters.Views/3.3/ValueLookupParameterView.cs

    r3904 r4011  
    7979      if (Content == null) {
    8080        actualNameTextBox.Text = "-";
    81         viewHost.Content = null;
     81        valueViewHost.Content = null;
    8282      } else {
    8383        actualNameTextBox.Text = Content.ActualName;
    84         viewHost.ViewType = null;
    85         viewHost.Content = Content.Value;
     84        valueViewHost.ViewType = null;
     85        valueViewHost.Content = Content.Value;
    8686      }
    8787    }
     
    107107      else {
    108108        clearValueButton.Enabled = Content.Value != null && !ReadOnly;
    109         viewHost.ViewType = null;
    110         viewHost.Content = Content.Value;
     109        valueViewHost.ViewType = null;
     110        valueViewHost.Content = Content.Value;
    111111      }
    112112    }
     
    133133      Content.Value = null;
    134134    }
    135     protected virtual void valuePanel_DragEnterOver(object sender, DragEventArgs e) {
     135    protected virtual void valueViewHostPanel_DragEnterOver(object sender, DragEventArgs e) {
    136136      e.Effect = DragDropEffects.None;
    137137      Type type = e.Data.GetData("Type") as Type;
     
    144144      }
    145145    }
    146     protected virtual void valuePanel_DragDrop(object sender, DragEventArgs e) {
     146    protected virtual void valueViewHost_DragDrop(object sender, DragEventArgs e) {
    147147      if (e.Effect != DragDropEffects.None) {
    148148        T value = e.Data.GetData("Value") as T;
  • trunk/sources/HeuristicLab.Parameters.Views/3.3/ValueParameterView.Designer.cs

    r3306 r4011  
    4747    private void InitializeComponent() {
    4848      this.valueGroupBox = new System.Windows.Forms.GroupBox();
    49       this.valuePanel = new System.Windows.Forms.Panel();
    50       this.viewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
     49      this.valueViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
    5150      this.clearValueButton = new System.Windows.Forms.Button();
    5251      this.setValueButton = new System.Windows.Forms.Button();
    5352      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
    5453      this.valueGroupBox.SuspendLayout();
    55       this.valuePanel.SuspendLayout();
    5654      this.SuspendLayout();
    5755      //
     
    7876                  | System.Windows.Forms.AnchorStyles.Left)
    7977                  | System.Windows.Forms.AnchorStyles.Right)));
    80       this.valueGroupBox.Controls.Add(this.valuePanel);
     78      this.valueGroupBox.Controls.Add(this.valueViewHost);
    8179      this.valueGroupBox.Controls.Add(this.clearValueButton);
    8280      this.valueGroupBox.Controls.Add(this.setValueButton);
     
    8886      this.valueGroupBox.Text = "Value";
    8987      //
    90       // valuePanel
     88      // viewHost
    9189      //
    92       this.valuePanel.AllowDrop = true;
    93       this.valuePanel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     90      this.valueViewHost.AllowDrop = true;
     91      this.valueViewHost.Content = null;
     92      this.valueViewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    9493                  | System.Windows.Forms.AnchorStyles.Left)
    9594                  | System.Windows.Forms.AnchorStyles.Right)));
    96       this.valuePanel.Controls.Add(this.viewHost);
    97       this.valuePanel.Location = new System.Drawing.Point(6, 49);
    98       this.valuePanel.Name = "valuePanel";
    99       this.valuePanel.Size = new System.Drawing.Size(374, 182);
    100       this.valuePanel.TabIndex = 0;
    101       this.valuePanel.DragOver += new System.Windows.Forms.DragEventHandler(this.valuePanel_DragEnterOver);
    102       this.valuePanel.DragDrop += new System.Windows.Forms.DragEventHandler(this.valuePanel_DragDrop);
    103       this.valuePanel.DragEnter += new System.Windows.Forms.DragEventHandler(this.valuePanel_DragEnterOver);
    104       //
    105       // viewHost
    106       //
    107       this.viewHost.Content = null;
    108       this.viewHost.Dock = System.Windows.Forms.DockStyle.Fill;
    109       this.viewHost.Location = new System.Drawing.Point(0, 0);
    110       this.viewHost.Name = "viewHost";
    111       this.viewHost.Size = new System.Drawing.Size(374, 182);
    112       this.viewHost.TabIndex = 0;
    113       this.viewHost.ViewType = null;
     95      this.valueViewHost.Location = new System.Drawing.Point(6, 49);
     96      this.valueViewHost.Name = "viewHost";
     97      this.valueViewHost.Size = new System.Drawing.Size(374, 182);
     98      this.valueViewHost.TabIndex = 0;
     99      this.valueViewHost.ViewType = null;
     100      this.valueViewHost.DragOver += new System.Windows.Forms.DragEventHandler(this.valueViewHost_DragEnterOver);
     101      this.valueViewHost.DragDrop += new System.Windows.Forms.DragEventHandler(this.valueViewHost_DragDrop);
     102      this.valueViewHost.DragEnter += new System.Windows.Forms.DragEventHandler(this.valueViewHost_DragEnterOver);
    114103      //
    115104      // clearValueButton
     
    152141      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
    153142      this.valueGroupBox.ResumeLayout(false);
    154       this.valuePanel.ResumeLayout(false);
    155143      this.ResumeLayout(false);
    156144      this.PerformLayout();
     
    161149
    162150    protected System.Windows.Forms.GroupBox valueGroupBox;
    163     protected System.Windows.Forms.Panel valuePanel;
    164     protected HeuristicLab.MainForm.WindowsForms.ViewHost viewHost;
     151    protected HeuristicLab.MainForm.WindowsForms.ViewHost valueViewHost;
    165152    protected System.Windows.Forms.Button setValueButton;
    166153    protected System.Windows.Forms.Button clearValueButton;
  • trunk/sources/HeuristicLab.Parameters.Views/3.3/ValueParameterView.cs

    r3904 r4011  
    7878      if (Content == null) {
    7979        clearValueButton.Visible = true;
    80         viewHost.Content = null;
     80        valueViewHost.Content = null;
    8181      } else {
    8282        clearValueButton.Visible = !(Content is ValueParameter<T>);
    83         viewHost.ViewType = null;
    84         viewHost.Content = Content.Value;
     83        valueViewHost.ViewType = null;
     84        valueViewHost.Content = Content.Value;
    8585      }
    8686    }
     
    9898      else {
    9999        clearValueButton.Enabled = Content.Value != null && !ReadOnly;
    100         viewHost.ViewType = null;
    101         viewHost.Content = Content.Value;
     100        valueViewHost.ViewType = null;
     101        valueViewHost.Content = Content.Value;
    102102      }
    103103    }
     
    121121      Content.Value = null;
    122122    }
    123     protected virtual void valuePanel_DragEnterOver(object sender, DragEventArgs e) {
     123    protected virtual void valueViewHost_DragEnterOver(object sender, DragEventArgs e) {
    124124      e.Effect = DragDropEffects.None;
    125125      Type type = e.Data.GetData("Type") as Type;
     
    132132      }
    133133    }
    134     protected virtual void valuePanel_DragDrop(object sender, DragEventArgs e) {
     134    protected virtual void valueViewHost_DragDrop(object sender, DragEventArgs e) {
    135135      if (e.Effect != DragDropEffects.None) {
    136136        T value = e.Data.GetData("Value") as T;
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.3/EstimatedValuesView.cs

    r3933 r4011  
    8989      if (InvokeRequired) Invoke((Action)UpdateEstimatedValues);
    9090      else {
    91         double[,] values =
    92         MatrixExtensions<double>.Create(
    93           Content.ProblemData.Dataset.GetVariableValues(Content.ProblemData.TargetVariable.Value),
    94           Content.EstimatedValues.ToArray());
    95         var content = new DoubleMatrix(values);
    96         content.ColumnNames = new string[] { "Original", "Estimated" };
    97         matrixView.Content = content;
     91        DoubleMatrix matrix = null;
     92        if (Content != null) {
     93          double[,] values =
     94          MatrixExtensions<double>.Create(
     95            Content.ProblemData.Dataset.GetVariableValues(Content.ProblemData.TargetVariable.Value),
     96            Content.EstimatedValues.ToArray());
     97          matrix = new DoubleMatrix(values);
     98          matrix.ColumnNames = new string[] { "Original", "Estimated" };
     99        }
     100        matrixView.Content = matrix;
    98101      }
    99102    }
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.3/LineChartView.cs

    r3933 r4011  
    6161    private void RedrawChart() {
    6262      this.chart.Series.Clear();
    63       this.chart.Series.Add(TARGETVARIABLE_SERIES_NAME);
    64       this.chart.Series[TARGETVARIABLE_SERIES_NAME].LegendText = Content.ProblemData.TargetVariable.Value;
    65       this.chart.Series[TARGETVARIABLE_SERIES_NAME].ChartType = SeriesChartType.FastLine;
    66       this.chart.Series[TARGETVARIABLE_SERIES_NAME].Points.DataBindY(Content.ProblemData.Dataset.GetVariableValues(Content.ProblemData.TargetVariable.Value));
    67       this.UpdateStripLines();
     63      if (Content != null) {
     64        this.chart.Series.Add(TARGETVARIABLE_SERIES_NAME);
     65        this.chart.Series[TARGETVARIABLE_SERIES_NAME].LegendText = Content.ProblemData.TargetVariable.Value;
     66        this.chart.Series[TARGETVARIABLE_SERIES_NAME].ChartType = SeriesChartType.FastLine;
     67        this.chart.Series[TARGETVARIABLE_SERIES_NAME].Points.DataBindY(Content.ProblemData.Dataset.GetVariableValues(Content.ProblemData.TargetVariable.Value));
     68        this.UpdateStripLines();
    6869
    69       this.chart.Series.Add(ESTIMATEDVALUES_SERIES_NAME);
    70       this.chart.Series[ESTIMATEDVALUES_SERIES_NAME].LegendText = Content.ItemName;
    71       this.chart.Series[ESTIMATEDVALUES_SERIES_NAME].ChartType = SeriesChartType.FastLine;
    72       this.chart.Series[ESTIMATEDVALUES_SERIES_NAME].Points.DataBindY(Content.EstimatedValues.ToArray());
    73       this.chart.Series[ESTIMATEDVALUES_SERIES_NAME].Tag = Content;
    74       UpdateCursorInterval();
     70        this.chart.Series.Add(ESTIMATEDVALUES_SERIES_NAME);
     71        this.chart.Series[ESTIMATEDVALUES_SERIES_NAME].LegendText = Content.ItemName;
     72        this.chart.Series[ESTIMATEDVALUES_SERIES_NAME].ChartType = SeriesChartType.FastLine;
     73        this.chart.Series[ESTIMATEDVALUES_SERIES_NAME].Points.DataBindY(Content.EstimatedValues.ToArray());
     74        this.chart.Series[ESTIMATEDVALUES_SERIES_NAME].Tag = Content;
     75        UpdateCursorInterval();
     76      }
    7577    }
    7678
Note: See TracChangeset for help on using the changeset viewer.