Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/23/15 12:50:05 (9 years ago)
Author:
gkronber
Message:

#2261: merged trunk changes to branch
r12494
#2403: added a null check in the MatlabParameterVectorEvaluator to prevent exceptions when clearstate is called


r12493
#2369: added support for squared errors and relative errors to error-characteristic-curve view


r12492
#2392: implemented PearsonsRCalculator to fix incorrect correlation values in the correlation matrix.


r12491
#2402 don't set task state to waiting when it fails


r12490
#2401 added missing Mono.Cecil plugin dependency


r12488
#2400 - Interfaces for Capaciated-, PickupAndDelivery- and TimeWindowed-ProblemInstances now specify an additional penalty parameter to set the current penalty factor for the constraint relaxation. - The setter of the penalty-property in ...


r12485
#2374 made RegressionSolution and ClassificationSolution non-abstract


r12482
#2320: Fixed warnings in unit test solutions introduced in r12420 by marking methods as obsolete.


r12481
#2320: Fixed AfterDeserialization of GEArtifialAntEvaluator.


r12480
#2320: Fixed error in symbolicexpressiontree crossover regarding the wiring of lookup parameters if persisted file is loaded.


r12479
#2397 moved GeoIP project into ExtLibs


r12478
#2329 fixed bug in simple code editor


r12476
#2331 removed outdated plugins


r12475
#2368 fixed compile warnings


r12474
#2399 worked on Mono project prepare script


r12473
#2329 added a simple code editor for Linux


r12472
#2399 - fixed MathJax.js file name - worked on Mono project prepare script


r12471
#2399 worked on Mono project prepare script


r12470
#2399 fixed pre-build events in project files


r12465
#2399 worked on mono project prepare script


r12464
#2399 added patch to project


r12463
#2399 fixed EPPlus so that it compiles on Linux


r12461
#2398: Skip root and start symbols when calculating impacts and replacement values in the pruning operators.


r12458
#2354 show label when no data is displayed and don't show the legend


r12457
#2353 removed duplicated call to Any() in Hive Status page


r12456
#2368 fixed modifier


r12455
#2368 added support in persistence for typecaches in streams


r12445
#2394: Changed Web.config compilation from debug to release to force script bundling. Changed history loading type from lazy to eager loading to increase performance. Fixed "getCoreStatus" typo in statusCtrl.js


r12443
#2394: Fixed UserTaskQuery and GetStatusHistory in the WebApp.Status plugin


r12442
#2394 added nuget folders to svn ignore list


r12435
#2394: Improved PluginManager and updated hive status monitor.


r12434
#2396 added symbolic expression tree formatter for C#


r12433
#2395: Minor change in DoubleValue.GetValue.


r12432
#2395 Use simple round-trip format for doubles because G17 prints some strange numbers (20.22 to 20.219999999999999999). Some accuracy can still be lost on 64bit machines, but should be very rare and minimal. double.MaxValue can still be pa...


r12431
#2395 Fixed parsing issues by using the G17 format.


r12430
#2394 added missing package config


r12429
#2394 added missing package config


r12428
#2394 added web app and status page to trunk


r12424
#2320: Adapted plugin file and updated project file of SymbolicExpressionTreeEncoding.


r12422
#2320: Merged the encoding class and all accompanying changes in the trunk.


r12401
#2387 Fixed a bug where the automatic selection of the first element behaved differently for the NewItemDialog.


r12400
#2387 Forgot to commit a file.


r12399
#2387 - Added context-menu for expanding and collapsing tree-nodes. - Improve response time when expanding/collapsing all nodes for TypeSelector and NewItemDialog.


r12398
#2387 - Added clearSearch-button in TypeSelector. - Adapted behavior of TypeSelector and NewItemDialog that a selected node stays selected as long as it matches the search criteria.


r12397
#2387 - Adapted behavior of the matching in the TypeSelector that it behave the same as the NewItemDialog. The search string is tokenized by space and matches if all tokens are contained, (eg. "Sym Reg" matches "SymbolicRegression...")...


r12393
#2025 - Removed Expand/CollapseAll buttons. - Removed cycling of items.


r12392
#2386: Updated GetHashCode method in the EnumerableBoolEqualityComparer.


Location:
branches/GBT
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/GBT

  • branches/GBT/HeuristicLab.Core.Views/3.3/TypeSelector.Designer.cs

    r12012 r12495  
    4242      this.searchLabel = new System.Windows.Forms.Label();
    4343      this.searchTextBox = new System.Windows.Forms.TextBox();
     44      this.clearSearchButton = new System.Windows.Forms.Button();
     45      this.contextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components);
     46      this.expandToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
     47      this.expandAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
     48      this.collapseToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
     49      this.collapseAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
    4450      this.typeParametersGroupBox = new System.Windows.Forms.GroupBox();
    4551      this.setTypeParameterButton = new System.Windows.Forms.Button();
     
    5662      this.typeParametersSplitContainer.SuspendLayout();
    5763      this.typeParametersGroupBox.SuspendLayout();
     64      this.contextMenuStrip.SuspendLayout();
    5865      this.SuspendLayout();
    5966      //
     
    7582      this.typesTreeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.typesTreeView_AfterSelect);
    7683      this.typesTreeView.VisibleChanged += new System.EventHandler(this.typesTreeView_VisibleChanged);
     84      this.typesTreeView.MouseDown += new System.Windows.Forms.MouseEventHandler(this.typesTreeView_MouseDown);
    7785      //
    7886      // imageList
     
    146154      this.searchTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    147155                  | System.Windows.Forms.AnchorStyles.Right)));
     156      this.searchTextBox.Controls.Add(this.clearSearchButton);
    148157      this.searchTextBox.Location = new System.Drawing.Point(29, 3);
    149158      this.searchTextBox.Name = "searchTextBox";
    150159      this.searchTextBox.Size = new System.Drawing.Size(193, 20);
    151160      this.searchTextBox.TabIndex = 1;
    152       this.toolTip.SetToolTip(this.searchTextBox, "Enter string to search for types");
     161      this.toolTip.SetToolTip(this.searchTextBox, "Filters the available Types.\r\nThe search term is tokenized by space and a name ha" +
     162        "s to contain all tokens to be displayed.\r\n(E.g. \"Sym Reg\" matches \"SymbolicRegr" +
     163        "ession\")");
    153164      this.searchTextBox.TextChanged += new System.EventHandler(this.searchTextBox_TextChanged);
     165      this.searchTextBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.searchTextBox_KeyDown);
     166      //
     167      // clearSearchButton
     168      //
     169      this.clearSearchButton.BackColor = System.Drawing.Color.Transparent;
     170      this.clearSearchButton.Cursor = System.Windows.Forms.Cursors.Default;
     171      this.clearSearchButton.Dock = System.Windows.Forms.DockStyle.Right;
     172      this.clearSearchButton.FlatAppearance.BorderSize = 0;
     173      this.clearSearchButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
     174      this.clearSearchButton.ForeColor = System.Drawing.Color.Transparent;
     175      this.clearSearchButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Delete;
     176      this.clearSearchButton.Location = new System.Drawing.Point(543, 0);
     177      this.clearSearchButton.Margin = new System.Windows.Forms.Padding(0);
     178      this.clearSearchButton.Name = "clearSearchButton";
     179      this.clearSearchButton.Size = new System.Drawing.Size(15, 16);
     180      this.clearSearchButton.TabIndex = 0;
     181      this.clearSearchButton.TabStop = false;
     182      this.clearSearchButton.UseVisualStyleBackColor = false;
     183      this.clearSearchButton.Click += new System.EventHandler(this.clearSearchButton_Click);
    154184      //
    155185      // typeParametersGroupBox
     
    213243      this.descriptionTextBox.Size = new System.Drawing.Size(219, 114);
    214244      this.descriptionTextBox.TabIndex = 0;
     245      //
     246      // contextMenuStrip
     247      //
     248      this.contextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
     249            this.expandToolStripMenuItem,
     250            this.expandAllToolStripMenuItem,
     251            this.collapseToolStripMenuItem,
     252            this.collapseAllToolStripMenuItem});
     253      this.contextMenuStrip.Name = "contextMenuStrip";
     254      this.contextMenuStrip.Size = new System.Drawing.Size(137, 92);
     255      //
     256      // expandToolStripMenuItem
     257      //
     258      this.expandToolStripMenuItem.Name = "expandToolStripMenuItem";
     259      this.expandToolStripMenuItem.Size = new System.Drawing.Size(136, 22);
     260      this.expandToolStripMenuItem.Text = "Expand";
     261      this.expandToolStripMenuItem.Click += new System.EventHandler(this.expandToolStripMenuItem_Click);
     262      //
     263      // expandAllToolStripMenuItem
     264      //
     265      this.expandAllToolStripMenuItem.Name = "expandAllToolStripMenuItem";
     266      this.expandAllToolStripMenuItem.Size = new System.Drawing.Size(136, 22);
     267      this.expandAllToolStripMenuItem.Text = "Expand All";
     268      this.expandAllToolStripMenuItem.Click += new System.EventHandler(this.expandAllToolStripMenuItem_Click);
     269      //
     270      // collapseToolStripMenuItem
     271      //
     272      this.collapseToolStripMenuItem.Name = "collapseToolStripMenuItem";
     273      this.collapseToolStripMenuItem.Size = new System.Drawing.Size(136, 22);
     274      this.collapseToolStripMenuItem.Text = "Collapse";
     275      this.collapseToolStripMenuItem.Click += new System.EventHandler(this.collapseToolStripMenuItem_Click);
     276      //
     277      // collapseAllToolStripMenuItem
     278      //
     279      this.collapseAllToolStripMenuItem.Name = "collapseAllToolStripMenuItem";
     280      this.collapseAllToolStripMenuItem.Size = new System.Drawing.Size(136, 22);
     281      this.collapseAllToolStripMenuItem.Text = "Collapse All";
     282      this.collapseAllToolStripMenuItem.Click += new System.EventHandler(this.collapseAllToolStripMenuItem_Click);
    215283      //
    216284      // TypeSelector
     
    231299      this.typeParametersSplitContainer.ResumeLayout(false);
    232300      this.typeParametersGroupBox.ResumeLayout(false);
     301      this.contextMenuStrip.ResumeLayout(false);
    233302      this.ResumeLayout(false);
    234303
     
    244313    protected System.Windows.Forms.Label searchLabel;
    245314    protected System.Windows.Forms.TextBox searchTextBox;
     315    protected System.Windows.Forms.Button clearSearchButton;
    246316    protected System.Windows.Forms.ToolTip toolTip;
     317    protected System.Windows.Forms.ContextMenuStrip contextMenuStrip;
     318    protected System.Windows.Forms.ToolStripMenuItem expandToolStripMenuItem;
     319    protected System.Windows.Forms.ToolStripMenuItem expandAllToolStripMenuItem;
     320    protected System.Windows.Forms.ToolStripMenuItem collapseToolStripMenuItem;
     321    protected System.Windows.Forms.ToolStripMenuItem collapseAllToolStripMenuItem;
    247322    protected System.Windows.Forms.SplitContainer typeParametersSplitContainer;
    248323    protected System.Windows.Forms.GroupBox typeParametersGroupBox;
     
    250325    protected System.Windows.Forms.Button setTypeParameterButton;
    251326    protected System.Windows.Forms.ColumnHeader columnHeader1;
    252 
    253327  }
    254328}
  • branches/GBT/HeuristicLab.Core.Views/3.3/TypeSelector.cs

    r12012 r12495  
    2222using System;
    2323using System.Collections.Generic;
     24using System.Drawing;
    2425using System.Linq;
    2526using System.Reflection;
     
    177178      else {
    178179        searchString = searchString.ToLower();
     180        TreeNode selectedNode = typesTreeView.SelectedNode;
    179181
    180182        if (!searchString.Contains(currentSearchString)) {
    181183          typesTreeView.BeginUpdate();
    182184          // expand search -> restore all tree nodes
    183           TreeNode selectedNode = typesTreeView.SelectedNode;
    184185          typesTreeView.Nodes.Clear();
    185186          foreach (TreeNode node in treeNodes)
    186187            typesTreeView.Nodes.Add((TreeNode)node.Clone());
    187           RestoreSelectedNode(selectedNode);
    188188          typesTreeView.EndUpdate();
    189189        }
    190 
    191190
    192191        // remove nodes
    193192        typesTreeView.BeginUpdate();
     193        var searchTokens = searchString.Split(' ');
    194194        int i = 0;
    195195        while (i < typesTreeView.Nodes.Count) {
    196           int j = 0;
    197           while (j < typesTreeView.Nodes[i].Nodes.Count) {
    198             if (!typesTreeView.Nodes[i].Nodes[j].Text.ToLower().Contains(searchString)) {
    199               if ((typesTreeView.Nodes[i].Nodes[j].Tag as Type).Equals(selectedType))
    200                 SelectedType = null;
    201               typesTreeView.Nodes[i].Nodes[j].Remove();
    202             } else
    203               j++;
    204           }
    205           if (typesTreeView.Nodes[i].Nodes.Count == 0)
    206             typesTreeView.Nodes[i].Remove();
    207           else
    208             i++;
     196          var node = typesTreeView.Nodes[i];
     197          bool remove = FilterNode(node, searchTokens);
     198          if (remove)
     199            typesTreeView.Nodes.RemoveAt(i);
     200          else i++;
    209201        }
    210202        typesTreeView.EndUpdate();
    211203        currentSearchString = searchString;
    212204
    213         // if there is just one type node left, select by default
    214         if (typesTreeView.Nodes.Count == 1) {
    215           if (typesTreeView.Nodes[0].Nodes.Count == 1) {
    216             typesTreeView.SelectedNode = typesTreeView.Nodes[0].Nodes[0];
    217           }
    218         }
     205        // select first item
     206        typesTreeView.BeginUpdate();
     207        var firstNode = typesTreeView.Nodes.Count > 0 ? typesTreeView.Nodes[0] : null;
     208        while (firstNode != null && !(firstNode.Tag is Type))
     209          firstNode = firstNode.NextVisibleNode;
     210        if (firstNode != null)
     211          typesTreeView.SelectedNode = firstNode;
    219212
    220213        if (typesTreeView.Nodes.Count == 0) {
     
    225218          typesTreeView.Enabled = true;
    226219        }
     220        typesTreeView.EndUpdate();
     221
     222        RestoreSelectedNode(selectedNode);
    227223        UpdateDescription();
    228224      }
     225    }
     226
     227    private bool FilterNode(TreeNode node, string[] searchTokens) {
     228      if (node.Tag is IPluginDescription) { // Plugin node
     229        int i = 0;
     230        while (i < node.Nodes.Count) {
     231          bool remove = FilterNode(node.Nodes[i], searchTokens);
     232          if (remove)
     233            node.Nodes.RemoveAt(i);
     234          else i++;
     235        }
     236        return node.Nodes.Count == 0;
     237      } if (node.Tag is Type) { // Type node
     238        var text = node.Text;
     239        if (searchTokens.Any(searchToken => !text.ToLower().Contains(searchToken))) {
     240          var typeTag = (Type)node.Tag;
     241          if (typeTag == SelectedType) {
     242            SelectedType = null;
     243            typesTreeView.SelectedNode = null;
     244          }
     245          return true;
     246        }
     247        return false;
     248      }
     249      throw new InvalidOperationException("Encountered neither a plugin nor a type node during tree traversal.");
    229250    }
    230251
     
    355376      SetTypeParameter();
    356377    }
     378    private void searchTextBox_KeyDown(object sender, KeyEventArgs e) {
     379      if (typesTreeView.Nodes.Count == 0)
     380        return;
     381
     382      if (e.KeyCode == Keys.Up || e.KeyCode == Keys.Down) {
     383        var selectedNode = typesTreeView.SelectedNode;
     384
     385        if (selectedNode == null) { // nothing selected => select first
     386          if (e.KeyCode == Keys.Down) typesTreeView.SelectedNode = typesTreeView.Nodes.Count > 0 ? typesTreeView.Nodes[0] : null;
     387        } else {
     388          if (e.KeyCode == Keys.Down && selectedNode.NextVisibleNode != null)
     389            typesTreeView.SelectedNode = selectedNode.NextVisibleNode;
     390          if (e.KeyCode == Keys.Up && selectedNode.PrevVisibleNode != null)
     391            typesTreeView.SelectedNode = selectedNode.PrevVisibleNode;
     392        }
     393        e.Handled = true;
     394      }
     395    }
     396    private void clearSearchButton_Click(object sender, EventArgs e) {
     397      searchTextBox.Text = string.Empty;
     398      searchTextBox.Focus();
     399    }
     400
     401    private TreeNode toolStripMenuNode = null;
     402    private void typesTreeView_MouseDown(object sender, MouseEventArgs e) {
     403      if (e.Button == MouseButtons.Right) {
     404        Point coordinates = typesTreeView.PointToClient(Cursor.Position);
     405        toolStripMenuNode = typesTreeView.GetNodeAt(coordinates);
     406
     407        if (toolStripMenuNode != null && coordinates.X >= toolStripMenuNode.Bounds.Left &&
     408            coordinates.X <= toolStripMenuNode.Bounds.Right) {
     409          typesTreeView.SelectedNode = toolStripMenuNode;
     410
     411          expandToolStripMenuItem.Enabled =
     412            expandToolStripMenuItem.Visible = !toolStripMenuNode.IsExpanded && toolStripMenuNode.Nodes.Count > 0;
     413          collapseToolStripMenuItem.Enabled = collapseToolStripMenuItem.Visible = toolStripMenuNode.IsExpanded;
     414        } else {
     415          expandToolStripMenuItem.Enabled = expandToolStripMenuItem.Visible = false;
     416          collapseToolStripMenuItem.Enabled = collapseToolStripMenuItem.Visible = false;
     417        }
     418        expandAllToolStripMenuItem.Enabled =
     419          expandAllToolStripMenuItem.Visible =
     420            !typesTreeView.Nodes.OfType<TreeNode>().All(x => TreeNodeIsFullyExpanded(x));
     421        collapseAllToolStripMenuItem.Enabled =
     422          collapseAllToolStripMenuItem.Visible = typesTreeView.Nodes.OfType<TreeNode>().Any(x => x.IsExpanded);
     423        if (contextMenuStrip.Items.Cast<ToolStripMenuItem>().Any(item => item.Enabled))
     424          contextMenuStrip.Show(Cursor.Position);
     425      }
     426    }
     427    private bool TreeNodeIsFullyExpanded(TreeNode node) {
     428      return (node.Nodes.Count == 0) || (node.IsExpanded && node.Nodes.OfType<TreeNode>().All(x => TreeNodeIsFullyExpanded(x)));
     429    }
     430    private void expandToolStripMenuItem_Click(object sender, EventArgs e) {
     431      typesTreeView.BeginUpdate();
     432      if (toolStripMenuNode != null) toolStripMenuNode.ExpandAll();
     433      typesTreeView.EndUpdate();
     434    }
     435    private void expandAllToolStripMenuItem_Click(object sender, EventArgs e) {
     436      typesTreeView.BeginUpdate();
     437      typesTreeView.ExpandAll();
     438      typesTreeView.EndUpdate();
     439    }
     440    private void collapseToolStripMenuItem_Click(object sender, EventArgs e) {
     441      typesTreeView.BeginUpdate();
     442      if (toolStripMenuNode != null) toolStripMenuNode.Collapse();
     443      typesTreeView.EndUpdate();
     444    }
     445    private void collapseAllToolStripMenuItem_Click(object sender, EventArgs e) {
     446      typesTreeView.BeginUpdate();
     447      typesTreeView.CollapseAll();
     448      typesTreeView.EndUpdate();
     449    }
    357450    #endregion
    358451
Note: See TracChangeset for help on using the changeset viewer.