Free cookie consent management tool by TermsFeed Policy Generator

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

Operator architecture refactoring (#95)

  • worked on parameters and operators
Location:
trunk/sources/HeuristicLab.Parameters.Views/3.3
Files:
4 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Parameters.Views/3.3/HeuristicLab.Parameters.Views-3.3.csproj

    r2714 r2740  
    5151  </ItemGroup>
    5252  <ItemGroup>
     53    <Compile Include="SubScopesItemParameterView.cs">
     54      <SubType>UserControl</SubType>
     55    </Compile>
     56    <Compile Include="SubScopesItemParameterView.Designer.cs">
     57      <DependentUpon>SubScopesItemParameterView.cs</DependentUpon>
     58    </Compile>
     59    <Compile Include="OperatorParameterView.cs">
     60      <SubType>UserControl</SubType>
     61    </Compile>
     62    <Compile Include="OperatorParameterView.Designer.cs">
     63      <DependentUpon>OperatorParameterView.cs</DependentUpon>
     64    </Compile>
    5365    <Compile Include="HeuristicLabParametersViewsPlugin.cs" />
    5466    <Compile Include="ItemParameterView.cs">
  • trunk/sources/HeuristicLab.Parameters.Views/3.3/ItemParameterView.Designer.cs

    r2715 r2740  
    4747    private void InitializeComponent() {
    4848      this.components = new System.ComponentModel.Container();
    49       this.valueGroupBox = new System.Windows.Forms.GroupBox();
    50       this.valuePanel = new System.Windows.Forms.Panel();
     49      this.localValueGroupBox = new System.Windows.Forms.GroupBox();
     50      this.localValuePanel = new System.Windows.Forms.Panel();
    5151      this.viewHost = new HeuristicLab.Core.Views.ViewHost();
    52       this.clearValueButton = new System.Windows.Forms.Button();
    53       this.setValueButton = new System.Windows.Forms.Button();
     52      this.clearLocalValueButton = new System.Windows.Forms.Button();
     53      this.setLocalValueButton = new System.Windows.Forms.Button();
    5454      this.actualNameTextBox = new System.Windows.Forms.TextBox();
    5555      this.actualNameLabel = new System.Windows.Forms.Label();
    5656      this.toolTip = new System.Windows.Forms.ToolTip(this.components);
    5757      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
    58       this.valueGroupBox.SuspendLayout();
    59       this.valuePanel.SuspendLayout();
     58      this.localValueGroupBox.SuspendLayout();
     59      this.localValuePanel.SuspendLayout();
    6060      this.SuspendLayout();
    6161      //
     
    8989      this.descriptionTextBox.TabIndex = 5;
    9090      //
    91       // valueGroupBox
    92       //
    93       this.valueGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     91      // localValueGroupBox
     92      //
     93      this.localValueGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    9494                  | System.Windows.Forms.AnchorStyles.Left)
    9595                  | System.Windows.Forms.AnchorStyles.Right)));
    96       this.valueGroupBox.Controls.Add(this.valuePanel);
    97       this.valueGroupBox.Controls.Add(this.clearValueButton);
    98       this.valueGroupBox.Controls.Add(this.setValueButton);
    99       this.valueGroupBox.Location = new System.Drawing.Point(0, 146);
    100       this.valueGroupBox.Name = "valueGroupBox";
    101       this.valueGroupBox.Size = new System.Drawing.Size(386, 169);
    102       this.valueGroupBox.TabIndex = 10;
    103       this.valueGroupBox.TabStop = false;
    104       this.valueGroupBox.Text = "&Value:";
    105       //
    106       // valuePanel
    107       //
    108       this.valuePanel.AllowDrop = true;
    109       this.valuePanel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     96      this.localValueGroupBox.Controls.Add(this.localValuePanel);
     97      this.localValueGroupBox.Controls.Add(this.clearLocalValueButton);
     98      this.localValueGroupBox.Controls.Add(this.setLocalValueButton);
     99      this.localValueGroupBox.Location = new System.Drawing.Point(0, 146);
     100      this.localValueGroupBox.Name = "localValueGroupBox";
     101      this.localValueGroupBox.Size = new System.Drawing.Size(386, 169);
     102      this.localValueGroupBox.TabIndex = 10;
     103      this.localValueGroupBox.TabStop = false;
     104      this.localValueGroupBox.Text = "Local &Value:";
     105      //
     106      // localValuePanel
     107      //
     108      this.localValuePanel.AllowDrop = true;
     109      this.localValuePanel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    110110                  | System.Windows.Forms.AnchorStyles.Left)
    111111                  | System.Windows.Forms.AnchorStyles.Right)));
    112       this.valuePanel.Controls.Add(this.viewHost);
    113       this.valuePanel.Location = new System.Drawing.Point(6, 48);
    114       this.valuePanel.Name = "valuePanel";
    115       this.valuePanel.Size = new System.Drawing.Size(374, 115);
    116       this.valuePanel.TabIndex = 0;
    117       this.valuePanel.DragOver += new System.Windows.Forms.DragEventHandler(this.valuePanel_DragEnterOver);
    118       this.valuePanel.DragDrop += new System.Windows.Forms.DragEventHandler(this.valuePanel_DragDrop);
    119       this.valuePanel.DragEnter += new System.Windows.Forms.DragEventHandler(this.valuePanel_DragEnterOver);
     112      this.localValuePanel.Controls.Add(this.viewHost);
     113      this.localValuePanel.Location = new System.Drawing.Point(6, 48);
     114      this.localValuePanel.Name = "localValuePanel";
     115      this.localValuePanel.Size = new System.Drawing.Size(374, 115);
     116      this.localValuePanel.TabIndex = 0;
     117      this.localValuePanel.DragOver += new System.Windows.Forms.DragEventHandler(this.localValuePanel_DragEnterOver);
     118      this.localValuePanel.DragDrop += new System.Windows.Forms.DragEventHandler(this.localValuePanel_DragDrop);
     119      this.localValuePanel.DragEnter += new System.Windows.Forms.DragEventHandler(this.localValuePanel_DragEnterOver);
    120120      //
    121121      // viewHost
    122122      //
     123      this.viewHost.Content = null;
    123124      this.viewHost.Dock = System.Windows.Forms.DockStyle.Fill;
    124125      this.viewHost.Location = new System.Drawing.Point(0, 0);
    125126      this.viewHost.Name = "viewHost";
    126       this.viewHost.Content = null;
    127127      this.viewHost.Size = new System.Drawing.Size(374, 115);
    128128      this.viewHost.TabIndex = 0;
    129129      //
    130       // clearValueButton
    131       //
    132       this.clearValueButton.Enabled = false;
    133       this.clearValueButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Remove;
    134       this.clearValueButton.Location = new System.Drawing.Point(35, 19);
    135       this.clearValueButton.Name = "clearValueButton";
    136       this.clearValueButton.Size = new System.Drawing.Size(23, 23);
    137       this.clearValueButton.TabIndex = 9;
    138       this.toolTip.SetToolTip(this.clearValueButton, "Clear Value");
    139       this.clearValueButton.UseVisualStyleBackColor = true;
    140       this.clearValueButton.Click += new System.EventHandler(this.clearValueButton_Click);
    141       //
    142       // setValueButton
    143       //
    144       this.setValueButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Add;
    145       this.setValueButton.Location = new System.Drawing.Point(6, 19);
    146       this.setValueButton.Name = "setValueButton";
    147       this.setValueButton.Size = new System.Drawing.Size(23, 23);
    148       this.setValueButton.TabIndex = 8;
    149       this.toolTip.SetToolTip(this.setValueButton, "Set Value");
    150       this.setValueButton.UseVisualStyleBackColor = true;
    151       this.setValueButton.Click += new System.EventHandler(this.setValueButton_Click);
     130      // clearLocalValueButton
     131      //
     132      this.clearLocalValueButton.Enabled = false;
     133      this.clearLocalValueButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Remove;
     134      this.clearLocalValueButton.Location = new System.Drawing.Point(35, 19);
     135      this.clearLocalValueButton.Name = "clearLocalValueButton";
     136      this.clearLocalValueButton.Size = new System.Drawing.Size(23, 23);
     137      this.clearLocalValueButton.TabIndex = 9;
     138      this.toolTip.SetToolTip(this.clearLocalValueButton, "Clear Value");
     139      this.clearLocalValueButton.UseVisualStyleBackColor = true;
     140      this.clearLocalValueButton.Click += new System.EventHandler(this.clearLocalValueButton_Click);
     141      //
     142      // setLocalValueButton
     143      //
     144      this.setLocalValueButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Add;
     145      this.setLocalValueButton.Location = new System.Drawing.Point(6, 19);
     146      this.setLocalValueButton.Name = "setLocalValueButton";
     147      this.setLocalValueButton.Size = new System.Drawing.Size(23, 23);
     148      this.setLocalValueButton.TabIndex = 8;
     149      this.toolTip.SetToolTip(this.setLocalValueButton, "Set Value");
     150      this.setLocalValueButton.UseVisualStyleBackColor = true;
     151      this.setLocalValueButton.Click += new System.EventHandler(this.setLocalValueButton_Click);
    152152      //
    153153      // actualNameTextBox
     
    174174      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    175175      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    176       this.Controls.Add(this.valueGroupBox);
     176      this.Controls.Add(this.localValueGroupBox);
    177177      this.Controls.Add(this.actualNameTextBox);
    178178      this.Controls.Add(this.actualNameLabel);
     
    187187      this.Controls.SetChildIndex(this.actualNameTextBox, 0);
    188188      this.Controls.SetChildIndex(this.nameLabel, 0);
    189       this.Controls.SetChildIndex(this.valueGroupBox, 0);
     189      this.Controls.SetChildIndex(this.localValueGroupBox, 0);
    190190      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
    191       this.valueGroupBox.ResumeLayout(false);
    192       this.valuePanel.ResumeLayout(false);
     191      this.localValueGroupBox.ResumeLayout(false);
     192      this.localValuePanel.ResumeLayout(false);
    193193      this.ResumeLayout(false);
    194194      this.PerformLayout();
     
    198198    #endregion
    199199
    200     protected System.Windows.Forms.GroupBox valueGroupBox;
     200    protected System.Windows.Forms.GroupBox localValueGroupBox;
    201201    protected System.Windows.Forms.TextBox actualNameTextBox;
    202202    protected System.Windows.Forms.Label actualNameLabel;
    203     protected System.Windows.Forms.Panel valuePanel;
     203    protected System.Windows.Forms.Panel localValuePanel;
    204204    protected HeuristicLab.Core.Views.ViewHost viewHost;
    205     protected System.Windows.Forms.Button setValueButton;
     205    protected System.Windows.Forms.Button setLocalValueButton;
    206206    protected System.Windows.Forms.ToolTip toolTip;
    207     protected System.Windows.Forms.Button clearValueButton;
     207    protected System.Windows.Forms.Button clearLocalValueButton;
    208208  }
    209209}
  • trunk/sources/HeuristicLab.Parameters.Views/3.3/ItemParameterView.cs

    r2727 r2740  
    5454    public ItemParameterView() {
    5555      InitializeComponent();
    56       Caption = "Parameter";
     56      Caption = "ItemParameter";
    5757    }
    5858    /// <summary>
     
    7272    protected override void DeregisterContentEvents() {
    7373      Content.ActualNameChanged -= new EventHandler(Content_ActualNameChanged);
    74       Content.ValueChanged -= new EventHandler(Content_ValueChanged);
     74      Content.LocalValueChanged -= new EventHandler(Content_LocalValueChanged);
    7575      base.DeregisterContentEvents();
    7676    }
     
    8383      base.RegisterContentEvents();
    8484      Content.ActualNameChanged += new EventHandler(Content_ActualNameChanged);
    85       Content.ValueChanged += new EventHandler(Content_ValueChanged);
     85      Content.LocalValueChanged += new EventHandler(Content_LocalValueChanged);
    8686    }
    8787
     
    8989      base.OnContentChanged();
    9090      if (Content == null) {
    91         Caption = "Parameter";
     91        Caption = "ItemParameter";
    9292        actualNameTextBox.Text = "-";
    9393        actualNameTextBox.Enabled = false;
    94         setValueButton.Enabled = false;
    95         clearValueButton.Enabled = false;
    96         valueGroupBox.Enabled = false;
     94        setLocalValueButton.Enabled = false;
     95        clearLocalValueButton.Enabled = false;
     96        localValueGroupBox.Enabled = false;
    9797        viewHost.Content = null;
    9898      } else {
    9999        Caption = Content.Name + " (" + Content.GetType().Name + ")";
    100100        actualNameTextBox.Text = Content.ActualName;
    101         actualNameTextBox.Enabled = Content.Value == null;
    102         setValueButton.Enabled = Content.Value == null;
    103         clearValueButton.Enabled = Content.Value != null;
    104         valueGroupBox.Enabled = true;
    105         viewHost.Content = Content.Value;
     101        actualNameTextBox.Enabled = Content.LocalValue == null;
     102        setLocalValueButton.Enabled = Content.LocalValue == null;
     103        clearLocalValueButton.Enabled = Content.LocalValue != null;
     104        localValueGroupBox.Enabled = true;
     105        viewHost.Content = Content.LocalValue;
    106106      }
    107107    }
     
    113113        actualNameTextBox.Text = Content.ActualName;
    114114    }
    115     protected virtual void Content_ValueChanged(object sender, EventArgs e) {
     115    protected virtual void Content_LocalValueChanged(object sender, EventArgs e) {
    116116      if (InvokeRequired)
    117         Invoke(new EventHandler(Content_ValueChanged), sender, e);
     117        Invoke(new EventHandler(Content_LocalValueChanged), sender, e);
    118118      else {
    119         actualNameTextBox.Enabled = Content.Value == null;
    120         setValueButton.Enabled = Content.Value == null;
    121         clearValueButton.Enabled = Content.Value != null;
    122         viewHost.Content = Content.Value;
     119        actualNameTextBox.Enabled = Content.LocalValue == null;
     120        setLocalValueButton.Enabled = Content.LocalValue == null;
     121        clearLocalValueButton.Enabled = Content.LocalValue != null;
     122        viewHost.Content = Content.LocalValue;
    123123      }
    124124    }
     
    127127      Content.ActualName = actualNameTextBox.Text;
    128128    }
    129     protected virtual void setValueButton_Click(object sender, EventArgs e) {
     129    protected virtual void setLocalValueButton_Click(object sender, EventArgs e) {
    130130      if (typeSelectorDialog == null) {
    131131        typeSelectorDialog = new TypeSelectorDialog();
    132         typeSelectorDialog.Caption = "Select Value Type";
     132        typeSelectorDialog.Caption = "Select Local Value Type";
    133133      }
    134134      typeSelectorDialog.TypeSelector.Configure(Content.DataType, false, false);
    135135      if (typeSelectorDialog.ShowDialog(this) == DialogResult.OK)
    136         Content.Value = (T)typeSelectorDialog.TypeSelector.CreateInstanceOfSelectedType();
     136        Content.LocalValue = (T)typeSelectorDialog.TypeSelector.CreateInstanceOfSelectedType();
    137137    }
    138     protected virtual void clearValueButton_Click(object sender, EventArgs e) {
    139       Content.Value = null;
     138    protected virtual void clearLocalValueButton_Click(object sender, EventArgs e) {
     139      Content.LocalValue = null;
    140140    }
    141     protected virtual void valuePanel_DragEnterOver(object sender, DragEventArgs e) {
     141    protected virtual void localValuePanel_DragEnterOver(object sender, DragEventArgs e) {
    142142      e.Effect = DragDropEffects.None;
    143143      Type type = e.Data.GetData("Type") as Type;
     
    150150      }
    151151    }
    152     protected virtual void valuePanel_DragDrop(object sender, DragEventArgs e) {
     152    protected virtual void localValuePanel_DragDrop(object sender, DragEventArgs e) {
    153153      if (e.Effect != DragDropEffects.None) {
    154154        T item = e.Data.GetData("Value") as T;
    155155        if ((e.Effect & DragDropEffects.Copy) == DragDropEffects.Copy) item = (T)item.Clone();
    156         Content.Value = item;
     156        Content.LocalValue = item;
    157157      }
    158158    }
Note: See TracChangeset for help on using the changeset viewer.