Free cookie consent management tool by TermsFeed Policy Generator

Changeset 2949


Ignore:
Timestamp:
03/06/10 04:48:03 (15 years ago)
Author:
swagner
Message:

Operator architecture refactoring (#95)

  • implemented reviewers' comments on version r2917.
Location:
trunk/sources
Files:
20 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Core.Views/3.3/ItemArrayView.cs

    r2932 r2949  
    162162        T item = itemsListView.SelectedItems[0].Tag as T;
    163163        detailsGroupBox.Enabled = true;
     164        viewHost.ViewType = null;
    164165        viewHost.Content = item;
    165166      } else {
  • trunk/sources/HeuristicLab.Core.Views/3.3/ItemCollectionView.cs

    r2932 r2949  
    137137        T item = (T)itemsListView.SelectedItems[0].Tag;
    138138        detailsGroupBox.Enabled = true;
     139        viewHost.ViewType = null;
    139140        viewHost.Content = item;
    140141      } else {
  • trunk/sources/HeuristicLab.Core.Views/3.3/ItemListView.cs

    r2932 r2949  
    164164        T item = (T)itemsListView.SelectedItems[0].Tag;
    165165        detailsGroupBox.Enabled = true;
     166        viewHost.ViewType = null;
    166167        viewHost.Content = item;
    167168      } else {
  • trunk/sources/HeuristicLab.Core.Views/3.3/OperatorGraphView.Designer.cs

    r2947 r2949  
    131131      this.operatorTreeView.Size = new System.Drawing.Size(590, 183);
    132132      this.operatorTreeView.TabIndex = 0;
     133      this.operatorTreeView.SelectedOperatorChanged += new System.EventHandler(this.operatorTreeView_SelectedOperatorChanged);
    133134      //
    134135      // OperatorGraphView
  • trunk/sources/HeuristicLab.Core.Views/3.3/OperatorGraphView.cs

    r2947 r2949  
    110110    }
    111111
     112    #region Operator Tree View Events
     113    protected virtual void operatorTreeView_SelectedOperatorChanged(object sender, EventArgs e) {
     114      foreach (ListViewItem item in operatorsView.ItemsListView.Items)
     115        item.Selected = item.Tag == operatorTreeView.SelectedOperator;
     116    }
     117    #endregion
     118
    112119    #region Context Menu Events
    113120    protected virtual void operatorsView_Load(object sender, EventArgs e) {
  • trunk/sources/HeuristicLab.Core.Views/3.3/OperatorTreeView.Designer.cs

    r2790 r2949  
    8080      this.graphTreeView.BeforeExpand += new System.Windows.Forms.TreeViewCancelEventHandler(this.graphTreeView_BeforeExpand);
    8181      this.graphTreeView.DragDrop += new System.Windows.Forms.DragEventHandler(this.graphTreeView_DragDrop);
     82      this.graphTreeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.graphTreeView_AfterSelect);
    8283      this.graphTreeView.MouseDown += new System.Windows.Forms.MouseEventHandler(this.graphTreeView_MouseDown);
    8384      this.graphTreeView.DragEnter += new System.Windows.Forms.DragEventHandler(this.graphTreeView_DragEnterOver);
  • trunk/sources/HeuristicLab.Core.Views/3.3/OperatorTreeView.cs

    r2917 r2949  
    4949    }
    5050
     51    private IOperator selectedOperator;
     52    public IOperator SelectedOperator {
     53      get { return selectedOperator; }
     54      private set {
     55        if (value != selectedOperator) {
     56          selectedOperator = value;
     57          OnSelectedOperatorChanged();
     58        }
     59      }
     60    }
     61
    5162    /// <summary>
    5263    /// Initializes a new instance of <see cref="OperatorGraphView"/> with caption "Operator Graph".
     
    90101    }
    91102
     103    public event EventHandler SelectedOperatorChanged;
     104    private void OnSelectedOperatorChanged() {
     105      if (SelectedOperatorChanged != null)
     106        SelectedOperatorChanged(this, EventArgs.Empty);
     107    }
     108
    92109    #region TreeNode Management
    93110    private TreeNode CreateTreeNode(IValueParameter<IOperator> opParam) {
     
    299316        if (opParam != null) opParam.Value = null;
    300317      }
     318    }
     319    private void graphTreeView_AfterSelect(object sender, TreeViewEventArgs e) {
     320      SelectedOperator = graphTreeView.SelectedNode == null ? null : GetOperatorTag(graphTreeView.SelectedNode);
    301321    }
    302322    private void graphContextMenuStrip_Opening(object sender, CancelEventArgs e) {
  • trunk/sources/HeuristicLab.Core.Views/3.3/VariableView.cs

    r2948 r2949  
    9797        clearValueButton.Enabled = Content.Value != null;
    9898        valueGroupBox.Enabled = true;
     99        viewHost.ViewType = null;
    99100        viewHost.Content = Content.Value;
    100101      }
     
    108109        dataTypeTextBox.Enabled = Content.Value != null;
    109110        clearValueButton.Enabled = Content.Value != null;
     111        viewHost.ViewType = null;
    110112        viewHost.Content = Content.Value;
    111113      }
  • trunk/sources/HeuristicLab.Operators.Views.GraphVisualization/3.3/OperatorGraphView.cs

    r2934 r2949  
    8686          IOperatorShapeInfo shapeInfo = shape.Tag as IOperatorShapeInfo;
    8787          IOperator op = this.VisualizationInfo.GetOperatorForShapeInfo(shapeInfo);
     88          this.detailsViewHost.ViewType = null;
    8889          this.detailsViewHost.Content = op;
    8990          return;
     
    103104          if (connectorName != "Predecessor") {
    104105            IParameter parameter = op.Parameters.Where(p => p.Name == connectorName).First();
     106            this.detailsViewHost.ViewType = null;
    105107            this.detailsViewHost.Content = parameter;
    106108            return;
  • trunk/sources/HeuristicLab.Operators.Views/3.3/AlgorithmOperatorView.Designer.cs

    r2917 r2949  
    136136      this.breakpointCheckBox.UseVisualStyleBackColor = true;
    137137      this.breakpointCheckBox.CheckedChanged += new System.EventHandler(this.breakpointCheckBox_CheckedChanged);
     138      this.toolTip.SetToolTip(this.breakpointCheckBox, "Check if an engine should stop execution each time after this operator has been processed.");
    138139      //
    139140      // breakpointLabel
  • trunk/sources/HeuristicLab.Operators.Views/3.3/AlgorithmOperatorView.cs

    r2917 r2949  
    8282        breakpointCheckBox.Enabled = true;
    8383        parameterCollectionView.Content = ((IOperator)Content).Parameters;
     84        operatorGraphViewHost.ViewType = null;
    8485        operatorGraphViewHost.Content = Content.OperatorGraph;
    8586        tabControl.Enabled = true;
  • trunk/sources/HeuristicLab.Operators.Views/3.3/MultipleCallsOperatorView.Designer.cs

    r2917 r2949  
    136136      this.breakpointCheckBox.UseVisualStyleBackColor = true;
    137137      this.breakpointCheckBox.CheckedChanged += new System.EventHandler(this.breakpointCheckBox_CheckedChanged);
     138      this.toolTip.SetToolTip(this.breakpointCheckBox, "Check if an engine should stop execution each time after this operator has been processed.");
    138139      //
    139140      // breakpointLabel
  • trunk/sources/HeuristicLab.Operators.Views/3.3/OperatorView.Designer.cs

    r2917 r2949  
    7979      this.breakpointCheckBox.UseVisualStyleBackColor = true;
    8080      this.breakpointCheckBox.CheckedChanged += new System.EventHandler(this.breakpointCheckBox_CheckedChanged);
     81      this.toolTip.SetToolTip(this.breakpointCheckBox, "Check if an engine should stop execution each time after this operator has been processed.");
    8182      //
    8283      // OperatorView
  • trunk/sources/HeuristicLab.Operators.Views/3.3/ValuesCollectorView.Designer.cs

    r2917 r2949  
    136136      this.breakpointCheckBox.UseVisualStyleBackColor = true;
    137137      this.breakpointCheckBox.CheckedChanged += new System.EventHandler(this.breakpointCheckBox_CheckedChanged);
     138      this.toolTip.SetToolTip(this.breakpointCheckBox, "Check if an engine should stop execution each time after this operator has been processed.");
    138139      //
    139140      // breakpointLabel
  • trunk/sources/HeuristicLab.Optimization.Views/3.3/AlgorithmView.cs

    r2917 r2949  
    106106        parameterCollectionView.Content = Content.Parameters;
    107107        saveProblemButton.Enabled = Content.Problem != null;
     108        problemViewHost.ViewType = null;
    108109        problemViewHost.Content = Content.Problem;
    109110        resultsView.Content = Content.Results;
     
    136137        Invoke(new EventHandler(Content_ProblemChanged), sender, e);
    137138      else {
     139        problemViewHost.ViewType = null;
    138140        problemViewHost.Content = Content.Problem;
    139141        saveProblemButton.Enabled = Content.Problem != null;
  • trunk/sources/HeuristicLab.Optimization.Views/3.3/EngineAlgorithmView.cs

    r2933 r2949  
    9797          engineComboBox.SelectedIndex = engineTypes.IndexOf(Content.Engine.GetType());
    9898        engineViewHost.Enabled = true;
     99        engineViewHost.ViewType = null;
    99100        engineViewHost.Content = Content.Engine;
    100101      }
     
    109110        else
    110111          engineComboBox.SelectedIndex = engineTypes.IndexOf(Content.Engine.GetType());
     112        engineViewHost.ViewType = null;
    111113        engineViewHost.Content = Content.Engine;
    112114      }
  • trunk/sources/HeuristicLab.Optimization.Views/3.3/UserDefinedAlgorithmView.cs

    r2917 r2949  
    6969        globalScopeView.Content = null;
    7070      } else {
     71        operatorGraphViewHost.ViewType = null;
    7172        operatorGraphViewHost.Content = Content.OperatorGraph;
    7273        globalScopeView.Content = Content.GlobalScope;
     
    7778      if (InvokeRequired)
    7879        Invoke(new EventHandler(Content_OperatorGraphChanged), sender, e);
    79       else
     80      else {
     81        operatorGraphViewHost.ViewType = null;
    8082        operatorGraphViewHost.Content = Content.OperatorGraph;
     83      }
    8184    }
    8285
  • trunk/sources/HeuristicLab.Parameters.Views/3.3/ConstrainedValueParameterView.cs

    r2948 r2949  
    100100        valueGroupBox.Enabled = true;
    101101        FillValueComboBox();
     102        viewHost.ViewType = null;
    102103        viewHost.Content = Content.Value;
    103104      }
     
    129130      else {
    130131        valueComboBox.SelectedIndex = valueComboBoxItems.IndexOf(Content.Value);
     132        viewHost.ViewType = null;
    131133        viewHost.Content = Content.Value;
    132134      }
  • trunk/sources/HeuristicLab.Parameters.Views/3.3/ValueLookupParameterView.cs

    r2948 r2949  
    100100        clearValueButton.Enabled = Content.Value != null;
    101101        valueGroupBox.Enabled = true;
     102        viewHost.ViewType = null;
    102103        viewHost.Content = Content.Value;
    103104      }
     
    115116      else {
    116117        clearValueButton.Enabled = Content.Value != null;
     118        viewHost.ViewType = null;
    117119        viewHost.Content = Content.Value;
    118120      }
  • trunk/sources/HeuristicLab.Parameters.Views/3.3/ValueParameterView.cs

    r2948 r2949  
    9797        clearValueButton.Enabled = Content.Value != null;
    9898        valueGroupBox.Enabled = true;
     99        viewHost.ViewType = null;
    99100        viewHost.Content = Content.Value;
    100101      }
     
    106107      else {
    107108        clearValueButton.Enabled = Content.Value != null;
     109        viewHost.ViewType = null;
    108110        viewHost.Content = Content.Value;
    109111      }
Note: See TracChangeset for help on using the changeset viewer.