Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/17/19 13:57:57 (5 years ago)
Author:
chaider
Message:

#2971: Added info text and info text color to ProblemDataConstraint

Location:
branches/2971_named_intervals
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis.Views/3.4/ProblemDataConstraintView.cs

    r17250 r17256  
    8080          Content.Constraints = parsedConstraints;
    8181          Content.Input = constraintsInput.Text;
    82           errorOutput.ForeColor = Color.DarkGreen;
    83           errorOutput.Text = "Constraints successfully parsed.";
     82          Content.InfoText = "Constraints successfully parsed.";
     83          Content.InfoColor = Color.DarkGreen;
    8484          //Catch the exception from the constraints parser and show it in the error dialog
    8585        } catch(ArgumentException ex) {
    8686          Content.Constraints = new List<IntervalConstraint>();
    87           errorOutput.ForeColor = Color.DarkRed;
    88           errorOutput.Text = ex.Message.Replace("Parameter name", "@Line");
     87          Content.InfoText = ex.Message.Replace("Parameter name", "@Line");
     88          Content.InfoColor = Color.DarkRed;
    8989        }
    9090      } else {
     
    100100        intervalConstraints.Clear();
    101101        constraintsInput.Text = Content.Input;
     102        errorOutput.ForeColor = Content.InfoColor;
     103        errorOutput.Text = Content.InfoText;
    102104        foreach (var constraint in Content.Constraints) {
    103105          intervalConstraints.Add(constraint, constraint.Enabled);
     
    135137    private void constraintsInput_TextChanged(object sender, EventArgs e) {
    136138      if (Content.Input != constraintsInput.Text) {
    137         errorOutput.ForeColor = Color.DarkOrange;
    138         errorOutput.Text = "Unparsed changes! Press parse button to save changes.";
    139         Content.Input = constraintsInput.Text;
     139       Content.Input = constraintsInput.Text;
     140       Content.InfoText = "Unparsed changes! Press parse button to save changes.";
     141       Content.InfoColor = Color.DarkOrange;
    140142      } else {
    141143        errorOutput.Text = "";
  • branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis/3.4/ProblemDataConstraint.cs

    r17146 r17256  
    2323using System;
    2424using System.Collections.Generic;
     25using System.Drawing;
    2526using System.Linq;
    2627using HEAL.Attic;
     
    5051
    5152    [Storable]
     53    private string infoText;
     54    public string InfoText {
     55      get => infoText;
     56      set {
     57        if (infoText == value) return;
     58        infoText = value;
     59        OnChanged();
     60      }
     61    }
     62
     63    [Storable]
     64    private Color infoColor;
     65    public Color InfoColor {
     66      get => infoColor;
     67      set {
     68        if (infoColor == value) return;
     69        infoColor = value;
     70        OnChanged();
     71      }
     72    }
     73
     74    [Storable]
    5275    private IEnumerable<IntervalConstraint> constraints;
    5376    public IEnumerable<IntervalConstraint> Constraints {
     
    6891      : base(original, cloner) {
    6992      this.Input = original.Input;
     93      this.InfoText = original.InfoText;
     94      this.infoColor = original.InfoColor;
    7095      this.constraints = original.Constraints.Select(cloner.Clone).ToList();
    7196      this.ProblemData = cloner.Clone(original.ProblemData);
     
    78103    public ProblemDataConstraint() : base() {
    79104      this.Input = exampleInput;
     105      this.InfoText = "";
     106      this.InfoColor = Color.DarkOrange;
    80107      this.constraints = new List<IntervalConstraint>();
    81108      this.ProblemData = null;
     
    84111    public ProblemDataConstraint(IRegressionProblemData problemData) : base() {
    85112      this.Input = exampleInput;
     113      this.InfoText = infoText;
     114      this.InfoColor = InfoColor;
    86115      this.constraints = new List<IntervalConstraint>();
    87116      this.ProblemData = problemData;
Note: See TracChangeset for help on using the changeset viewer.