Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/16/21 11:08:18 (3 years ago)
Author:
gkronber
Message:

#3073: refactoring to prepare for trunk integration

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3073_IA_constraint_splitting_reintegration/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/ShapeConstraintView.cs

    r17895 r17896  
    22
    33/* HeuristicLab
    4  * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     4 * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    55 *
    66 * This file is part of HeuristicLab.
     
    2929
    3030namespace HeuristicLab.Problems.DataAnalysis.Views {
    31   [View("Interval Constraint Detail View")]
     31  [View("Shape Constraint View")]
    3232  [Content(typeof(ShapeConstraint), true)]
    33   public sealed partial class IntervalConstraintView : ItemView {
     33  public sealed partial class ShapeConstraintView : ItemView {
    3434    public new ShapeConstraint Content {
    3535      get => (ShapeConstraint)base.Content;
     
    3737    }
    3838
    39     public IntervalConstraintView() {
     39    public ShapeConstraintView() {
    4040      InitializeComponent();
    4141      int[] items = { 1, 2, 3 };
    42       numberderivationInput.DataSource = items;
     42      numberOfDerivationsComboBox.DataSource = items;
    4343    }
    4444
     
    6262      base.SetEnabledStateOfControls();
    6363      variableInput.Enabled = Content != null && !Locked && !ReadOnly;
    64       numberderivationInput.Enabled = Content != null && !Locked && !ReadOnly;
     64      numberOfDerivationsComboBox.Enabled = Content != null && !Locked && !ReadOnly;
    6565      lowerboundInput.Enabled = Content != null && !Locked && !ReadOnly;
    6666      upperboundInput.Enabled = Content != null && !Locked && !ReadOnly;
    67       weightInput.Enabled = Content != null && !Locked && !ReadOnly;
     67      weightTextBox.Enabled = Content != null && !Locked && !ReadOnly;
    6868    }
    6969
     
    9696        lowerboundInput.Text = string.Empty;
    9797        upperboundInput.Text = string.Empty;
    98         weightInput.Text = string.Empty;
     98        weightTextBox.Text = string.Empty;
    9999        return;
    100100      }
     
    102102      lowerboundInput.Text = Content.Interval.LowerBound.ToString();
    103103      upperboundInput.Text = Content.Interval.UpperBound.ToString();
    104       weightInput.Text = Content.Weight.ToString();
     104      weightTextBox.Text = Content.Weight.ToString();
    105105
    106106      variableInput.Text = Content.Variable;
    107107      if (!Content.IsDerivative) {
    108         numberderivationInput.Enabled = false;
    109         numberderivationInput.SelectedItem = null;
    110         numberderivationInput.Text = "0";
     108        numberOfDerivationsComboBox.Enabled = false;
     109        numberOfDerivationsComboBox.SelectedItem = null;
     110        numberOfDerivationsComboBox.Text = "0";
    111111      } else {
    112         numberderivationLabel.Visible = true;
    113         numberderivationInput.Visible = true;
    114         numberderivationInput.Enabled = true;
    115         numberderivationInput.SelectedItem = Content.NumberOfDerivations;
     112        numberOfDerivationLabel.Visible = true;
     113        numberOfDerivationsComboBox.Visible = true;
     114        numberOfDerivationsComboBox.Enabled = true;
     115        numberOfDerivationsComboBox.SelectedItem = Content.NumberOfDerivations;
    116116      }
    117117
     
    172172
    173173    private void numberderivationInput_SelectedIndexChanged(object sender, EventArgs e) {
    174       if (numberderivationInput.SelectedItem == null) {
     174      if (numberOfDerivationsComboBox.SelectedItem == null) {
    175175        Content.NumberOfDerivations = 0;
    176         numberderivationInput.Enabled = false;
    177         return;
    178       }
    179 
    180       if ((int)numberderivationInput.SelectedItem == 1)
     176        numberOfDerivationsComboBox.Enabled = false;
     177        return;
     178      }
     179
     180      if ((int)numberOfDerivationsComboBox.SelectedItem == 1)
    181181        Content.NumberOfDerivations = 1;
    182       else if ((int)numberderivationInput.SelectedItem == 2)
     182      else if ((int)numberOfDerivationsComboBox.SelectedItem == 2)
    183183        Content.NumberOfDerivations = 2;
    184       else if ((int)numberderivationInput.SelectedItem == 3)
     184      else if ((int)numberOfDerivationsComboBox.SelectedItem == 3)
    185185        Content.NumberOfDerivations = 3;
    186186    }
    187187
    188188    private void weightInput_TextChanged(object sender, EventArgs e) {
    189       var value = ParseDoubleValue(weightInput.Text, weightInput, errorProvider);
     189      var value = ParseDoubleValue(weightTextBox.Text, weightTextBox, errorProvider);
    190190      if (!double.IsNaN(value)) Content.Weight = value;
    191191    }
Note: See TracChangeset for help on using the changeset viewer.