Changeset 17444
- Timestamp:
- 02/18/20 16:28:53 (5 years ago)
- Location:
- branches/3026_IntegrationIntoSymSpace
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Shared/JsonItemBaseControl.Designer.cs
r17443 r17444 24 24 /// </summary> 25 25 private void InitializeComponent() { 26 this.components = new System.ComponentModel.Container(); 26 27 this.labelEnable = new System.Windows.Forms.Label(); 27 28 this.checkBoxActive = new System.Windows.Forms.CheckBox(); … … 32 33 this.labelDescription = new System.Windows.Forms.Label(); 33 34 this.textBoxDescription = new System.Windows.Forms.TextBox(); 35 this.errorProvider = new System.Windows.Forms.ErrorProvider(this.components); 36 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit(); 34 37 this.SuspendLayout(); 35 38 // … … 77 80 this.textBoxName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 78 81 | System.Windows.Forms.AnchorStyles.Right))); 82 this.errorProvider.SetIconAlignment(this.textBoxName, System.Windows.Forms.ErrorIconAlignment.MiddleLeft); 79 83 this.textBoxName.Location = new System.Drawing.Point(92, 23); 80 84 this.textBoxName.Name = "textBoxName"; 81 85 this.textBoxName.Size = new System.Drawing.Size(402, 20); 82 86 this.textBoxName.TabIndex = 10; 87 this.textBoxName.Validating += new System.ComponentModel.CancelEventHandler(this.textBoxName_Validating); 83 88 // 84 89 // label1 … … 110 115 this.textBoxDescription.TabIndex = 14; 111 116 // 117 // errorProvider 118 // 119 this.errorProvider.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.NeverBlink; 120 this.errorProvider.ContainerControl = this; 121 // 112 122 // JsonItemBaseControl 113 123 // … … 122 132 this.Controls.Add(this.textBoxName); 123 133 this.Controls.Add(this.label1); 134 this.errorProvider.SetIconAlignment(this, System.Windows.Forms.ErrorIconAlignment.MiddleLeft); 124 135 this.Name = "JsonItemBaseControl"; 125 136 this.Padding = new System.Windows.Forms.Padding(3); 126 137 this.Size = new System.Drawing.Size(500, 154); 138 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit(); 127 139 this.ResumeLayout(false); 128 140 this.PerformLayout(); … … 140 152 private System.Windows.Forms.Label labelDescription; 141 153 private System.Windows.Forms.TextBox textBoxDescription; 154 protected System.Windows.Forms.ErrorProvider errorProvider; 142 155 } 143 156 } -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Shared/JsonItemBaseControl.cs
r17443 r17444 31 31 else 32 32 textBoxActualName.Text = VM.Item.ActualName; 33 33 34 } 35 36 private void textBoxName_Validating(object sender, CancelEventArgs e) { 37 if(string.IsNullOrWhiteSpace(textBoxName.Text)) { 38 errorProvider.SetError(textBoxName, "Name must not be empty."); 39 e.Cancel = true; 40 } else { 41 errorProvider.SetError(textBoxName, null); 42 } 34 43 } 35 44 } -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Shared/JsonItemBaseControl.resx
r17404 r17444 118 118 <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 119 119 </resheader> 120 <metadata name="errorProvider.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> 121 <value>17, 17</value> 122 </metadata> 120 123 </root> -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Shared/NumericRangeControl.Designer.cs
r17411 r17444 24 24 /// </summary> 25 25 private void InitializeComponent() { 26 this.components = new System.ComponentModel.Container(); 26 27 this.textBoxFrom = new System.Windows.Forms.TextBox(); 27 28 this.label6 = new System.Windows.Forms.Label(); 28 29 this.groupBox2 = new System.Windows.Forms.GroupBox(); 29 this.checkBoxFrom = new System.Windows.Forms.CheckBox();30 30 this.checkBoxTo = new System.Windows.Forms.CheckBox(); 31 31 this.textBoxTo = new System.Windows.Forms.TextBox(); 32 32 this.label1 = new System.Windows.Forms.Label(); 33 this.checkBoxFrom = new System.Windows.Forms.CheckBox(); 34 this.errorProvider = new System.Windows.Forms.ErrorProvider(this.components); 33 35 this.groupBox2.SuspendLayout(); 36 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit(); 34 37 this.SuspendLayout(); 35 38 // … … 38 41 this.textBoxFrom.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 39 42 | System.Windows.Forms.AnchorStyles.Right))); 40 this.textBoxFrom.Location = new System.Drawing.Point(36, 36); 43 this.errorProvider.SetIconAlignment(this.textBoxFrom, System.Windows.Forms.ErrorIconAlignment.MiddleLeft); 44 this.textBoxFrom.Location = new System.Drawing.Point(67, 17); 41 45 this.textBoxFrom.Name = "textBoxFrom"; 42 46 this.textBoxFrom.ReadOnly = true; 43 this.textBoxFrom.Size = new System.Drawing.Size( 164, 20);47 this.textBoxFrom.Size = new System.Drawing.Size(253, 20); 44 48 this.textBoxFrom.TabIndex = 2; 49 this.textBoxFrom.Validating += new System.ComponentModel.CancelEventHandler(this.textBoxFrom_Validating); 45 50 // 46 51 // label6 … … 49 54 | System.Windows.Forms.AnchorStyles.Right))); 50 55 this.label6.AutoSize = true; 51 this.label6.Location = new System.Drawing.Point( 7, 20);56 this.label6.Location = new System.Drawing.Point(31, 21); 52 57 this.label6.Name = "label6"; 53 58 this.label6.Size = new System.Drawing.Size(30, 13); … … 57 62 // groupBox2 58 63 // 59 this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)60 | System.Windows.Forms.AnchorStyles.Right)));61 64 this.groupBox2.Controls.Add(this.checkBoxTo); 62 65 this.groupBox2.Controls.Add(this.textBoxTo); … … 65 68 this.groupBox2.Controls.Add(this.textBoxFrom); 66 69 this.groupBox2.Controls.Add(this.label6); 67 this.groupBox2.Location = new System.Drawing.Point(0, 3); 70 this.groupBox2.Dock = System.Windows.Forms.DockStyle.Fill; 71 this.groupBox2.Location = new System.Drawing.Point(0, 0); 68 72 this.groupBox2.Name = "groupBox2"; 69 this.groupBox2.Size = new System.Drawing.Size( 206, 109);73 this.groupBox2.Size = new System.Drawing.Size(326, 75); 70 74 this.groupBox2.TabIndex = 19; 71 75 this.groupBox2.TabStop = false; 72 76 this.groupBox2.Text = "Range"; 73 77 // 74 // checkBoxFrom75 //76 this.checkBoxFrom.AutoSize = true;77 this.checkBoxFrom.Location = new System.Drawing.Point(10, 39);78 this.checkBoxFrom.Name = "checkBoxFrom";79 this.checkBoxFrom.Size = new System.Drawing.Size(15, 14);80 this.checkBoxFrom.TabIndex = 4;81 this.checkBoxFrom.UseVisualStyleBackColor = true;82 //83 78 // checkBoxTo 84 79 // 85 80 this.checkBoxTo.AutoSize = true; 86 this.checkBoxTo.Location = new System.Drawing.Point(10, 78);81 this.checkBoxTo.Location = new System.Drawing.Point(10, 46); 87 82 this.checkBoxTo.Name = "checkBoxTo"; 88 83 this.checkBoxTo.Size = new System.Drawing.Size(15, 14); … … 94 89 this.textBoxTo.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 95 90 | System.Windows.Forms.AnchorStyles.Right))); 96 this.textBoxTo.Location = new System.Drawing.Point(36, 75); 91 this.errorProvider.SetIconAlignment(this.textBoxTo, System.Windows.Forms.ErrorIconAlignment.TopLeft); 92 this.textBoxTo.Location = new System.Drawing.Point(67, 43); 97 93 this.textBoxTo.Name = "textBoxTo"; 98 94 this.textBoxTo.ReadOnly = true; 99 this.textBoxTo.Size = new System.Drawing.Size( 164, 20);95 this.textBoxTo.Size = new System.Drawing.Size(253, 20); 100 96 this.textBoxTo.TabIndex = 6; 97 this.textBoxTo.Validating += new System.ComponentModel.CancelEventHandler(this.textBoxTo_Validating); 101 98 // 102 99 // label1 … … 105 102 | System.Windows.Forms.AnchorStyles.Right))); 106 103 this.label1.AutoSize = true; 107 this.label1.Location = new System.Drawing.Point( 7, 59);104 this.label1.Location = new System.Drawing.Point(31, 46); 108 105 this.label1.Name = "label1"; 109 106 this.label1.Size = new System.Drawing.Size(20, 13); 110 107 this.label1.TabIndex = 5; 111 108 this.label1.Text = "To"; 109 // 110 // checkBoxFrom 111 // 112 this.checkBoxFrom.AutoSize = true; 113 this.checkBoxFrom.Location = new System.Drawing.Point(10, 20); 114 this.checkBoxFrom.Name = "checkBoxFrom"; 115 this.checkBoxFrom.Size = new System.Drawing.Size(15, 14); 116 this.checkBoxFrom.TabIndex = 4; 117 this.checkBoxFrom.UseVisualStyleBackColor = true; 118 // 119 // errorProvider 120 // 121 this.errorProvider.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.NeverBlink; 122 this.errorProvider.ContainerControl = this; 112 123 // 113 124 // NumericRangeControl … … 117 128 this.Controls.Add(this.groupBox2); 118 129 this.Name = "NumericRangeControl"; 119 this.Size = new System.Drawing.Size( 206, 112);130 this.Size = new System.Drawing.Size(326, 75); 120 131 this.groupBox2.ResumeLayout(false); 121 132 this.groupBox2.PerformLayout(); 133 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit(); 122 134 this.ResumeLayout(false); 123 135 … … 132 144 private System.Windows.Forms.Label label1; 133 145 private System.Windows.Forms.CheckBox checkBoxFrom; 146 private System.Windows.Forms.ErrorProvider errorProvider; 134 147 } 135 148 } -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Shared/NumericRangeControl.cs
r17411 r17444 33 33 textBoxFrom.ReadOnly = !checkBoxFrom.Checked; 34 34 } 35 36 private void textBoxFrom_Validating(object sender, CancelEventArgs e) { 37 if (string.IsNullOrWhiteSpace(textBoxFrom.Text)) { 38 errorProvider.SetError(textBoxFrom, "'From' must not be empty."); 39 e.Cancel = true; 40 } else { 41 errorProvider.SetError(textBoxFrom, null); 42 } 43 } 44 45 private void textBoxTo_Validating(object sender, CancelEventArgs e) { 46 if (string.IsNullOrWhiteSpace(textBoxTo.Text)) { 47 errorProvider.SetError(textBoxTo, "'To' must not be empty."); 48 e.Cancel = true; 49 } else { 50 errorProvider.SetError(textBoxTo, null); 51 } 52 } 35 53 } 36 54 } -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Shared/NumericRangeControl.resx
r17405 r17444 118 118 <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 119 119 </resheader> 120 <metadata name="errorProvider.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> 121 <value>17, 17</value> 122 </metadata> 120 123 </root> -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/JsonItemVMBase.cs
r17439 r17444 9 9 10 10 namespace HeuristicLab.JsonInterface.OptimizerIntegration { 11 public class JsonItemVMBase : INotifyPropertyChanged {11 public class JsonItemVMBase : INotifyPropertyChanged, IDisposable { 12 12 public event PropertyChangedEventHandler PropertyChanged; 13 13 public event Action ItemChanged; … … 17 17 get => item; 18 18 set { 19 item?.LoosenPath(); 19 20 item = value; 21 item.FixatePath(); 20 22 ItemChanged?.Invoke(); 21 23 } … … 80 82 } 81 83 84 #region IDisposable Support 85 private bool disposedValue = false; // To detect redundant calls 86 87 protected virtual void Dispose(bool disposing) { 88 if (!disposedValue) { 89 if (disposing) { 90 item.LoosenPath(); 91 item = null; 92 } 93 disposedValue = true; 94 } 95 } 96 97 // This code added to correctly implement the disposable pattern. 98 public void Dispose() { 99 // Do not change this code. Put cleanup code in Dispose(bool disposing) above. 100 Dispose(true); 101 } 102 #endregion 82 103 } 83 104 } -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/ExportJsonDialog.Designer.cs
r17443 r17444 33 33 this.groupBox2 = new System.Windows.Forms.GroupBox(); 34 34 this.groupBox3 = new System.Windows.Forms.GroupBox(); 35 this.treeViewResults = new System.Windows.Forms.TreeView(); 35 36 this.splitContainer2 = new System.Windows.Forms.SplitContainer(); 36 37 this.tabControl1 = new System.Windows.Forms.TabControl(); 37 38 this.tabPage1 = new System.Windows.Forms.TabPage(); 38 39 this.tabPage2 = new System.Windows.Forms.TabPage(); 40 this.label1 = new System.Windows.Forms.Label(); 41 this.textBoxTemplateName = new System.Windows.Forms.TextBox(); 42 this.errorProvider = new System.Windows.Forms.ErrorProvider(this.components); 39 43 this.jsonItemBindingSource = new System.Windows.Forms.BindingSource(this.components); 40 this.treeViewResults = new System.Windows.Forms.TreeView();41 44 this.groupBoxDetails.SuspendLayout(); 42 45 this.groupBox2.SuspendLayout(); … … 49 52 this.tabPage1.SuspendLayout(); 50 53 this.tabPage2.SuspendLayout(); 54 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit(); 51 55 ((System.ComponentModel.ISupportInitialize)(this.jsonItemBindingSource)).BeginInit(); 52 56 this.SuspendLayout(); … … 60 64 // exportButton 61 65 // 62 this.exportButton.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) 63 | System.Windows.Forms.AnchorStyles.Right))); 64 this.exportButton.Location = new System.Drawing.Point(591, 578); 66 this.exportButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); 67 this.exportButton.Location = new System.Drawing.Point(629, 578); 65 68 this.exportButton.Name = "exportButton"; 66 this.exportButton.Size = new System.Drawing.Size( 229, 29);69 this.exportButton.Size = new System.Drawing.Size(191, 29); 67 70 this.exportButton.TabIndex = 1; 68 71 this.exportButton.Text = "Export"; … … 78 81 this.treeView.Location = new System.Drawing.Point(6, 19); 79 82 this.treeView.Name = "treeView"; 80 this.treeView.Size = new System.Drawing.Size(352, 4 97);83 this.treeView.Size = new System.Drawing.Size(352, 471); 81 84 this.treeView.TabIndex = 3; 82 85 this.treeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeView_AfterSelect); … … 90 93 this.groupBoxDetails.Location = new System.Drawing.Point(3, 0); 91 94 this.groupBoxDetails.Name = "groupBoxDetails"; 92 this.groupBoxDetails.Size = new System.Drawing.Size(415, 522);95 this.groupBoxDetails.Size = new System.Drawing.Size(415, 496); 93 96 this.groupBoxDetails.TabIndex = 4; 94 97 this.groupBoxDetails.TabStop = false; … … 103 106 this.panel.Location = new System.Drawing.Point(7, 20); 104 107 this.panel.Name = "panel"; 105 this.panel.Size = new System.Drawing.Size(402, 4 96);108 this.panel.Size = new System.Drawing.Size(402, 470); 106 109 this.panel.TabIndex = 0; 107 110 // … … 114 117 this.resultItems.Location = new System.Drawing.Point(6, 364); 115 118 this.resultItems.Name = "resultItems"; 116 this.resultItems.Size = new System.Drawing.Size(777, 1 54);119 this.resultItems.Size = new System.Drawing.Size(777, 124); 117 120 this.resultItems.TabIndex = 5; 118 121 // … … 125 128 this.groupBox2.Location = new System.Drawing.Point(0, 0); 126 129 this.groupBox2.Name = "groupBox2"; 127 this.groupBox2.Size = new System.Drawing.Size(364, 522);130 this.groupBox2.Size = new System.Drawing.Size(364, 496); 128 131 this.groupBox2.TabIndex = 6; 129 132 this.groupBox2.TabStop = false; … … 139 142 this.groupBox3.Location = new System.Drawing.Point(6, 6); 140 143 this.groupBox3.Name = "groupBox3"; 141 this.groupBox3.Size = new System.Drawing.Size(789, 522);144 this.groupBox3.Size = new System.Drawing.Size(789, 496); 142 145 this.groupBox3.TabIndex = 7; 143 146 this.groupBox3.TabStop = false; 144 147 this.groupBox3.Text = "Result Elements"; 145 //146 // splitContainer2147 //148 this.splitContainer2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)149 | System.Windows.Forms.AnchorStyles.Left)150 | System.Windows.Forms.AnchorStyles.Right)));151 this.splitContainer2.Location = new System.Drawing.Point(6, 6);152 this.splitContainer2.Name = "splitContainer2";153 //154 // splitContainer2.Panel1155 //156 this.splitContainer2.Panel1.Controls.Add(this.groupBox2);157 //158 // splitContainer2.Panel2159 //160 this.splitContainer2.Panel2.Controls.Add(this.groupBoxDetails);161 this.splitContainer2.Size = new System.Drawing.Size(789, 522);162 this.splitContainer2.SplitterDistance = 367;163 this.splitContainer2.TabIndex = 9;164 //165 // tabControl1166 //167 this.tabControl1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)168 | System.Windows.Forms.AnchorStyles.Left)169 | System.Windows.Forms.AnchorStyles.Right)));170 this.tabControl1.Controls.Add(this.tabPage1);171 this.tabControl1.Controls.Add(this.tabPage2);172 this.tabControl1.Location = new System.Drawing.Point(12, 12);173 this.tabControl1.Name = "tabControl1";174 this.tabControl1.SelectedIndex = 0;175 this.tabControl1.Size = new System.Drawing.Size(809, 560);176 this.tabControl1.TabIndex = 10;177 //178 // tabPage1179 //180 this.tabPage1.Controls.Add(this.splitContainer2);181 this.tabPage1.Location = new System.Drawing.Point(4, 22);182 this.tabPage1.Name = "tabPage1";183 this.tabPage1.Padding = new System.Windows.Forms.Padding(3);184 this.tabPage1.Size = new System.Drawing.Size(801, 534);185 this.tabPage1.TabIndex = 0;186 this.tabPage1.Text = "Parameters";187 this.tabPage1.UseVisualStyleBackColor = true;188 //189 // tabPage2190 //191 this.tabPage2.Controls.Add(this.groupBox3);192 this.tabPage2.Location = new System.Drawing.Point(4, 22);193 this.tabPage2.Name = "tabPage2";194 this.tabPage2.Padding = new System.Windows.Forms.Padding(3);195 this.tabPage2.Size = new System.Drawing.Size(801, 534);196 this.tabPage2.TabIndex = 1;197 this.tabPage2.Text = "Results";198 this.tabPage2.UseVisualStyleBackColor = true;199 //200 // jsonItemBindingSource201 //202 this.jsonItemBindingSource.DataSource = typeof(HeuristicLab.JsonInterface.IJsonItem);203 148 // 204 149 // treeViewResults … … 210 155 this.treeViewResults.TabIndex = 6; 211 156 // 157 // splitContainer2 158 // 159 this.splitContainer2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 160 | System.Windows.Forms.AnchorStyles.Left) 161 | System.Windows.Forms.AnchorStyles.Right))); 162 this.splitContainer2.Location = new System.Drawing.Point(6, 6); 163 this.splitContainer2.Name = "splitContainer2"; 164 // 165 // splitContainer2.Panel1 166 // 167 this.splitContainer2.Panel1.Controls.Add(this.groupBox2); 168 // 169 // splitContainer2.Panel2 170 // 171 this.splitContainer2.Panel2.Controls.Add(this.groupBoxDetails); 172 this.splitContainer2.Size = new System.Drawing.Size(789, 496); 173 this.splitContainer2.SplitterDistance = 367; 174 this.splitContainer2.TabIndex = 9; 175 // 176 // tabControl1 177 // 178 this.tabControl1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 179 | System.Windows.Forms.AnchorStyles.Left) 180 | System.Windows.Forms.AnchorStyles.Right))); 181 this.tabControl1.Controls.Add(this.tabPage1); 182 this.tabControl1.Controls.Add(this.tabPage2); 183 this.tabControl1.Location = new System.Drawing.Point(12, 38); 184 this.tabControl1.Name = "tabControl1"; 185 this.tabControl1.SelectedIndex = 0; 186 this.tabControl1.Size = new System.Drawing.Size(809, 534); 187 this.tabControl1.TabIndex = 10; 188 // 189 // tabPage1 190 // 191 this.tabPage1.Controls.Add(this.splitContainer2); 192 this.tabPage1.Location = new System.Drawing.Point(4, 22); 193 this.tabPage1.Name = "tabPage1"; 194 this.tabPage1.Padding = new System.Windows.Forms.Padding(3); 195 this.tabPage1.Size = new System.Drawing.Size(801, 508); 196 this.tabPage1.TabIndex = 0; 197 this.tabPage1.Text = "Parameters"; 198 this.tabPage1.UseVisualStyleBackColor = true; 199 // 200 // tabPage2 201 // 202 this.tabPage2.Controls.Add(this.groupBox3); 203 this.tabPage2.Location = new System.Drawing.Point(4, 22); 204 this.tabPage2.Name = "tabPage2"; 205 this.tabPage2.Padding = new System.Windows.Forms.Padding(3); 206 this.tabPage2.Size = new System.Drawing.Size(801, 508); 207 this.tabPage2.TabIndex = 1; 208 this.tabPage2.Text = "Results"; 209 this.tabPage2.UseVisualStyleBackColor = true; 210 // 211 // label1 212 // 213 this.label1.AutoSize = true; 214 this.label1.Location = new System.Drawing.Point(12, 15); 215 this.label1.Name = "label1"; 216 this.label1.Size = new System.Drawing.Size(82, 13); 217 this.label1.TabIndex = 11; 218 this.label1.Text = "Template Name"; 219 // 220 // textBoxTemplateName 221 // 222 this.textBoxTemplateName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 223 | System.Windows.Forms.AnchorStyles.Right))); 224 this.errorProvider.SetIconAlignment(this.textBoxTemplateName, System.Windows.Forms.ErrorIconAlignment.MiddleLeft); 225 this.textBoxTemplateName.Location = new System.Drawing.Point(100, 12); 226 this.textBoxTemplateName.Name = "textBoxTemplateName"; 227 this.textBoxTemplateName.Size = new System.Drawing.Size(720, 20); 228 this.textBoxTemplateName.TabIndex = 12; 229 this.textBoxTemplateName.Text = "Template"; 230 this.textBoxTemplateName.Validating += new System.ComponentModel.CancelEventHandler(this.textBoxTemplateName_Validating); 231 // 232 // errorProvider 233 // 234 this.errorProvider.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.NeverBlink; 235 this.errorProvider.ContainerControl = this; 236 // 237 // jsonItemBindingSource 238 // 239 this.jsonItemBindingSource.DataSource = typeof(HeuristicLab.JsonInterface.IJsonItem); 240 // 212 241 // ExportJsonDialog 213 242 // … … 215 244 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 216 245 this.ClientSize = new System.Drawing.Size(833, 619); 246 this.Controls.Add(this.textBoxTemplateName); 247 this.Controls.Add(this.label1); 217 248 this.Controls.Add(this.exportButton); 218 249 this.Controls.Add(this.tabControl1); … … 231 262 this.tabPage1.ResumeLayout(false); 232 263 this.tabPage2.ResumeLayout(false); 264 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit(); 233 265 ((System.ComponentModel.ISupportInitialize)(this.jsonItemBindingSource)).EndInit(); 234 266 this.ResumeLayout(false); 267 this.PerformLayout(); 235 268 236 269 } … … 253 286 private System.Windows.Forms.TabPage tabPage2; 254 287 private System.Windows.Forms.TreeView treeViewResults; 288 private System.Windows.Forms.Label label1; 289 private System.Windows.Forms.TextBox textBoxTemplateName; 290 private System.Windows.Forms.ErrorProvider errorProvider; 255 291 } 256 292 } -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/ExportJsonDialog.cs
r17443 r17444 16 16 namespace HeuristicLab.JsonInterface.OptimizerIntegration { 17 17 public partial class ExportJsonDialog : Form { 18 private static SaveFileDialog SaveFileDialog { get; set; }18 private static FolderBrowserDialog FolderBrowserDialog { get; set; } 19 19 private IDictionary<int, UserControl> Hash2Control { get; set; } = new Dictionary<int, UserControl>(); 20 20 private IDictionary<TreeNode, JsonItemVMBase> Node2VM { get; set; } = new Dictionary<TreeNode, JsonItemVMBase>(); … … 71 71 72 72 private void exportButton_Click(object sender, EventArgs e) { 73 foreach (var x in VMs) {73 foreach (var x in VMs) { 74 74 if (!x.Selected) { 75 75 x.Item.Parent.Children.Remove(x.Item); … … 77 77 } 78 78 79 foreach (var x in ResultItems.Values) {79 foreach (var x in ResultItems.Values) { 80 80 x.Parent.Children.Remove(x); 81 81 } 82 82 83 foreach (var x in resultItems.CheckedItems) {84 if (ResultItems.TryGetValue((string)x, out IJsonItem item)) {83 foreach (var x in resultItems.CheckedItems) { 84 if (ResultItems.TryGetValue((string)x, out IJsonItem item)) { 85 85 Root.AddChildren(item); 86 86 } … … 88 88 89 89 IList<IJsonItem> faultyItems = new List<IJsonItem>(); 90 if(!Root.GetValidator().Validate(ref faultyItems)) { 90 91 if (!Root.GetValidator().Validate(ref faultyItems)) { 92 IList<Exception> list = new List<Exception>(); 91 93 //print faultyItems 94 foreach (var x in faultyItems) { 95 list.Add(new Exception($"Combination of value and range is not valid for {x.Name}")); 96 } 97 ErrorHandling.ShowErrorDialog(this, new AggregateException(list)); 98 } else { 99 if (FolderBrowserDialog == null) { 100 FolderBrowserDialog = new FolderBrowserDialog(); 101 FolderBrowserDialog.Description = "Select .json-Template Dictionary"; 102 } 103 104 if (FolderBrowserDialog.ShowDialog() == DialogResult.OK) { 105 Generator.GenerateTemplate(FolderBrowserDialog.SelectedPath, textBoxTemplateName.Text, Optimizer, Root); 106 } 107 108 Close(); 92 109 } 93 94 if (SaveFileDialog == null) {95 SaveFileDialog = new SaveFileDialog();96 SaveFileDialog.Title = "Export .json-Template";97 SaveFileDialog.DefaultExt = "json";98 SaveFileDialog.Filter = ".json-Template|*.json|All Files|*.*";99 SaveFileDialog.FilterIndex = 1;100 }101 102 SaveFileDialog.FileName = "template";103 104 if (SaveFileDialog.ShowDialog() == DialogResult.OK) {105 Generator.GenerateTemplate(@"C:\Users\p41997\Desktop", "template", Optimizer, Root);106 }107 108 Close();109 110 } 110 111 … … 162 163 } 163 164 } 165 166 private void textBoxTemplateName_Validating(object sender, CancelEventArgs e) { 167 if (string.IsNullOrWhiteSpace(textBoxTemplateName.Text)) { 168 errorProvider.SetError(textBoxTemplateName, "Template name must not be empty."); 169 e.Cancel = true; 170 } else { 171 errorProvider.SetError(textBoxTemplateName, null); 172 } 173 } 164 174 } 165 175 } -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/ExportJsonDialog.resx
r17404 r17444 118 118 <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> 119 119 </resheader> 120 <metadata name="errorProvider.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> 121 <value>194, 17</value> 122 </metadata> 120 123 <metadata name="jsonItemBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> 121 124 <value>17, 17</value> -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/JsonItemValueControl.Designer.cs
r17443 r17444 37 37 this.textBoxValue.Size = new System.Drawing.Size(402, 20); 38 38 this.textBoxValue.TabIndex = 14; 39 this.textBoxValue.Validating += new System.ComponentModel.CancelEventHandler(this.textBoxValue_Validating); 39 40 // 40 41 // label2 … … 51 52 this.numericRangeControl1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 52 53 | System.Windows.Forms.AnchorStyles.Right))); 53 this.numericRangeControl1.Location = new System.Drawing.Point(9, 12 7);54 this.numericRangeControl1.Location = new System.Drawing.Point(9, 125); 54 55 this.numericRangeControl1.Name = "numericRangeControl1"; 55 this.numericRangeControl1.Size = new System.Drawing.Size(485, 112);56 this.numericRangeControl1.Size = new System.Drawing.Size(485, 72); 56 57 this.numericRangeControl1.TabIndex = 16; 57 58 // … … 64 65 this.Controls.Add(this.textBoxValue); 65 66 this.Name = "JsonItemValueControl"; 66 this.Size = new System.Drawing.Size(500, 247);67 this.Size = new System.Drawing.Size(500, 199); 67 68 this.Controls.SetChildIndex(this.textBoxValue, 0); 68 69 this.Controls.SetChildIndex(this.label2, 0); -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/JsonItemValueControl.cs
r17443 r17444 50 50 } 51 51 52 protected void Init() { 52 protected void Init() { 53 53 TBValue.DataBindings.Add("Text", base.VM, ValuePropertyId); 54 54 NumericRangeControl.TBMinRange.DataBindings.Add("Text", VM, nameof(RangedValueBaseVM.MinRange)); … … 60 60 } 61 61 62 private void textBoxValue_Validating(object sender, CancelEventArgs e) { 63 if (string.IsNullOrWhiteSpace(textBoxValue.Text)) { 64 errorProvider.SetError(textBoxValue, "Value must not be empty."); 65 e.Cancel = true; 66 } else { 67 errorProvider.SetError(textBoxValue, null); 68 } 69 } 62 70 } 63 71 } -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/AlgorithmConverter.cs
r17443 r17444 16 16 base.Inject(item, data, root); 17 17 IAlgorithm algorithm = item as IAlgorithm; 18 IJsonItem problemData = data.Children.Where(x => x.Name == algorithm.Problem.ItemName).First(); 19 root.Inject(algorithm.Problem, problemData, root); 20 18 var collection = data.Children.Where(x => x.Name == algorithm.Problem.ItemName); 19 if(collection.Count() > 0) { 20 IJsonItem problemData = collection.First(); 21 root.Inject(algorithm.Problem, problemData, root); 22 } 21 23 } 22 24 … … 27 29 item.AddChildren(new ResultItem() { 28 30 Name = res.Name, 29 Description = res.Description, 30 Value = true, 31 Range = new object[] { true, false } 31 Description = res.Description 32 32 }); 33 33 } -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Interfaces/IJsonItem.cs
r17433 r17444 33 33 34 34 void AddChildren(IEnumerable<IJsonItem> childs); 35 36 /// <summary> 37 /// This method fixates the path. 38 /// After calling, the path cannot be changed by changing the name or parent. 39 /// </summary> 40 void FixatePath(); 41 42 /// <summary> 43 /// This method looses the path again after a call of FixatePath. 44 /// After calling, the path is calculated by the position in item tree again. 45 /// </summary> 46 void LoosenPath(); 35 47 } 36 48 } -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Models/JsonItem.cs
r17435 r17444 45 45 public virtual string Description { get; set; } 46 46 47 private string fixedPath = ""; 47 48 public virtual string Path { 48 49 get { 50 if (!string.IsNullOrWhiteSpace(fixedPath)) 51 return fixedPath; 52 49 53 IJsonItem tmp = Parent; 50 54 StringBuilder builder = new StringBuilder(this.Name); … … 57 61 } 58 62 63 public virtual object Value { get; set; } 64 65 public virtual IEnumerable<object> Range { get; set; } 66 67 public virtual string ActualName { get; set; } 68 59 69 [JsonIgnore] 60 70 public virtual IList<IJsonItem> Children { get; protected set; } … … 62 72 [JsonIgnore] 63 73 public virtual IJsonItem Parent { get; set; } 64 65 public virtual object Value { get; set; }66 67 public virtual IEnumerable<object> Range { get; set; }68 69 public virtual string ActualName { get; set; }70 74 71 75 #region Constructors … … 97 101 98 102 public void AddChildren(IEnumerable<IJsonItem> childs) { 103 if (childs == null) return; 99 104 if (Children == null) 100 105 Children = new List<IJsonItem>(); … … 106 111 107 112 public virtual IJsonItemValidator GetValidator() => new JsonItemValidator(this); 113 114 public void FixatePath() => fixedPath = Path; 115 public void LoosenPath() => fixedPath = ""; 108 116 #endregion 109 117 110 118 #region Helper 111 protected bool IsInRange() {119 protected virtual bool IsInRange() { 112 120 bool b1 = true, b2 = true; 113 121 if (Value is IEnumerable && !(Value is string)) { -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Models/JsonItems.cs
r17420 r17444 9 9 public class IntArrayJsonItem: JsonItem<int[], int> { } 10 10 public class IntRangeJsonItem : JsonItem<int[], int> { } 11 public class IntMatrixJsonItem : JsonItem<int[][], int> { } 11 public class IntMatrixJsonItem : JsonItem<int[][], int> { 12 protected override bool IsInRange() { 13 for (int c = 0; c < Value.Length; ++c) { 14 for (int r = 0; r < Value[c].Length; ++r) { 15 if (Value[c][r] < Range.First() && Range.Last() < Value[c][r]) 16 return false; 17 } 18 } 19 return true; 20 } 21 } 12 22 13 23 public class DoubleJsonItem: JsonItem<double> {} 14 24 public class DoubleArrayJsonItem: JsonItem<double[], double> { } 15 25 public class DoubleRangeJsonItem : JsonItem<double[], double> { } 16 public class DoubleMatrixJsonItem : JsonItem<double[][], double> { } 26 public class DoubleMatrixJsonItem : JsonItem<double[][], double> { 27 protected override bool IsInRange() { 28 for(int c = 0; c < Value.Length; ++c) { 29 for(int r = 0; r < Value[c].Length; ++r) { 30 if (Value[c][r] < Range.First() && Range.Last() < Value[c][r]) 31 return false; 32 } 33 } 34 return true; 35 } 36 } 17 37 18 38 public class BoolJsonItem: JsonItem<bool> { }
Note: See TracChangeset
for help on using the changeset viewer.