Changeset 16776
- Timestamp:
- 04/12/19 07:48:00 (6 years ago)
- Location:
- branches/2971_named_intervals
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis.Views/3.4/IntervalConstraintView.Designer.cs
r16774 r16776 25 25 private void InitializeComponent() { 26 26 this.components = new System.ComponentModel.Container(); 27 this.expressionLabel = new System.Windows.Forms.Label();28 27 this.definitionLabel = new System.Windows.Forms.Label(); 29 28 this.lowerboundLabel = new System.Windows.Forms.Label(); … … 35 34 this.numberderivationLabel = new System.Windows.Forms.Label(); 36 35 this.definitionInput = new System.Windows.Forms.TextBox(); 37 this.expressionInput = new System.Windows.Forms.TextBox();38 36 this.upperboundInput = new System.Windows.Forms.TextBox(); 39 37 this.lowerboundInput = new System.Windows.Forms.TextBox(); 40 38 this.variableInput = new System.Windows.Forms.TextBox(); 41 39 this.numberderivationInput = new System.Windows.Forms.TextBox(); 42 this.upperCombo = new System.Windows.Forms.ComboBox();43 this.lowerCombo = new System.Windows.Forms.ComboBox();44 this.derivationInput = new System.Windows.Forms.TextBox();45 40 this.groupBox1 = new System.Windows.Forms.GroupBox(); 41 this.inclupperboundInput = new System.Windows.Forms.CheckBox(); 42 this.incllowerboundInput = new System.Windows.Forms.CheckBox(); 43 this.derivationInput = new System.Windows.Forms.CheckBox(); 44 this.expressionLabel = new System.Windows.Forms.Label(); 45 this.expressionInput = new System.Windows.Forms.TextBox(); 46 46 this.errorProvider = new System.Windows.Forms.ErrorProvider(this.components); 47 47 this.groupBox1.SuspendLayout(); 48 48 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit(); 49 49 this.SuspendLayout(); 50 //51 // expressionLabel52 //53 this.expressionLabel.AutoSize = true;54 this.expressionLabel.Location = new System.Drawing.Point(11, 20);55 this.expressionLabel.Name = "expressionLabel";56 this.expressionLabel.Size = new System.Drawing.Size(61, 13);57 this.expressionLabel.TabIndex = 0;58 this.expressionLabel.Text = "Expression:";59 50 // 60 51 // definitionLabel … … 139 130 this.definitionInput.TabIndex = 9; 140 131 // 141 // expressionInput142 //143 this.expressionInput.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)144 | System.Windows.Forms.AnchorStyles.Right)));145 this.expressionInput.Location = new System.Drawing.Point(111, 17);146 this.expressionInput.Name = "expressionInput";147 this.expressionInput.Size = new System.Drawing.Size(473, 20);148 this.expressionInput.TabIndex = 10;149 this.expressionInput.TextChanged += new System.EventHandler(this.expressionInput_TextChanged);150 //151 132 // upperboundInput 152 133 // … … 157 138 this.upperboundInput.Size = new System.Drawing.Size(473, 20); 158 139 this.upperboundInput.TabIndex = 11; 140 this.upperboundInput.Validating += new System.ComponentModel.CancelEventHandler(this.upperboundInput_Validating); 141 this.upperboundInput.Validated += new System.EventHandler(this.upperboundInput_Validated); 159 142 // 160 143 // lowerboundInput … … 166 149 this.lowerboundInput.Size = new System.Drawing.Size(473, 20); 167 150 this.lowerboundInput.TabIndex = 12; 168 this.lowerboundInput.TextChanged += new System.EventHandler(this.lowerboundInput_TextChanged); 151 this.lowerboundInput.Validating += new System.ComponentModel.CancelEventHandler(this.lowerboundInput_Validating); 152 this.lowerboundInput.Validated += new System.EventHandler(this.lowerboundInput_Validated); 169 153 // 170 154 // variableInput … … 176 160 this.variableInput.Size = new System.Drawing.Size(473, 20); 177 161 this.variableInput.TabIndex = 15; 178 this.variableInput.TextChanged += new System.EventHandler(this.variableInput_TextChanged);179 162 // 180 163 // numberderivationInput … … 184 167 this.numberderivationInput.Location = new System.Drawing.Point(111, 221); 185 168 this.numberderivationInput.Name = "numberderivationInput"; 186 this.numberderivationInput.Size = new System.Drawing.Size(47 3, 20);169 this.numberderivationInput.Size = new System.Drawing.Size(470, 20); 187 170 this.numberderivationInput.TabIndex = 17; 188 this.numberderivationInput.TextChanged += new System.EventHandler(this.numberderivationInput_TextChanged); 189 // 190 // upperCombo 191 // 192 this.upperCombo.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 193 | System.Windows.Forms.AnchorStyles.Right))); 194 this.upperCombo.FormattingEnabled = true; 195 this.upperCombo.Items.AddRange(new object[] { 196 "True", 197 "False"}); 198 this.upperCombo.Location = new System.Drawing.Point(111, 146); 199 this.upperCombo.Name = "upperCombo"; 200 this.upperCombo.Size = new System.Drawing.Size(473, 21); 201 this.upperCombo.TabIndex = 19; 202 // 203 // lowerCombo 204 // 205 this.lowerCombo.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 206 | System.Windows.Forms.AnchorStyles.Right))); 207 this.lowerCombo.FormattingEnabled = true; 208 this.lowerCombo.Items.AddRange(new object[] { 209 "True", 210 "False"}); 211 this.lowerCombo.Location = new System.Drawing.Point(111, 119); 212 this.lowerCombo.Name = "lowerCombo"; 213 this.lowerCombo.Size = new System.Drawing.Size(473, 21); 214 this.lowerCombo.TabIndex = 20; 215 // 216 // derivationInput 217 // 218 this.derivationInput.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 219 | System.Windows.Forms.AnchorStyles.Right))); 220 this.derivationInput.Location = new System.Drawing.Point(111, 170); 221 this.derivationInput.Name = "derivationInput"; 222 this.derivationInput.Size = new System.Drawing.Size(473, 20); 223 this.derivationInput.TabIndex = 21; 171 this.numberderivationInput.Validating += new System.ComponentModel.CancelEventHandler(this.numberderivationInput_Validating); 172 this.numberderivationInput.Validated += new System.EventHandler(this.numberderivationInput_Validated); 224 173 // 225 174 // groupBox1 226 175 // 176 this.groupBox1.Controls.Add(this.expressionInput); 177 this.groupBox1.Controls.Add(this.expressionLabel); 178 this.groupBox1.Controls.Add(this.inclupperboundInput); 179 this.groupBox1.Controls.Add(this.incllowerboundInput); 227 180 this.groupBox1.Controls.Add(this.derivationInput); 228 this.groupBox1.Controls.Add(this.lowerCombo);229 this.groupBox1.Controls.Add(this.upperCombo);230 181 this.groupBox1.Controls.Add(this.numberderivationInput); 231 182 this.groupBox1.Controls.Add(this.variableInput); 232 183 this.groupBox1.Controls.Add(this.lowerboundInput); 233 184 this.groupBox1.Controls.Add(this.upperboundInput); 234 this.groupBox1.Controls.Add(this.expressionInput);235 185 this.groupBox1.Controls.Add(this.definitionInput); 236 186 this.groupBox1.Controls.Add(this.numberderivationLabel); … … 242 192 this.groupBox1.Controls.Add(this.lowerboundLabel); 243 193 this.groupBox1.Controls.Add(this.definitionLabel); 244 this.groupBox1.Controls.Add(this.expressionLabel);245 194 this.groupBox1.Dock = System.Windows.Forms.DockStyle.Fill; 246 195 this.groupBox1.Location = new System.Drawing.Point(0, 0); … … 251 200 this.groupBox1.Text = "Interval Constraints Detail"; 252 201 // 202 // inclupperboundInput 203 // 204 this.inclupperboundInput.AutoSize = true; 205 this.inclupperboundInput.Location = new System.Drawing.Point(111, 146); 206 this.inclupperboundInput.Name = "inclupperboundInput"; 207 this.inclupperboundInput.Size = new System.Drawing.Size(15, 14); 208 this.inclupperboundInput.TabIndex = 23; 209 this.inclupperboundInput.UseVisualStyleBackColor = true; 210 this.inclupperboundInput.CheckedChanged += new System.EventHandler(this.inclupperboundInput_CheckedChanged); 211 // 212 // incllowerboundInput 213 // 214 this.incllowerboundInput.AutoSize = true; 215 this.incllowerboundInput.Location = new System.Drawing.Point(111, 122); 216 this.incllowerboundInput.Name = "incllowerboundInput"; 217 this.incllowerboundInput.Size = new System.Drawing.Size(15, 14); 218 this.incllowerboundInput.TabIndex = 22; 219 this.incllowerboundInput.UseVisualStyleBackColor = true; 220 this.incllowerboundInput.CheckedChanged += new System.EventHandler(this.incllowerboundInput_CheckedChanged); 221 // 222 // derivationInput 223 // 224 this.derivationInput.AutoSize = true; 225 this.derivationInput.Location = new System.Drawing.Point(111, 173); 226 this.derivationInput.Name = "derivationInput"; 227 this.derivationInput.Size = new System.Drawing.Size(15, 14); 228 this.derivationInput.TabIndex = 21; 229 this.derivationInput.UseVisualStyleBackColor = true; 230 // 231 // expressionLabel 232 // 233 this.expressionLabel.AutoSize = true; 234 this.expressionLabel.Location = new System.Drawing.Point(11, 20); 235 this.expressionLabel.Name = "expressionLabel"; 236 this.expressionLabel.Size = new System.Drawing.Size(61, 13); 237 this.expressionLabel.TabIndex = 24; 238 this.expressionLabel.Text = "Expression:"; 239 // 240 // expressionInput 241 // 242 this.expressionInput.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 243 | System.Windows.Forms.AnchorStyles.Right))); 244 this.expressionInput.Location = new System.Drawing.Point(108, 17); 245 this.expressionInput.Name = "expressionInput"; 246 this.expressionInput.Size = new System.Drawing.Size(473, 20); 247 this.expressionInput.TabIndex = 25; 248 // 253 249 // errorProvider 254 250 // 255 251 this.errorProvider.ContainerControl = this; 252 this.errorProvider.RightToLeft = true; 256 253 // 257 254 // IntervalConstraintView … … 269 266 270 267 #endregion 271 272 private System.Windows.Forms.Label expressionLabel;273 268 private System.Windows.Forms.Label definitionLabel; 274 269 private System.Windows.Forms.Label lowerboundLabel; … … 280 275 private System.Windows.Forms.Label numberderivationLabel; 281 276 private System.Windows.Forms.TextBox definitionInput; 282 private System.Windows.Forms.TextBox expressionInput;283 277 private System.Windows.Forms.TextBox upperboundInput; 284 278 private System.Windows.Forms.TextBox lowerboundInput; 285 279 private System.Windows.Forms.TextBox variableInput; 286 280 private System.Windows.Forms.TextBox numberderivationInput; 287 private System.Windows.Forms.ComboBox upperCombo;288 private System.Windows.Forms.ComboBox lowerCombo;289 private System.Windows.Forms.TextBox derivationInput;290 281 private System.Windows.Forms.GroupBox groupBox1; 282 private System.Windows.Forms.CheckBox derivationInput; 283 private System.Windows.Forms.CheckBox inclupperboundInput; 284 private System.Windows.Forms.CheckBox incllowerboundInput; 285 private System.Windows.Forms.TextBox expressionInput; 286 private System.Windows.Forms.Label expressionLabel; 291 287 private System.Windows.Forms.ErrorProvider errorProvider; 292 288 } -
branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis.Views/3.4/IntervalConstraintView.cs
r16774 r16776 19 19 20 20 public new IntervalConstraint Content { 21 get { return (IntervalConstraint)base.Content; }22 set { base.Content = value; }21 get => (IntervalConstraint) base.Content; 22 set => base.Content = value; 23 23 } 24 24 … … 27 27 expressionInput.ReadOnly = true; 28 28 definitionInput.ReadOnly = true; 29 derivationInput.ReadOnly = true; 30 if (derivationInput.Text == "False") 29 derivationInput.Enabled = false; 30 derivationInput.Checked = Content?.IsDerivation ?? false; 31 if (Content != null && !Content.IsDerivation) 31 32 numberderivationInput.ReadOnly = true; 32 }33 34 protected override void RegisterContentEvents() {35 base.RegisterContentEvents();36 Content.Changed += new EventHandler(Content_Changed);37 }38 39 protected override void DeregisterContentEvents() {40 base.DeregisterContentEvents();41 Content.Changed -= new EventHandler(Content_Changed);42 }43 44 private void Content_Changed(object sender, EventArgs e) {45 UpdateControls();46 33 } 47 34 … … 57 44 } 58 45 59 private void UpdateControls() { 60 if (Content == null) { 61 expressionInput.Text = string.Empty; 62 definitionInput.Text = string.Empty; 63 lowerboundInput.Text = string.Empty; 64 upperboundInput.Text = string.Empty; 65 lowerCombo.SelectedItem = null; 66 lowerCombo.SelectedText = "--Nothing set--"; 67 upperCombo.SelectedItem = null; 68 upperCombo.SelectedText = "--Nothing set--"; 69 } else { 70 expressionInput.Text = Content.Expression; 71 definitionInput.Text = Content.Definition; 72 lowerboundInput.Text = Content.Interval.LowerBound.ToString(CultureInfo.InvariantCulture); 73 upperboundInput.Text = Content.Interval.UpperBound.ToString(CultureInfo.InvariantCulture); 74 lowerCombo.SelectedIndex = lowerCombo.FindString(Content.InclusiveLowerBound ? "True" : "False"); 75 upperCombo.SelectedIndex = upperCombo.FindString(Content.InclusiveUpperBound ? "True" : "False"); 76 derivationInput.Text = Content.IsDerivation ? "True" : "False"; 77 variableInput.Text = Content.Variable; 78 numberderivationInput.Text = Content.NumberOfDerivation.ToString(); 79 } 80 SetEnabledStateOfControls(); 81 } 82 83 private void expressionInput_TextChanged(object sender, EventArgs e) { 84 85 } 86 87 private void variableInput_TextChanged(object sender, EventArgs e) { 88 89 } 90 91 private void numberderivationInput_TextChanged(object sender, EventArgs e) { 92 if (int.TryParse(numberderivationInput.Text, out var derivation)) { 93 if (derivation >= 0) { 94 Content.NumberOfDerivation = derivation; 95 errorProvider.SetError(numberderivationInput, string.Empty); 96 } else { 97 errorProvider.SetError(numberderivationInput, "Invalid Input: Derivation must be positive!"); 98 } 99 } else { 100 errorProvider.SetError(numberderivationInput, "Invalid Input: Derivation must be an integer!"); 101 } 102 } 103 104 private void lowerboundInput_TextChanged(object sender, EventArgs e) { 105 var value = ParseDoubleValue(lowerboundInput.Text, lowerboundInput); 106 if (!double.IsNaN(value)) { 107 if (value <= Content.Interval.UpperBound) { 108 Content.Interval = new Interval(value, Content.Interval.UpperBound); 109 errorProvider.SetError(lowerboundInput, string.Empty); 110 } else { 111 errorProvider.SetError(lowerboundInput, "Invalid Input: Lowerbound must be smaller than Upperbound!"); 112 } 113 } 114 } 46 47 48 #region helpers 115 49 116 50 private double ParseDoubleValue(string input, Control control) { … … 119 53 case "inf.": 120 54 case "+inf.": 55 case "Infinity": 121 56 return double.PositiveInfinity; 122 57 case "-inf.": 58 case "-Infinity": 123 59 return double.NegativeInfinity; 124 default: { 125 if (double.TryParse(input, out var value))60 default: { 61 if (double.TryParse(input, NumberStyles.Any, CultureInfo.InvariantCulture, out var value)) 126 62 return value; 127 63 else { … … 132 68 } 133 69 } 70 71 private void UpdateControls() { 72 if (Content == null) { 73 expressionInput.Text = string.Empty; 74 lowerboundInput.Text = string.Empty; 75 upperboundInput.Text = string.Empty; 76 incllowerboundInput.Checked = true; 77 inclupperboundInput.Checked = true; 78 } else { 79 expressionInput.Text = Content.Expression; 80 definitionInput.Text = Content.Definition; 81 lowerboundInput.Text = Content.Interval.LowerBound.ToString(CultureInfo.InvariantCulture); 82 upperboundInput.Text = Content.Interval.UpperBound.ToString(CultureInfo.InvariantCulture); 83 incllowerboundInput.Checked = Content.InclusiveLowerBound; 84 inclupperboundInput.Checked = Content.InclusiveUpperBound; 85 derivationInput.Checked = Content.IsDerivation; 86 variableInput.Text = Content.Variable; 87 numberderivationInput.Text = Content.NumberOfDerivation.ToString(); 88 } 89 SetEnabledStateOfControls(); 90 } 91 92 private void UpdateExpression() { 93 var expression = ""; 94 95 if (!Content.IsDerivation) { 96 expression = string.Format("{0} in {1}{2} .. {3}{4}", 97 Content.Variable, 98 (Content.InclusiveLowerBound) ? "[" : "]", 99 Content.Interval.LowerBound, 100 Content.Interval.UpperBound, 101 (Content.InclusiveUpperBound) ? "]" : "["); 102 } else { 103 expression = string.Format("\u2202Target/\u2202{0} in {1}{2} .. {3}{4}", 104 Content.Variable, 105 (Content.InclusiveLowerBound) ? "[" : "]", 106 Content.Interval.LowerBound, 107 Content.Interval.UpperBound, 108 (Content.InclusiveUpperBound) ? "]" : "["); 109 } 110 111 Content.Expression = expression; 112 Content.Name = expression; 113 UpdateControls(); 114 } 115 116 #endregion 117 118 #region content event handlers 119 120 private void numberderivationInput_Validating(object sender, CancelEventArgs e) { 121 if (int.TryParse(numberderivationInput.Text, out var derivation)) { 122 if (derivation >= 0) { 123 errorProvider.SetError(numberderivationInput, string.Empty); 124 e.Cancel = false; 125 } else { 126 errorProvider.SetError(numberderivationInput, "Invalid Input: Derivation must be positive!"); 127 e.Cancel = true; 128 } 129 } else { 130 errorProvider.SetError(numberderivationInput, "Invalid Input: Derivation must be an integer!"); 131 e.Cancel = true; 132 } 133 } 134 135 private void numberderivationInput_Validated(object sender, EventArgs e) { 136 if (int.TryParse(numberderivationInput.Text, out var derivation)) { 137 Content.NumberOfDerivation = derivation; 138 UpdateExpression(); 139 } 140 } 141 142 private void lowerboundInput_Validating(object sender, CancelEventArgs e) { 143 var value = ParseDoubleValue(lowerboundInput.Text, lowerboundInput); 144 if (!double.IsNaN(value)) { 145 if (value <= Content.Interval.UpperBound) { 146 errorProvider.SetError(lowerboundInput, string.Empty); 147 e.Cancel = false; 148 } else { 149 errorProvider.SetError(lowerboundInput, "Invalid Input: Lowerbound must be smaller than Upperbound!"); 150 e.Cancel = true; 151 } 152 } else { 153 e.Cancel = true; 154 } 155 } 156 157 private void lowerboundInput_Validated(object sender, EventArgs e) { 158 var value = ParseDoubleValue(lowerboundInput.Text, lowerboundInput); 159 if (!double.IsNaN(value)) { 160 Content.Interval = new Interval(value, Content.Interval.UpperBound); 161 UpdateExpression(); 162 } 163 } 164 165 private void upperboundInput_Validating(object sender, CancelEventArgs e) { 166 var value = ParseDoubleValue(upperboundInput.Text, upperboundInput); 167 if (!double.IsNaN(value)) { 168 if (value >= Content.Interval.LowerBound) { 169 errorProvider.SetError(upperboundInput, string.Empty); 170 e.Cancel = false; 171 } else { 172 errorProvider.SetError(lowerboundInput, "Invalid Input: Upperbound must be bigger than Lowerbound!"); 173 e.Cancel = true; 174 } 175 } else { 176 e.Cancel = true; 177 } 178 } 179 180 private void upperboundInput_Validated(object sender, EventArgs e) { 181 var value = ParseDoubleValue(upperboundInput.Text, upperboundInput); 182 if (!double.IsNaN(value)) { 183 Content.Interval = new Interval(Content.Interval.LowerBound, value); 184 UpdateExpression(); 185 } 186 } 187 188 private void incllowerboundInput_CheckedChanged(object sender, EventArgs e) { 189 if (Content.InclusiveLowerBound != incllowerboundInput.Checked) { 190 Content.InclusiveLowerBound = incllowerboundInput.Checked; 191 UpdateExpression(); 192 } 193 194 195 } 196 197 private void inclupperboundInput_CheckedChanged(object sender, EventArgs e) { 198 if (Content.InclusiveUpperBound != incllowerboundInput.Checked) { 199 Content.InclusiveUpperBound = incllowerboundInput.Checked; 200 UpdateExpression(); 201 } 202 } 203 #endregion 204 205 134 206 } 135 207 } -
branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis.Views/3.4/ParsedConstraintView.cs
r16774 r16776 9 9 [Content(typeof(ParsedConstraint), true)] 10 10 public partial class ParsedConstraintView : AsynchronousContentView { 11 11 private CheckedItemList<IntervalConstraint> intervalConstraints; 12 12 public new ParsedConstraint Content { 13 13 get => (ParsedConstraint)base.Content; … … 18 18 InitializeComponent(); 19 19 errorOutput.Text = ""; 20 intervalConstraints = new CheckedItemList<IntervalConstraint>(); 21 } 22 23 private void Content_Changed(object sender, EventArgs e) { 24 constraintsOutput.Content = intervalConstraints; 20 25 } 21 26 22 27 protected override void OnContentChanged() { 23 28 base.OnContentChanged(); 24 if (Content == null) { 25 constraintsInput.Text = string.Empty; 26 errorOutput.Text = ""; 27 } else { 28 constraintsInput.Text = Content.Input; 29 constraintsOutput.Content = new ItemList<IntervalConstraint>(Content.Constraints) ?? new ItemList<IntervalConstraint>(); 30 } 29 UpdateControl(); 31 30 } 32 31 33 private ItemList<IntervalConstraint> ParseConstraints(string input) {34 ItemList<IntervalConstraint> constraints = newItemList<IntervalConstraint>(IntervalConstraintsParser.ParseInput(input, Content.ProblemData.TargetVariable, Content.ProblemData.AllowedInputVariables));32 private CheckedItemList<IntervalConstraint> ParseConstraints(string input) { 33 CheckedItemList<IntervalConstraint> constraints = new CheckedItemList<IntervalConstraint>(IntervalConstraintsParser.ParseInput(input, Content.ProblemData.TargetVariable, Content.ProblemData.AllowedInputVariables)); 35 34 return constraints; 36 35 } … … 48 47 } 49 48 49 private void UpdateControl() { 50 if (Content == null) { 51 ClearConstraints(); 52 constraintsInput.Text = string.Empty; 53 errorOutput.Text = string.Empty; 54 constraintsOutput.Content = intervalConstraints; 55 } else { 56 constraintsInput.Text = Content.Input; 57 foreach (var constraint in Content.Constraints) { 58 constraint.Changed += new EventHandler(Content_Changed); 59 intervalConstraints.Add(constraint, true); 60 } 61 } 62 } 63 50 64 private void constraintsInput_TextChanged(object sender, EventArgs e) { 51 65 errorOutput.Text = "Unparsed changes! Press parse button to save changes."; 52 66 } 67 68 private void ClearConstraints() { 69 foreach (var constraint in intervalConstraints) { 70 constraint.Changed -= new EventHandler(Content_Changed); 71 } 72 intervalConstraints.Clear(); 73 } 74 53 75 } 54 76 } -
branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis.Views/3.4/ParsedConstraintView.designer.cs
r16774 r16776 31 31 this.label1 = new System.Windows.Forms.Label(); 32 32 //this.constraintsOutput = new System.Windows.Forms.Label(); 33 this.constraintsOutput = new HeuristicLab.Core.Views. ItemListView<IntervalConstraint>();33 this.constraintsOutput = new HeuristicLab.Core.Views.CheckedItemListView<IntervalConstraint>(); 34 34 this.errorOutput = new System.Windows.Forms.Label(); 35 35 ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); … … 149 149 150 150 //private System.Windows.Forms.Label constraintsOutput; 151 private HeuristicLab.Core.Views. ItemListView<IntervalConstraint> constraintsOutput;151 private HeuristicLab.Core.Views.CheckedItemListView<IntervalConstraint> constraintsOutput; 152 152 } 153 153 } -
branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Parser/IntervalConstraint.cs
r16774 r16776 12 12 [Item("Interval Constraint", "Constraint on intervals.")] 13 13 public class IntervalConstraint : NamedItem { 14 public string Expression { get; set; } 14 private string expression; 15 public string Expression { 16 get => expression; 17 set { 18 if (value != expression) { 19 expression = value; 20 } 21 } 22 } 15 23 public string Definition { get; set; } 16 24 public Interval Interval { get; set; } 17 public bool InclusiveLowerBound { get; set; } 25 private bool inclusiveLowerBound; 26 27 public bool InclusiveLowerBound { 28 get => inclusiveLowerBound; 29 set { 30 if (value != inclusiveLowerBound) { 31 inclusiveLowerBound = value; 32 OnChanged(EventArgs.Empty); 33 } 34 } 35 } 18 36 public bool InclusiveUpperBound { get; set; } 19 37 public bool IsDerivation { get; set; } -
branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionProblemData.cs
r16774 r16776 181 181 "#double: upperbound of the interval" + Environment.NewLine + 182 182 "#bracket: open or closed regarding to open or closed interval definition" + Environment.NewLine + 183 "# Y2 in [0 .. 1.2]" + Environment.NewLine + Environment.NewLine +183 "#Target:Y2 in [0 .. 1.2]" + Environment.NewLine + Environment.NewLine + 184 184 "#Constraints on model parameters:" + Environment.NewLine + 185 185 "#derivation symbol: d or ∂" + Environment.NewLine + -
branches/2971_named_intervals/HeuristicLab.Problems.DataAnalysis/3.4/ParsedConstraint.cs
r16774 r16776 25 25 public IEnumerable<IntervalConstraint> Constraints { 26 26 get => constraints; 27 set => constraints = value; 28 } 27 set { 28 constraints = value; 29 OnChanged(EventArgs.Empty); 30 } 31 } 29 32 30 33 protected IRegressionProblemData problemData; … … 38 41 : base(original, cloner) { 39 42 this.input = original.Input ?? string.Empty; 40 this.constraints = original.Constraints ?? new ItemList<IntervalConstraint>();43 this.constraints = original.Constraints ?? new CheckedItemList<IntervalConstraint>(); 41 44 42 45 } … … 48 51 public ParsedConstraint() { 49 52 this.input = string.Empty; 50 this.constraints = new ItemList<IntervalConstraint>();53 this.constraints = new CheckedItemList<IntervalConstraint>(); 51 54 } 52 55 53 56 public ParsedConstraint(string input, IRegressionProblemData problemData) { 54 57 this.input = input; 55 this.constraints = new ItemList<IntervalConstraint>();58 this.constraints = new CheckedItemList<IntervalConstraint>(); 56 59 this.problemData = problemData; 57 60 } … … 61 64 this.constraints = constraints; 62 65 } 66 67 public event EventHandler Changed; 68 protected virtual void OnChanged(EventArgs e) { 69 EventHandler handlers = Changed; 70 if (handlers != null) 71 handlers(this, e); 72 } 63 73 } 64 74 }
Note: See TracChangeset
for help on using the changeset viewer.