Changeset 5750 for branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4
- Timestamp:
- 03/18/11 12:50:28 (13 years ago)
- Location:
- branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/RunCollectionVariableImpactView.cs
r5693 r5750 34 34 [View("RunCollection Variable Impact View")] 35 35 public sealed partial class RunCollectionVariableImpactView : AsynchronousContentView { 36 private const string variableImpactResultName = " Integrated variable frequencies";36 private const string variableImpactResultName = "Variable impacts"; 37 37 public RunCollectionVariableImpactView() { 38 38 InitializeComponent(); -
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/VariableView.Designer.cs
r5693 r5750 55 55 this.additiveWeightChangeLabel = new System.Windows.Forms.Label(); 56 56 this.additiveWeightChangeSigmaTextBox = new System.Windows.Forms.TextBox(); 57 this.tabControl = new System.Windows.Forms.TabControl(); 58 this.variableNamesTabPage = new System.Windows.Forms.TabPage(); 59 this.parametersTabPage = new System.Windows.Forms.TabPage(); 57 60 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit(); 58 61 this.initializationGroupBox.SuspendLayout(); 59 62 this.mutationGroupBox.SuspendLayout(); 63 this.tabControl.SuspendLayout(); 64 this.parametersTabPage.SuspendLayout(); 60 65 this.SuspendLayout(); 61 66 // … … 67 72 // 68 73 this.errorProvider.SetIconAlignment(this.initialFrequencyTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft); 69 this.initialFrequencyTextBox.Size = new System.Drawing.Size(2 03, 20);74 this.initialFrequencyTextBox.Size = new System.Drawing.Size(285, 20); 70 75 // 71 76 // nameTextBox … … 73 78 this.errorProvider.SetIconAlignment(this.nameTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft); 74 79 this.errorProvider.SetIconPadding(this.nameTextBox, 2); 75 this.nameTextBox.Size = new System.Drawing.Size(2 03, 20);80 this.nameTextBox.Size = new System.Drawing.Size(285, 20); 76 81 // 77 82 // descriptionTextBox 78 83 // 79 84 this.errorProvider.SetIconAlignment(this.descriptionTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft); 80 this.descriptionTextBox.Size = new System.Drawing.Size(2 03, 20);85 this.descriptionTextBox.Size = new System.Drawing.Size(285, 20); 81 86 // 82 87 // weightMuLabel … … 96 101 this.weightInitializationMuTextBox.Location = new System.Drawing.Point(92, 19); 97 102 this.weightInitializationMuTextBox.Name = "weightInitializationMuTextBox"; 98 this.weightInitializationMuTextBox.Size = new System.Drawing.Size(2 22, 20);103 this.weightInitializationMuTextBox.Size = new System.Drawing.Size(266, 20); 99 104 this.weightInitializationMuTextBox.TabIndex = 7; 100 105 this.toolTip.SetToolTip(this.weightInitializationMuTextBox, "The mu (mean) parameter of the normal distribution from which to sample the initi" + … … 110 115 this.initializationGroupBox.Controls.Add(this.weightMuLabel); 111 116 this.initializationGroupBox.Controls.Add(this.weightInitializationMuTextBox); 112 this.initializationGroupBox.Location = new System.Drawing.Point( 3, 79);117 this.initializationGroupBox.Location = new System.Drawing.Point(6, 6); 113 118 this.initializationGroupBox.Name = "initializationGroupBox"; 114 this.initializationGroupBox.Size = new System.Drawing.Size(3 20, 73);119 this.initializationGroupBox.Size = new System.Drawing.Size(364, 73); 115 120 this.initializationGroupBox.TabIndex = 8; 116 121 this.initializationGroupBox.TabStop = false; … … 133 138 this.weightInitializationSigmaTextBox.Location = new System.Drawing.Point(92, 45); 134 139 this.weightInitializationSigmaTextBox.Name = "weightInitializationSigmaTextBox"; 135 this.weightInitializationSigmaTextBox.Size = new System.Drawing.Size(2 22, 20);140 this.weightInitializationSigmaTextBox.Size = new System.Drawing.Size(266, 20); 136 141 this.weightInitializationSigmaTextBox.TabIndex = 9; 137 142 this.toolTip.SetToolTip(this.weightInitializationSigmaTextBox, "The sigma parameter for the normal distribution from which to sample the initial " + … … 147 152 this.mutationGroupBox.Controls.Add(this.additiveWeightChangeLabel); 148 153 this.mutationGroupBox.Controls.Add(this.additiveWeightChangeSigmaTextBox); 149 this.mutationGroupBox.Location = new System.Drawing.Point( 3, 158);154 this.mutationGroupBox.Location = new System.Drawing.Point(6, 85); 150 155 this.mutationGroupBox.Name = "mutationGroupBox"; 151 this.mutationGroupBox.Size = new System.Drawing.Size(3 20, 73);156 this.mutationGroupBox.Size = new System.Drawing.Size(364, 73); 152 157 this.mutationGroupBox.TabIndex = 9; 153 158 this.mutationGroupBox.TabStop = false; … … 171 176 this.multiplicativeWeightChangeSigmaTextBox.Location = new System.Drawing.Point(201, 45); 172 177 this.multiplicativeWeightChangeSigmaTextBox.Name = "multiplicativeWeightChangeSigmaTextBox"; 173 this.multiplicativeWeightChangeSigmaTextBox.Size = new System.Drawing.Size(1 13, 20);178 this.multiplicativeWeightChangeSigmaTextBox.Size = new System.Drawing.Size(157, 20); 174 179 this.multiplicativeWeightChangeSigmaTextBox.TabIndex = 9; 175 180 this.toolTip.SetToolTip(this.multiplicativeWeightChangeSigmaTextBox, "The sigma (std.dev.) parameter for the normal distribution to sample a multiplica" + … … 194 199 this.additiveWeightChangeSigmaTextBox.Location = new System.Drawing.Point(201, 19); 195 200 this.additiveWeightChangeSigmaTextBox.Name = "additiveWeightChangeSigmaTextBox"; 196 this.additiveWeightChangeSigmaTextBox.Size = new System.Drawing.Size(1 13, 20);201 this.additiveWeightChangeSigmaTextBox.Size = new System.Drawing.Size(157, 20); 197 202 this.additiveWeightChangeSigmaTextBox.TabIndex = 7; 198 203 this.toolTip.SetToolTip(this.additiveWeightChangeSigmaTextBox, "The sigma (std.dev.) parameter for the normal distribution to sample an additive " + … … 200 205 this.additiveWeightChangeSigmaTextBox.TextChanged += new System.EventHandler(this.additiveWeightChangeSigmaTextBox_TextChanged); 201 206 // 207 // tabControl 208 // 209 this.tabControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 210 | System.Windows.Forms.AnchorStyles.Left) 211 | System.Windows.Forms.AnchorStyles.Right))); 212 this.tabControl.Controls.Add(this.variableNamesTabPage); 213 this.tabControl.Controls.Add(this.parametersTabPage); 214 this.tabControl.Location = new System.Drawing.Point(3, 79); 215 this.tabControl.Name = "tabControl"; 216 this.tabControl.SelectedIndex = 0; 217 this.tabControl.Size = new System.Drawing.Size(399, 212); 218 this.tabControl.TabIndex = 10; 219 // 220 // variableNamesTabPage 221 // 222 this.variableNamesTabPage.Location = new System.Drawing.Point(4, 22); 223 this.variableNamesTabPage.Name = "variableNamesTabPage"; 224 this.variableNamesTabPage.Padding = new System.Windows.Forms.Padding(3); 225 this.variableNamesTabPage.Size = new System.Drawing.Size(391, 186); 226 this.variableNamesTabPage.TabIndex = 0; 227 this.variableNamesTabPage.Text = "Variable Names"; 228 this.variableNamesTabPage.UseVisualStyleBackColor = true; 229 // 230 // parametersTabPage 231 // 232 this.parametersTabPage.Controls.Add(this.mutationGroupBox); 233 this.parametersTabPage.Controls.Add(this.initializationGroupBox); 234 this.parametersTabPage.Location = new System.Drawing.Point(4, 22); 235 this.parametersTabPage.Name = "parametersTabPage"; 236 this.parametersTabPage.Padding = new System.Windows.Forms.Padding(3); 237 this.parametersTabPage.Size = new System.Drawing.Size(391, 186); 238 this.parametersTabPage.TabIndex = 1; 239 this.parametersTabPage.Text = "Parameters"; 240 this.parametersTabPage.UseVisualStyleBackColor = true; 241 // 202 242 // VariableView 203 243 // 204 244 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 205 245 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 206 this.Controls.Add(this.mutationGroupBox); 207 this.Controls.Add(this.initializationGroupBox); 246 this.Controls.Add(this.tabControl); 208 247 this.Name = "VariableView"; 209 this.Size = new System.Drawing.Size(326, 235); 210 this.Controls.SetChildIndex(this.initializationGroupBox, 0); 248 this.Size = new System.Drawing.Size(408, 294); 211 249 this.Controls.SetChildIndex(this.initialFrequencyTextBox, 0); 212 250 this.Controls.SetChildIndex(this.initialFrequencyLabel, 0); … … 215 253 this.Controls.SetChildIndex(this.nameTextBox, 0); 216 254 this.Controls.SetChildIndex(this.descriptionTextBox, 0); 217 this.Controls.SetChildIndex(this. mutationGroupBox, 0);255 this.Controls.SetChildIndex(this.tabControl, 0); 218 256 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit(); 219 257 this.initializationGroupBox.ResumeLayout(false); … … 221 259 this.mutationGroupBox.ResumeLayout(false); 222 260 this.mutationGroupBox.PerformLayout(); 261 this.tabControl.ResumeLayout(false); 262 this.parametersTabPage.ResumeLayout(false); 223 263 this.ResumeLayout(false); 224 264 this.PerformLayout(); … … 238 278 private System.Windows.Forms.Label additiveWeightChangeLabel; 239 279 private System.Windows.Forms.TextBox additiveWeightChangeSigmaTextBox; 240 280 private System.Windows.Forms.TabControl tabControl; 281 private System.Windows.Forms.TabPage variableNamesTabPage; 282 private System.Windows.Forms.TabPage parametersTabPage; 241 283 } 242 284 } -
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/VariableView.cs
r5693 r5750 21 21 22 22 using System; 23 using System.Linq; 23 24 using System.Windows.Forms; 24 25 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views; 25 26 using HeuristicLab.MainForm; 26 27 using HeuristicLab.MainForm.WindowsForms; 28 using HeuristicLab.Core; 29 using HeuristicLab.Data; 30 using HeuristicLab.Core.Views; 31 using HeuristicLab.Collections; 27 32 28 33 29 34 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Views { 35 30 36 [View("Variable View")] 31 37 [Content(typeof(Variable), true)] 32 38 public partial class VariableView : SymbolView { 39 private CheckedItemCollectionView<StringValue> variableNamesView; 40 33 41 public new Variable Content { 34 42 get { return (Variable)base.Content; } … … 38 46 public VariableView() { 39 47 InitializeComponent(); 48 variableNamesView = new CheckedItemCollectionView<StringValue>(); 49 variableNamesView.Dock = DockStyle.Fill; 50 variableNamesTabPage.Controls.Add(variableNamesView); 51 variableNamesView.Content = new CheckedItemCollection<StringValue>(); 52 53 RegisterVariableNamesViewContentEvents(); 40 54 } 55 56 private void RegisterVariableNamesViewContentEvents() { 57 variableNamesView.Content.ItemsAdded += new CollectionItemsChangedEventHandler<StringValue>(variableNames_Changed); 58 variableNamesView.Content.ItemsRemoved += new CollectionItemsChangedEventHandler<StringValue>(variableNames_Changed); 59 variableNamesView.Content.CheckedItemsChanged += new CollectionItemsChangedEventHandler<StringValue>(variableNames_Changed); 60 variableNamesView.Content.CollectionReset += new CollectionItemsChangedEventHandler<StringValue>(variableNames_Changed); 61 } 62 63 private void DeregisterVariableNamesViewContentEvents() { 64 variableNamesView.Content.ItemsAdded -= new CollectionItemsChangedEventHandler<StringValue>(variableNames_Changed); 65 variableNamesView.Content.ItemsRemoved -= new CollectionItemsChangedEventHandler<StringValue>(variableNames_Changed); 66 variableNamesView.Content.CheckedItemsChanged -= new CollectionItemsChangedEventHandler<StringValue>(variableNames_Changed); 67 variableNamesView.Content.CollectionReset -= new CollectionItemsChangedEventHandler<StringValue>(variableNames_Changed); 68 } 69 41 70 42 71 protected override void RegisterContentEvents() { … … 74 103 75 104 #region control event handlers 105 private void variableNames_Changed(object sender, CollectionItemsChangedEventArgs<StringValue> args) { 106 if (Content != null) { 107 Content.VariableNames = variableNamesView.Content.CheckedItems.Select(x => x.Value).ToList(); 108 } 109 } 110 76 111 private void weightMuTextBox_TextChanged(object sender, EventArgs e) { 77 112 double nu; … … 121 156 additiveWeightChangeSigmaTextBox.Text = string.Empty; 122 157 multiplicativeWeightChangeSigmaTextBox.Text = string.Empty; 158 // temporarily deregister to prevent circular calling of events 159 DeregisterVariableNamesViewContentEvents(); 160 variableNamesView.Content.Clear(); 161 RegisterVariableNamesViewContentEvents(); 123 162 } else { 163 var existingEntries = variableNamesView.Content.Select(x => x.Value); 164 165 // temporarily deregister to prevent circular calling of events 166 DeregisterVariableNamesViewContentEvents(); 167 // add additional entries 168 foreach (var variableName in Content.VariableNames.Except(existingEntries)) { 169 variableNamesView.Content.Add(new StringValue(variableName), true); 170 } 171 RegisterVariableNamesViewContentEvents(); 172 124 173 weightInitializationMuTextBox.Text = Content.WeightMu.ToString(); 125 174 weightInitializationSigmaTextBox.Text = Content.WeightSigma.ToString();
Note: See TracChangeset
for help on using the changeset viewer.