Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/19/20 19:07:40 (4 years ago)
Author:
fbaching
Message:

#1837: merged changes from trunk

  • apply changes from Attic release to all SlidingWindow specific code files (replace StorableClass with StorableType)
Location:
branches/1837_Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/1837_Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views

  • branches/1837_Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/TreeEditDialogs/SymbolicExpressionTreeConstantNodeEditDialog.Designer.cs

    r9708 r17687  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    6767      // oldValueTextBox
    6868      //
    69       this.oldValueTextBox.Location = new System.Drawing.Point(123, 6);
     69      this.oldValueTextBox.Location = new System.Drawing.Point(106, 6);
    7070      this.oldValueTextBox.Name = "oldValueTextBox";
    7171      this.oldValueTextBox.ReadOnly = true;
     
    7575      // newValueTextBox
    7676      //
    77       this.newValueTextBox.Location = new System.Drawing.Point(123, 42);
     77      this.newValueTextBox.Location = new System.Drawing.Point(106, 32);
    7878      this.newValueTextBox.Name = "newValueTextBox";
    7979      this.newValueTextBox.Size = new System.Drawing.Size(131, 20);
     
    8686      //
    8787      this.newValueLabel.AutoSize = true;
    88       this.newValueLabel.Location = new System.Drawing.Point(12, 45);
     88      this.newValueLabel.Location = new System.Drawing.Point(12, 35);
    8989      this.newValueLabel.Name = "newValueLabel";
    9090      this.newValueLabel.Size = new System.Drawing.Size(59, 13);
     
    101101      //
    102102      this.okButton.DialogResult = System.Windows.Forms.DialogResult.OK;
    103       this.okButton.Location = new System.Drawing.Point(15, 79);
     103      this.okButton.Location = new System.Drawing.Point(81, 66);
    104104      this.okButton.Name = "okButton";
    105105      this.okButton.Size = new System.Drawing.Size(75, 23);
     
    113113      this.cancelButton.CausesValidation = false;
    114114      this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
    115       this.cancelButton.Location = new System.Drawing.Point(179, 79);
     115      this.cancelButton.Location = new System.Drawing.Point(162, 66);
    116116      this.cancelButton.Name = "cancelButton";
    117117      this.cancelButton.Size = new System.Drawing.Size(75, 23);
     
    127127      this.AutoSize = true;
    128128      this.CancelButton = this.cancelButton;
    129       this.ClientSize = new System.Drawing.Size(269, 116);
     129      this.ClientSize = new System.Drawing.Size(248, 101);
    130130      this.ControlBox = false;
    131131      this.Controls.Add(this.cancelButton);
  • branches/1837_Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/TreeEditDialogs/SymbolicExpressionTreeConstantNodeEditDialog.cs

    r9708 r17687  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/1837_Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/TreeEditDialogs/SymbolicExpressionTreeNodeInsertDialog.Designer.cs

    r9708 r17687  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    5757      this.okButton = new System.Windows.Forms.Button();
    5858      this.cancelButton = new System.Windows.Forms.Button();
     59      this.variableNameTextBox = new System.Windows.Forms.TextBox();
    5960      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
    6061      this.SuspendLayout();
     
    6364      //
    6465      this.nodeSymbolLabel.AutoSize = true;
    65       this.nodeSymbolLabel.Location = new System.Drawing.Point(13, 13);
     66      this.nodeSymbolLabel.Location = new System.Drawing.Point(19, 13);
    6667      this.nodeSymbolLabel.Name = "nodeSymbolLabel";
    6768      this.nodeSymbolLabel.Size = new System.Drawing.Size(41, 13);
     
    7374      this.allowedSymbolsCombo.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
    7475      this.allowedSymbolsCombo.FormattingEnabled = true;
    75       this.allowedSymbolsCombo.Location = new System.Drawing.Point(120, 10);
     76      this.allowedSymbolsCombo.Location = new System.Drawing.Point(101, 10);
    7677      this.allowedSymbolsCombo.Name = "allowedSymbolsCombo";
    77       this.allowedSymbolsCombo.Size = new System.Drawing.Size(108, 21);
     78      this.allowedSymbolsCombo.Size = new System.Drawing.Size(127, 21);
    7879      this.allowedSymbolsCombo.TabIndex = 1;
    7980      this.allowedSymbolsCombo.SelectedIndexChanged += new System.EventHandler(this.allowedSymbolsCombo_SelectedIndexChanged);
     
    8384      //
    8485      this.variableWeightLabel.AutoSize = true;
    85       this.variableWeightLabel.Location = new System.Drawing.Point(13, 44);
     86      this.variableWeightLabel.Location = new System.Drawing.Point(19, 40);
    8687      this.variableWeightLabel.Name = "variableWeightLabel";
    8788      this.variableWeightLabel.Size = new System.Drawing.Size(41, 13);
     
    9394      //
    9495      this.variableNameLabel.AutoSize = true;
    95       this.variableNameLabel.Location = new System.Drawing.Point(13, 74);
     96      this.variableNameLabel.Location = new System.Drawing.Point(19, 66);
    9697      this.variableNameLabel.Name = "variableNameLabel";
    9798      this.variableNameLabel.Size = new System.Drawing.Size(35, 13);
     
    104105      this.variableNamesCombo.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
    105106      this.variableNamesCombo.FormattingEnabled = true;
    106       this.variableNamesCombo.Location = new System.Drawing.Point(120, 71);
     107      this.variableNamesCombo.Location = new System.Drawing.Point(101, 63);
    107108      this.variableNamesCombo.Name = "variableNamesCombo";
    108       this.variableNamesCombo.Size = new System.Drawing.Size(108, 21);
     109      this.variableNamesCombo.Size = new System.Drawing.Size(127, 21);
    109110      this.variableNamesCombo.TabIndex = 5;
    110111      this.variableNamesCombo.Visible = false;
     
    112113      // variableWeightTextBox
    113114      //
    114       this.variableWeightTextBox.Location = new System.Drawing.Point(120, 41);
     115      this.variableWeightTextBox.Location = new System.Drawing.Point(101, 37);
    115116      this.variableWeightTextBox.Name = "variableWeightTextBox";
    116       this.variableWeightTextBox.Size = new System.Drawing.Size(108, 20);
     117      this.variableWeightTextBox.Size = new System.Drawing.Size(127, 20);
    117118      this.variableWeightTextBox.TabIndex = 6;
    118119      this.variableWeightTextBox.Text = "0.0";
     
    122123      // constantValueTextBox
    123124      //
    124       this.constantValueTextBox.Location = new System.Drawing.Point(120, 41);
     125      this.constantValueTextBox.Location = new System.Drawing.Point(101, 37);
    125126      this.constantValueTextBox.Name = "constantValueTextBox";
    126       this.constantValueTextBox.Size = new System.Drawing.Size(108, 20);
     127      this.constantValueTextBox.Size = new System.Drawing.Size(127, 20);
    127128      this.constantValueTextBox.TabIndex = 7;
    128129      this.constantValueTextBox.Text = "0.0";
     
    133134      //
    134135      this.constantValueLabel.AutoSize = true;
    135       this.constantValueLabel.Location = new System.Drawing.Point(13, 44);
     136      this.constantValueLabel.Location = new System.Drawing.Point(19, 40);
    136137      this.constantValueLabel.Name = "constantValueLabel";
    137138      this.constantValueLabel.Size = new System.Drawing.Size(34, 13);
     
    149150      //
    150151      this.okButton.DialogResult = System.Windows.Forms.DialogResult.OK;
    151       this.okButton.Location = new System.Drawing.Point(12, 112);
     152      this.okButton.Location = new System.Drawing.Point(72, 98);
    152153      this.okButton.Name = "okButton";
    153154      this.okButton.Size = new System.Drawing.Size(75, 23);
     
    160161      //
    161162      this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
    162       this.cancelButton.Location = new System.Drawing.Point(153, 112);
     163      this.cancelButton.Location = new System.Drawing.Point(153, 98);
    163164      this.cancelButton.Name = "cancelButton";
    164165      this.cancelButton.Size = new System.Drawing.Size(75, 23);
     
    168169      this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
    169170      //
     171      // variableNameTextBox
     172      //
     173      this.variableNameTextBox.Location = new System.Drawing.Point(101, 63);
     174      this.variableNameTextBox.Name = "variableNameTextBox";
     175      this.variableNameTextBox.Size = new System.Drawing.Size(127, 20);
     176      this.variableNameTextBox.TabIndex = 11;
     177      this.variableNameTextBox.Visible = false;
     178      //
    170179      // InsertNodeDialog
    171180      //
     
    173182      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    174183      this.CancelButton = this.cancelButton;
    175       this.ClientSize = new System.Drawing.Size(240, 147);
     184      this.ClientSize = new System.Drawing.Size(241, 133);
    176185      this.ControlBox = false;
     186      this.Controls.Add(this.variableNameTextBox);
    177187      this.Controls.Add(this.cancelButton);
    178188      this.Controls.Add(this.okButton);
     
    208218    private System.Windows.Forms.Button cancelButton;
    209219    private System.Windows.Forms.Button okButton;
     220    private System.Windows.Forms.TextBox variableNameTextBox;
    210221  }
    211222}
  • branches/1837_Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/TreeEditDialogs/SymbolicExpressionTreeNodeInsertDialog.cs

    r9708 r17687  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2323using System.Collections.Generic;
    2424using System.ComponentModel;
     25using System.Linq;
    2526using System.Text;
    2627using System.Windows.Forms;
     
    3031namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Views {
    3132  public partial class InsertNodeDialog : Form {
     33    public string SelectedVariableName {
     34      get {
     35        var variable = SelectedSymbol as Variable;
     36        if (variable == null)
     37          return string.Empty;
     38        return variable.VariableNames.Any() ? variableNamesCombo.Text : variableNameTextBox.Text;
     39      }
     40    }
     41
    3242    public InsertNodeDialog() {
    3343      InitializeComponent();
     
    4050    }
    4151
    42     public ISymbol SelectedSymbol() {
    43       return (ISymbol)allowedSymbolsCombo.SelectedItem;
     52    public ISymbol SelectedSymbol {
     53      get { return (ISymbol)allowedSymbolsCombo.SelectedItem; }
    4454    }
    4555
     
    5565        constantValueLabel.Visible = true;
    5666        constantValueTextBox.Visible = true;
    57       } else if (symbol is Variable) {
    58         var variable = (Variable)symbol;
    59         foreach (var name in variable.VariableNames) variableNamesCombo.Items.Add(name);
    60         variableNamesCombo.SelectedIndex = 0;
     67      } else if (symbol is VariableBase) {
     68        var variableSymbol = (VariableBase)symbol;
     69        if (variableSymbol.VariableNames.Any()) {
     70          foreach (var name in variableSymbol.VariableNames)
     71            variableNamesCombo.Items.Add(name);
     72          variableNamesCombo.SelectedIndex = 0;
     73          variableNamesCombo.Visible = true;
     74          variableNameTextBox.Visible = false;
     75        } else {
     76          variableNamesCombo.Visible = false;
     77          variableNameTextBox.Visible = true;
     78        }
    6179        variableNameLabel.Visible = true;
    62         variableNamesCombo.Visible = true;
    6380        variableWeightLabel.Visible = true;
    6481        variableWeightTextBox.Visible = true;
  • branches/1837_Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/TreeEditDialogs/SymbolicExpressionTreeVariableNodeEditDialog.Designer.cs

    r9708 r17687  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    5555      this.okButton = new System.Windows.Forms.Button();
    5656      this.cancelButton = new System.Windows.Forms.Button();
     57      this.variableNameTextBox = new System.Windows.Forms.TextBox();
    5758      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
    5859      this.SuspendLayout();
     
    6162      //
    6263      this.originalValueLabel.AutoSize = true;
    63       this.originalValueLabel.Location = new System.Drawing.Point(12, 48);
     64      this.originalValueLabel.Location = new System.Drawing.Point(6, 42);
    6465      this.originalValueLabel.Name = "originalValueLabel";
    6566      this.originalValueLabel.Size = new System.Drawing.Size(72, 13);
     
    6970      // oldValueTextBox
    7071      //
    71       this.oldValueTextBox.Location = new System.Drawing.Point(123, 45);
     72      this.oldValueTextBox.Location = new System.Drawing.Point(101, 39);
    7273      this.oldValueTextBox.Name = "oldValueTextBox";
    7374      this.oldValueTextBox.ReadOnly = true;
     
    7778      // newValueTextBox
    7879      //
    79       this.newValueTextBox.Location = new System.Drawing.Point(123, 82);
     80      this.newValueTextBox.Location = new System.Drawing.Point(101, 65);
    8081      this.newValueTextBox.Name = "newValueTextBox";
    8182      this.newValueTextBox.Size = new System.Drawing.Size(131, 20);
     
    8889      //
    8990      this.newValueLabel.AutoSize = true;
    90       this.newValueLabel.Location = new System.Drawing.Point(12, 85);
     91      this.newValueLabel.Location = new System.Drawing.Point(6, 68);
    9192      this.newValueLabel.Name = "newValueLabel";
    9293      this.newValueLabel.Size = new System.Drawing.Size(59, 13);
     
    103104      //
    104105      this.variableNameLabel.AutoSize = true;
    105       this.variableNameLabel.Location = new System.Drawing.Point(12, 12);
     106      this.variableNameLabel.Location = new System.Drawing.Point(6, 15);
    106107      this.variableNameLabel.Name = "variableNameLabel";
    107108      this.variableNameLabel.Size = new System.Drawing.Size(76, 13);
     
    114115      this.variableNamesCombo.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
    115116      this.variableNamesCombo.FormattingEnabled = true;
    116       this.variableNamesCombo.Location = new System.Drawing.Point(123, 9);
     117      this.variableNamesCombo.Location = new System.Drawing.Point(101, 12);
    117118      this.variableNamesCombo.Name = "variableNamesCombo";
    118119      this.variableNamesCombo.Size = new System.Drawing.Size(131, 21);
     
    126127      //
    127128      this.okButton.DialogResult = System.Windows.Forms.DialogResult.OK;
    128       this.okButton.Location = new System.Drawing.Point(15, 119);
     129      this.okButton.Location = new System.Drawing.Point(75, 98);
    129130      this.okButton.Name = "okButton";
    130131      this.okButton.Size = new System.Drawing.Size(75, 23);
     
    138139      this.cancelButton.CausesValidation = false;
    139140      this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
    140       this.cancelButton.Location = new System.Drawing.Point(179, 119);
     141      this.cancelButton.Location = new System.Drawing.Point(156, 98);
    141142      this.cancelButton.Name = "cancelButton";
    142143      this.cancelButton.Size = new System.Drawing.Size(75, 23);
     
    146147      this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
    147148      //
     149      // variableNameTextBox
     150      //
     151      this.variableNameTextBox.Location = new System.Drawing.Point(101, 12);
     152      this.variableNameTextBox.Name = "variableNameTextBox";
     153      this.variableNameTextBox.Size = new System.Drawing.Size(131, 20);
     154      this.variableNameTextBox.TabIndex = 12;
     155      this.variableNameTextBox.Visible = false;
     156      //
    148157      // VariableNodeEditDialog
    149158      //
     
    152161      this.AutoSize = true;
    153162      this.CancelButton = this.cancelButton;
    154       this.ClientSize = new System.Drawing.Size(269, 154);
     163      this.ClientSize = new System.Drawing.Size(244, 134);
    155164      this.ControlBox = false;
     165      this.Controls.Add(this.variableNameTextBox);
    156166      this.Controls.Add(this.cancelButton);
    157167      this.Controls.Add(this.okButton);
     
    188198    public System.Windows.Forms.TextBox newValueTextBox;
    189199    public System.Windows.Forms.ComboBox variableNamesCombo;
     200    private System.Windows.Forms.TextBox variableNameTextBox;
    190201  }
    191202}
  • branches/1837_Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/TreeEditDialogs/SymbolicExpressionTreeVariableNodeEditDialog.cs

    r9708 r17687  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2222using System;
    2323using System.ComponentModel;
     24using System.Linq;
    2425using System.Text;
    2526using System.Windows.Forms;
     
    3334      get { return variableTreeNode; }
    3435      set {
    35         if (InvokeRequired)
    36           Invoke(new Action<SymbolicExpressionTreeNode>(x => variableTreeNode = (VariableTreeNode)x), value);
    37         else
     36        if (InvokeRequired) {
     37          Invoke(new Action<SymbolicExpressionTreeNode>(x =>
     38          {
     39            variableTreeNode = (VariableTreeNode) x;
     40            variableNameTextBox.Text = variableTreeNode.VariableName;
     41          }), value);
     42        } else {
    3843          variableTreeNode = value;
     44          variableNameTextBox.Text = variableTreeNode.VariableName;
     45        }
    3946      }
     47    }
     48
     49    public string SelectedVariableName {
     50      get { return variableNamesCombo.Visible ? variableNamesCombo.Text : variableNameTextBox.Text; }
    4051    }
    4152
     
    4354      InitializeComponent();
    4455      oldValueTextBox.TabStop = false; // cannot receive focus using tab key
    45 
    4656      NewNode = (VariableTreeNode)node; // will throw an invalid cast exception if node is not of the correct type
    4757      InitializeFields();
     
    5767        variableNameLabel.Visible = true;
    5868        variableNamesCombo.Visible = true;
    59         foreach (var name in variableTreeNode.Symbol.VariableNames) variableNamesCombo.Items.Add(name);
    60         variableNamesCombo.SelectedIndex = variableNamesCombo.Items.IndexOf(variableTreeNode.VariableName);
     69        if (variableTreeNode.Symbol.VariableNames.Any()) {
     70          foreach (var name in variableTreeNode.Symbol.VariableNames)
     71            variableNamesCombo.Items.Add(name);
     72          variableNamesCombo.SelectedIndex = variableNamesCombo.Items.IndexOf(variableTreeNode.VariableName);
     73          variableNamesCombo.Visible = true;
     74          variableNameTextBox.Visible = false;
     75        } else {
     76          variableNamesCombo.Visible = false;
     77          variableNameTextBox.Visible = true;
     78        }
    6179      }
    6280    }
     
    93111    #region combo box validation and events
    94112    private void variableNamesCombo_Validating(object sender, CancelEventArgs e) {
     113      if (variableNamesCombo.Items.Count == 0) return;
    95114      if (variableNamesCombo.Items.Contains(variableNamesCombo.SelectedItem)) return;
    96115      e.Cancel = true;
     
    119138    private void OnDialogValidated(object sender, EventArgs e) {
    120139      double weight = double.Parse(newValueTextBox.Text);
    121       var variableName = (string)variableNamesCombo.SelectedItem;
    122140      // we impose an extra validation condition: that the weight/value be different than the original ones
     141      var variableName = SelectedVariableName;
    123142      if (variableTreeNode.Weight.Equals(weight) && variableTreeNode.VariableName.Equals(variableName)) return;
    124143      variableTreeNode.Weight = weight;
Note: See TracChangeset for help on using the changeset viewer.