Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/14/21 17:59:53 (3 years ago)
Author:
dpiringe
Message:

#3136

  • changed the StructureTemplateView -> nodes of type SubFunctionTreeNode are now clickable
    • still need to overhaul the UI elements
  • added a way to parse SubFunctionTreeNode with a unique name in InfixExpressionParser
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3136_Structural_GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/StructureTemplate/StructureTemplateView.cs

    r18065 r18067  
    88using HeuristicLab.Data;
    99using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
     10using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views;
    1011using HeuristicLab.MainForm;
    1112using HeuristicLab.MainForm.WindowsForms;
     
    2425      InitializeComponent();
    2526      errorLabel.Text = "";
     27      treeChart.SymbolicExpressionTreeNodeClicked += TreeChart_SymbolicExpressionTreeNodeClicked;
     28    }
     29
     30    private void TreeChart_SymbolicExpressionTreeNodeClicked(object sender, MouseEventArgs e) {
     31      var visualTreeNode = sender as VisualTreeNode<ISymbolicExpressionTreeNode>;
     32      if(visualTreeNode != null) {
     33        var subFunctionTreeNode = visualTreeNode.Content as SubFunctionTreeNode;
     34        viewHost.Content = subFunctionTreeNode?.SubFunction;
     35      }
    2636    }
    2737
     
    3242      expressionInput.Text = Content.Template;
    3343      symRegTreeChart.Content = Content.Tree;
    34       subFunctionListView.Content = new ItemList<SubFunction>(Content.SubFunctions.Values).AsReadOnly();
    35      
     44
     45      treeChart.Tree = Content.Tree;
     46
    3647      errorLabel.Text = "";
    3748     
     
    4354          Content.Template = expressionInput.Text;
    4455          symRegTreeChart.Content = Content.Tree;
    45 
    46           var subFunctionList = new ItemList<SubFunction>();
    47           foreach (var func in Content.SubFunctions.Values)
    48             subFunctionList.Add(func);
    49           subFunctionListView.Content = subFunctionList.AsReadOnly();
     56          treeChart.Tree = Content.Tree;
    5057
    5158          errorLabel.Text = "Template structure successfully parsed.";
Note: See TracChangeset for help on using the changeset viewer.