Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/01/10 04:46:06 (14 years ago)
Author:
swagner
Message:

Operator architecture refactoring (#95)

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

Legend:

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

    r2852 r2891  
    7474    <Compile Include="ConstrainedValueParameterView.Designer.cs">
    7575      <DependentUpon>ConstrainedValueParameterView.cs</DependentUpon>
     76    </Compile>
     77    <Compile Include="OptionalValueParameterView.cs">
     78      <SubType>UserControl</SubType>
     79    </Compile>
     80    <Compile Include="OptionalValueParameterView.Designer.cs">
     81      <DependentUpon>OptionalValueParameterView.cs</DependentUpon>
    7682    </Compile>
    7783    <Compile Include="ValueLookupParameterView.cs">
  • trunk/sources/HeuristicLab.Parameters.Views/3.3/ValueParameterView.Designer.cs

    r2796 r2891  
    3333    protected override void Dispose(bool disposing) {
    3434      if (disposing) {
    35         if (typeSelectorDialog != null) typeSelectorDialog.Dispose();
    3635        if (components != null) components.Dispose();
    3736      }
     
    4645    /// </summary>
    4746    private void InitializeComponent() {
    48       this.components = new System.ComponentModel.Container();
    4947      this.valueGroupBox = new System.Windows.Forms.GroupBox();
    5048      this.valuePanel = new System.Windows.Forms.Panel();
    5149      this.viewHost = new HeuristicLab.Core.Views.ViewHost();
    52       this.clearValueButton = new System.Windows.Forms.Button();
    53       this.setValueButton = new System.Windows.Forms.Button();
    54       this.toolTip = new System.Windows.Forms.ToolTip(this.components);
    5550      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
    5651      this.valueGroupBox.SuspendLayout();
     
    8176                  | System.Windows.Forms.AnchorStyles.Right)));
    8277      this.valueGroupBox.Controls.Add(this.valuePanel);
    83       this.valueGroupBox.Controls.Add(this.clearValueButton);
    84       this.valueGroupBox.Controls.Add(this.setValueButton);
    8578      this.valueGroupBox.Location = new System.Drawing.Point(0, 120);
    8679      this.valueGroupBox.Name = "valueGroupBox";
     
    9790                  | System.Windows.Forms.AnchorStyles.Right)));
    9891      this.valuePanel.Controls.Add(this.viewHost);
    99       this.valuePanel.Location = new System.Drawing.Point(6, 49);
     92      this.valuePanel.Location = new System.Drawing.Point(6, 19);
    10093      this.valuePanel.Name = "valuePanel";
    101       this.valuePanel.Size = new System.Drawing.Size(374, 140);
     94      this.valuePanel.Size = new System.Drawing.Size(374, 170);
    10295      this.valuePanel.TabIndex = 0;
    10396      this.valuePanel.DragOver += new System.Windows.Forms.DragEventHandler(this.valuePanel_DragEnterOver);
     
    111104      this.viewHost.Location = new System.Drawing.Point(0, 0);
    112105      this.viewHost.Name = "viewHost";
    113       this.viewHost.Size = new System.Drawing.Size(374, 140);
     106      this.viewHost.Size = new System.Drawing.Size(374, 170);
    114107      this.viewHost.TabIndex = 0;
    115       //
    116       // clearValueButton
    117       //
    118       this.clearValueButton.Enabled = false;
    119       this.clearValueButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Remove;
    120       this.clearValueButton.Location = new System.Drawing.Point(36, 19);
    121       this.clearValueButton.Name = "clearValueButton";
    122       this.clearValueButton.Size = new System.Drawing.Size(24, 24);
    123       this.clearValueButton.TabIndex = 1;
    124       this.toolTip.SetToolTip(this.clearValueButton, "Clear Value");
    125       this.clearValueButton.UseVisualStyleBackColor = true;
    126       this.clearValueButton.Click += new System.EventHandler(this.clearValueButton_Click);
    127       //
    128       // setValueButton
    129       //
    130       this.setValueButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Add;
    131       this.setValueButton.Location = new System.Drawing.Point(6, 19);
    132       this.setValueButton.Name = "setValueButton";
    133       this.setValueButton.Size = new System.Drawing.Size(24, 24);
    134       this.setValueButton.TabIndex = 0;
    135       this.toolTip.SetToolTip(this.setValueButton, "Set Value");
    136       this.setValueButton.UseVisualStyleBackColor = true;
    137       this.setValueButton.Click += new System.EventHandler(this.setValueButton_Click);
     108      this.viewHost.ViewType = null;
    138109      //
    139110      // ValueParameterView
     
    164135    protected System.Windows.Forms.Panel valuePanel;
    165136    protected HeuristicLab.Core.Views.ViewHost viewHost;
    166     protected System.Windows.Forms.Button setValueButton;
    167     protected System.Windows.Forms.ToolTip toolTip;
    168     protected System.Windows.Forms.Button clearValueButton;
    169137  }
    170138}
  • trunk/sources/HeuristicLab.Parameters.Views/3.3/ValueParameterView.cs

    r2890 r2891  
    3030  /// The visual representation of a <see cref="Parameter"/>.
    3131  /// </summary>
    32   [Content(typeof(OptionalValueParameter<>), true)]
    33   [Content(typeof(IValueParameter<>), false)]
     32  [Content(typeof(ValueParameter<>), true)]
    3433  public partial class ValueParameterView<T> : ParameterView where T : class, IItem {
    35     protected TypeSelectorDialog typeSelectorDialog;
    36 
    3734    /// <summary>
    3835    /// Gets or sets the variable to represent visually.
     
    4037    /// <remarks>Uses property <see cref="ViewBase.Item"/> of base class <see cref="ViewBase"/>.
    4138    /// No own data storage present.</remarks>
    42     public new IValueParameter<T> Content {
    43       get { return (IValueParameter<T>)base.Content; }
     39    public new ValueParameter<T> Content {
     40      get { return (ValueParameter<T>)base.Content; }
    4441      set { base.Content = value; }
    4542    }
     
    5754    /// <remarks>Calls <see cref="VariableView()"/>.</remarks>
    5855    /// <param name="variable">The variable to represent visually.</param>
    59     public ValueParameterView(IValueParameter<T> content)
     56    public ValueParameterView(ValueParameter<T> content)
    6057      : this() {
    6158      Content = content;
     
    8481      if (Content == null) {
    8582        Caption = "ValueParameter";
    86         setValueButton.Enabled = false;
    87         clearValueButton.Enabled = false;
    8883        viewHost.Content = null;
    8984        valueGroupBox.Enabled = false;
    9085      } else {
    9186        Caption = Content.Name + " (" + Content.GetType().Name + ")";
    92         setValueButton.Enabled = Content.Value == null;
    93         clearValueButton.Enabled = Content.Value != null;
    9487        valueGroupBox.Enabled = true;
    9588        viewHost.Content = Content.Value;
     
    10194        Invoke(new EventHandler(Content_ValueChanged), sender, e);
    10295      else {
    103         setValueButton.Enabled = Content.Value == null;
    104         clearValueButton.Enabled = Content.Value != null;
    10596        viewHost.Content = Content.Value;
    10697      }
    10798    }
    10899
    109     protected virtual void setValueButton_Click(object sender, EventArgs e) {
    110       if (typeSelectorDialog == null) {
    111         typeSelectorDialog = new TypeSelectorDialog();
    112         typeSelectorDialog.Caption = "Select Value";
    113         typeSelectorDialog.TypeSelector.Configure(Content.DataType, false, false);
    114       }
    115       if (typeSelectorDialog.ShowDialog(this) == DialogResult.OK)
    116         Content.Value = (T)typeSelectorDialog.TypeSelector.CreateInstanceOfSelectedType();
    117     }
    118     protected virtual void clearValueButton_Click(object sender, EventArgs e) {
    119       Content.Value = null;
    120     }
    121100    protected virtual void valuePanel_DragEnterOver(object sender, DragEventArgs e) {
    122101      e.Effect = DragDropEffects.None;
Note: See TracChangeset for help on using the changeset viewer.