Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/19/21 13:39:44 (12 months ago)
Author:
dpiringe
Message:

#3136

  • added linear scaling support for structure template parameter
File:
1 edited

Legend:

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

    r18068 r18069  
    4242      if (Content == null) return;
    4343      expressionInput.Text = Content.Template;
     44      linearScalingCheckBox.Checked = Content.ApplyLinearScaling;
    4445      PaintTree();
    4546      infoLabel.Text = "";
     
    4748
    4849    private void ParseButtonClick(object sender, EventArgs e) {
    49       if(!string.IsNullOrEmpty(expressionInput.Text)) {
    50         try {
    51           Content.Template = expressionInput.Text;
    52           PaintTree();
    53           infoLabel.Text = "Template structure successfully parsed.";
    54           infoLabel.ForeColor = Color.DarkGreen;
    55         } catch (Exception ex) {
    56           infoLabel.Text = ex.Message;
    57           infoLabel.ForeColor = Color.DarkRed;
    58         }
    59       }
     50      Parse();
    6051    }
    6152
     
    7970      }
    8071    }
     72
     73    private void ExpressionInputKeyUp(object sender, KeyEventArgs e) {
     74      if (e.KeyCode == Keys.Enter)
     75        Parse();
     76    }
     77
     78    private void Parse() {
     79      if (!string.IsNullOrEmpty(expressionInput.Text)) {
     80        try {
     81          Content.Template = expressionInput.Text;
     82          PaintTree();
     83          infoLabel.Text = "Template structure successfully parsed.";
     84          infoLabel.ForeColor = Color.DarkGreen;
     85        } catch (Exception ex) {
     86          infoLabel.Text = ex.Message;
     87          infoLabel.ForeColor = Color.DarkRed;
     88        }
     89      }
     90    }
     91
     92    private void LinearScalingCheckBoxCheckStateChanged(object sender, EventArgs e) {
     93      Content.ApplyLinearScaling = linearScalingCheckBox.Checked;
     94      PaintTree();
     95    }
    8196  }
    8297}
Note: See TracChangeset for help on using the changeset viewer.