Changeset 17471
- Timestamp:
- 03/09/20 10:36:09 (5 years ago)
- Location:
- branches/3026_IntegrationIntoSymSpace
- Files:
-
- 15 added
- 4 deleted
- 36 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/HeuristicLab.JsonInterface.OptimizerIntegration.csproj
r17464 r17471 87 87 <Compile Include="Interfaces\IArrayJsonItemVM.cs" /> 88 88 <Compile Include="Interfaces\IJsonItemVM.cs" /> 89 <Compile Include="Interfaces\ILookupJsonItemVM.cs" /> 89 90 <Compile Include="Interfaces\IMatrixJsonItemVM.cs" /> 90 <Compile Include="Interfaces\I NamedMatrixJsonItemVM.cs" />91 <Compile Include="Interfaces\IValueLookupJsonItemVM.cs" /> 91 92 <Compile Include="Properties\Resources.Designer.cs"> 92 93 <AutoGen>True</AutoGen> … … 108 109 <Compile Include="ViewModels\ArrayValueVM.cs" /> 109 110 <Compile Include="ViewModels\JsonItemVMBase.cs" /> 111 <Compile Include="ViewModels\LookupJsonItemVM.cs" /> 110 112 <Compile Include="ViewModels\MatrixValueVM.cs" /> 111 <Compile Include="ViewModels\NamedMatrixValueVM.cs" />112 113 <Compile Include="ViewModels\RangedValueBaseVM.cs" /> 113 114 <Compile Include="ViewModels\RangeVM.cs" /> … … 115 116 <Compile Include="ViewModels\SingleValueVM.cs" /> 116 117 <Compile Include="ViewModels\StringValueVM.cs" /> 118 <Compile Include="ViewModels\ValueLookupJsonItemVM.cs" /> 117 119 <Compile Include="Views\ExportJsonDialog.cs"> 118 120 <SubType>Form</SubType> … … 156 158 <Compile Include="Plugin.cs" /> 157 159 <Compile Include="Properties\AssemblyInfo.cs" /> 160 <Compile Include="Views\LookupJsonItemControl.cs"> 161 <SubType>UserControl</SubType> 162 </Compile> 163 <Compile Include="Views\LookupJsonItemControl.Designer.cs"> 164 <DependentUpon>LookupJsonItemControl.cs</DependentUpon> 165 </Compile> 166 <Compile Include="Views\ValueLookupJsonItemControl.cs"> 167 <SubType>UserControl</SubType> 168 </Compile> 169 <Compile Include="Views\ValueLookupJsonItemControl.Designer.cs"> 170 <DependentUpon>ValueLookupJsonItemControl.cs</DependentUpon> 171 </Compile> 158 172 </ItemGroup> 159 173 <ItemGroup> … … 227 241 <EmbeddedResource Include="Views\JsonItemValidValuesControl.resx"> 228 242 <DependentUpon>JsonItemValidValuesControl.cs</DependentUpon> 243 </EmbeddedResource> 244 <EmbeddedResource Include="Views\LookupJsonItemControl.resx"> 245 <DependentUpon>LookupJsonItemControl.cs</DependentUpon> 246 </EmbeddedResource> 247 <EmbeddedResource Include="Views\ValueLookupJsonItemControl.resx"> 248 <DependentUpon>ValueLookupJsonItemControl.cs</DependentUpon> 229 249 </EmbeddedResource> 230 250 </ItemGroup> -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Interfaces/IJsonItemVM.cs
r17446 r17471 13 13 Type JsonItemType { get; } 14 14 15 JsonItemBaseControl Control { get; }15 UserControl Control { get; } 16 16 17 17 IJsonItem Item { get; set; } … … 22 22 23 23 string Description { get; set; } 24 25 string ActualName { get; set; } 26 24 27 25 TreeNode TreeNode { get; set; } 28 26 -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Interfaces/IMatrixJsonItemVM.cs
r17446 r17471 8 8 public interface IMatrixJsonItemVM : IJsonItemVM { 9 9 bool RowsResizable { get; set; } 10 11 10 bool ColumnsResizable { get; set; } 11 IEnumerable<string> RowNames { get; set; } 12 IEnumerable<string> ColumnNames { get; set; } 12 13 } 13 14 } -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Shared/JsonItemBaseControl.Designer.cs
r17464 r17471 26 26 this.components = new System.ComponentModel.Container(); 27 27 this.errorProvider = new System.Windows.Forms.ErrorProvider(this.components); 28 this.textBoxName = new System.Windows.Forms.TextBox(); 28 29 this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); 29 this.panel4 = new System.Windows.Forms.Panel();30 this.textBoxActualName = new System.Windows.Forms.TextBox();31 this.labelActualName = new System.Windows.Forms.Label();32 this.panel2 = new System.Windows.Forms.Panel();33 30 this.labelDescription = new System.Windows.Forms.Label(); 34 31 this.textBoxDescription = new System.Windows.Forms.TextBox(); 35 this.panel1 = new System.Windows.Forms.Panel();36 this.textBoxName = new System.Windows.Forms.TextBox();37 32 this.label1 = new System.Windows.Forms.Label(); 38 this.panel3 = new System.Windows.Forms.Panel();39 33 this.labelEnable = new System.Windows.Forms.Label(); 40 34 this.checkBoxActive = new System.Windows.Forms.CheckBox(); 35 this.tableLayoutPanel5 = new System.Windows.Forms.TableLayoutPanel(); 41 36 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit(); 42 37 this.tableLayoutPanel1.SuspendLayout(); 43 this.panel4.SuspendLayout(); 44 this.panel2.SuspendLayout(); 45 this.panel1.SuspendLayout(); 46 this.panel3.SuspendLayout(); 38 this.tableLayoutPanel5.SuspendLayout(); 47 39 this.SuspendLayout(); 48 40 // … … 52 44 this.errorProvider.ContainerControl = this; 53 45 // 46 // textBoxName 47 // 48 this.textBoxName.Dock = System.Windows.Forms.DockStyle.Fill; 49 this.errorProvider.SetIconAlignment(this.textBoxName, System.Windows.Forms.ErrorIconAlignment.MiddleLeft); 50 this.textBoxName.Location = new System.Drawing.Point(100, 24); 51 this.textBoxName.Margin = new System.Windows.Forms.Padding(0); 52 this.textBoxName.Name = "textBoxName"; 53 this.textBoxName.Size = new System.Drawing.Size(394, 20); 54 this.textBoxName.TabIndex = 10; 55 this.textBoxName.Validating += new System.ComponentModel.CancelEventHandler(this.textBoxName_Validating); 56 // 54 57 // tableLayoutPanel1 55 58 // 56 59 this.tableLayoutPanel1.ColumnCount = 1; 57 60 this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); 58 this.tableLayoutPanel1.Controls.Add(this.panel4, 0, 3); 59 this.tableLayoutPanel1.Controls.Add(this.panel2, 0, 2); 60 this.tableLayoutPanel1.Controls.Add(this.panel1, 0, 1); 61 this.tableLayoutPanel1.Controls.Add(this.panel3, 0, 0); 61 this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanel5, 0, 0); 62 62 this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; 63 63 this.tableLayoutPanel1.Location = new System.Drawing.Point(3, 3); 64 64 this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(0); 65 65 this.tableLayoutPanel1.Name = "tableLayoutPanel1"; 66 this.tableLayoutPanel1.RowCount = 5; 67 this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F)); 68 this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F)); 69 this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F)); 70 this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F)); 71 this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); 72 this.tableLayoutPanel1.Size = new System.Drawing.Size(494, 388); 66 this.tableLayoutPanel1.RowCount = 2; 67 this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 75F)); 68 this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); 69 this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); 70 this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); 71 this.tableLayoutPanel1.Size = new System.Drawing.Size(494, 594); 73 72 this.tableLayoutPanel1.TabIndex = 16; 74 //75 // panel476 //77 this.panel4.Controls.Add(this.textBoxActualName);78 this.panel4.Controls.Add(this.labelActualName);79 this.panel4.Dock = System.Windows.Forms.DockStyle.Fill;80 this.panel4.Location = new System.Drawing.Point(0, 75);81 this.panel4.Margin = new System.Windows.Forms.Padding(0);82 this.panel4.Name = "panel4";83 this.panel4.Size = new System.Drawing.Size(494, 25);84 this.panel4.TabIndex = 17;85 //86 // textBoxActualName87 //88 this.textBoxActualName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)89 | System.Windows.Forms.AnchorStyles.Right)));90 this.textBoxActualName.Location = new System.Drawing.Point(92, 3);91 this.textBoxActualName.Name = "textBoxActualName";92 this.textBoxActualName.Size = new System.Drawing.Size(396, 20);93 this.textBoxActualName.TabIndex = 12;94 //95 // labelActualName96 //97 this.labelActualName.AutoSize = true;98 this.labelActualName.Location = new System.Drawing.Point(6, 6);99 this.labelActualName.Name = "labelActualName";100 this.labelActualName.Size = new System.Drawing.Size(65, 13);101 this.labelActualName.TabIndex = 11;102 this.labelActualName.Text = "ActualName";103 this.labelActualName.TextAlign = System.Drawing.ContentAlignment.MiddleRight;104 //105 // panel2106 //107 this.panel2.Controls.Add(this.labelDescription);108 this.panel2.Controls.Add(this.textBoxDescription);109 this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;110 this.panel2.Location = new System.Drawing.Point(0, 50);111 this.panel2.Margin = new System.Windows.Forms.Padding(0);112 this.panel2.Name = "panel2";113 this.panel2.Size = new System.Drawing.Size(494, 25);114 this.panel2.TabIndex = 17;115 73 // 116 74 // labelDescription 117 75 // 118 76 this.labelDescription.AutoSize = true; 119 this.labelDescription.Location = new System.Drawing.Point(6, 6); 77 this.labelDescription.Dock = System.Windows.Forms.DockStyle.Fill; 78 this.labelDescription.Location = new System.Drawing.Point(0, 48); 79 this.labelDescription.Margin = new System.Windows.Forms.Padding(0); 120 80 this.labelDescription.Name = "labelDescription"; 121 this.labelDescription.Size = new System.Drawing.Size( 60, 13);81 this.labelDescription.Size = new System.Drawing.Size(100, 27); 122 82 this.labelDescription.TabIndex = 13; 123 83 this.labelDescription.Text = "Description"; 84 this.labelDescription.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; 124 85 // 125 86 // textBoxDescription 126 87 // 127 this.textBoxDescription. Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)128 | System.Windows.Forms.AnchorStyles.Right)));129 this.textBoxDescription. Location = new System.Drawing.Point(92, 3);88 this.textBoxDescription.Dock = System.Windows.Forms.DockStyle.Fill; 89 this.textBoxDescription.Location = new System.Drawing.Point(100, 50); 90 this.textBoxDescription.Margin = new System.Windows.Forms.Padding(0, 2, 0, 0); 130 91 this.textBoxDescription.Name = "textBoxDescription"; 131 this.textBoxDescription.Size = new System.Drawing.Size(39 6, 20);92 this.textBoxDescription.Size = new System.Drawing.Size(394, 20); 132 93 this.textBoxDescription.TabIndex = 14; 133 //134 // panel1135 //136 this.panel1.Controls.Add(this.textBoxName);137 this.panel1.Controls.Add(this.label1);138 this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;139 this.panel1.Location = new System.Drawing.Point(0, 25);140 this.panel1.Margin = new System.Windows.Forms.Padding(0);141 this.panel1.Name = "panel1";142 this.panel1.Size = new System.Drawing.Size(494, 25);143 this.panel1.TabIndex = 17;144 //145 // textBoxName146 //147 this.textBoxName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)148 | System.Windows.Forms.AnchorStyles.Right)));149 this.errorProvider.SetIconAlignment(this.textBoxName, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);150 this.textBoxName.Location = new System.Drawing.Point(92, 3);151 this.textBoxName.Name = "textBoxName";152 this.textBoxName.Size = new System.Drawing.Size(396, 20);153 this.textBoxName.TabIndex = 10;154 this.textBoxName.Validating += new System.ComponentModel.CancelEventHandler(this.textBoxName_Validating);155 94 // 156 95 // label1 157 96 // 158 97 this.label1.AutoSize = true; 159 this.label1.Location = new System.Drawing.Point(6, 6); 98 this.label1.Dock = System.Windows.Forms.DockStyle.Fill; 99 this.label1.Location = new System.Drawing.Point(0, 24); 100 this.label1.Margin = new System.Windows.Forms.Padding(0); 160 101 this.label1.Name = "label1"; 161 this.label1.Size = new System.Drawing.Size( 35, 13);102 this.label1.Size = new System.Drawing.Size(100, 24); 162 103 this.label1.TabIndex = 9; 163 104 this.label1.Text = "Name"; 164 this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight; 165 // 166 // panel3 167 // 168 this.panel3.Controls.Add(this.labelEnable); 169 this.panel3.Controls.Add(this.checkBoxActive); 170 this.panel3.Dock = System.Windows.Forms.DockStyle.Fill; 171 this.panel3.Location = new System.Drawing.Point(0, 0); 172 this.panel3.Margin = new System.Windows.Forms.Padding(0); 173 this.panel3.Name = "panel3"; 174 this.panel3.Size = new System.Drawing.Size(494, 25); 175 this.panel3.TabIndex = 17; 105 this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; 176 106 // 177 107 // labelEnable 178 108 // 179 this.labelEnable.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)180 | System.Windows.Forms.AnchorStyles.Right)));181 109 this.labelEnable.AutoSize = true; 182 this.labelEnable.Location = new System.Drawing.Point(6, 7); 110 this.labelEnable.Dock = System.Windows.Forms.DockStyle.Fill; 111 this.labelEnable.Location = new System.Drawing.Point(0, 0); 112 this.labelEnable.Margin = new System.Windows.Forms.Padding(0); 183 113 this.labelEnable.Name = "labelEnable"; 184 this.labelEnable.Size = new System.Drawing.Size( 40, 13);114 this.labelEnable.Size = new System.Drawing.Size(100, 24); 185 115 this.labelEnable.TabIndex = 3; 186 116 this.labelEnable.Text = "Enable"; 117 this.labelEnable.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; 187 118 // 188 119 // checkBoxActive 189 120 // 190 121 this.checkBoxActive.AutoSize = true; 191 this.checkBoxActive.Location = new System.Drawing.Point(92, 7); 122 this.checkBoxActive.Dock = System.Windows.Forms.DockStyle.Fill; 123 this.checkBoxActive.Location = new System.Drawing.Point(100, 0); 124 this.checkBoxActive.Margin = new System.Windows.Forms.Padding(0); 192 125 this.checkBoxActive.Name = "checkBoxActive"; 193 this.checkBoxActive.Size = new System.Drawing.Size( 15, 14);126 this.checkBoxActive.Size = new System.Drawing.Size(394, 24); 194 127 this.checkBoxActive.TabIndex = 2; 195 128 this.checkBoxActive.UseVisualStyleBackColor = true; 129 // 130 // tableLayoutPanel5 131 // 132 this.tableLayoutPanel5.ColumnCount = 2; 133 this.tableLayoutPanel5.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 100F)); 134 this.tableLayoutPanel5.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); 135 this.tableLayoutPanel5.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F)); 136 this.tableLayoutPanel5.Controls.Add(this.textBoxDescription, 1, 2); 137 this.tableLayoutPanel5.Controls.Add(this.textBoxName, 1, 1); 138 this.tableLayoutPanel5.Controls.Add(this.checkBoxActive, 1, 0); 139 this.tableLayoutPanel5.Controls.Add(this.label1, 0, 1); 140 this.tableLayoutPanel5.Controls.Add(this.labelDescription, 0, 2); 141 this.tableLayoutPanel5.Controls.Add(this.labelEnable, 0, 0); 142 this.tableLayoutPanel5.Dock = System.Windows.Forms.DockStyle.Fill; 143 this.tableLayoutPanel5.Location = new System.Drawing.Point(0, 0); 144 this.tableLayoutPanel5.Margin = new System.Windows.Forms.Padding(0); 145 this.tableLayoutPanel5.Name = "tableLayoutPanel5"; 146 this.tableLayoutPanel5.RowCount = 3; 147 this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.33333F)); 148 this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.33333F)); 149 this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.33333F)); 150 this.tableLayoutPanel5.Size = new System.Drawing.Size(494, 75); 151 this.tableLayoutPanel5.TabIndex = 17; 196 152 // 197 153 // JsonItemBaseControl … … 203 159 this.Name = "JsonItemBaseControl"; 204 160 this.Padding = new System.Windows.Forms.Padding(3); 205 this.Size = new System.Drawing.Size(500, 394);161 this.Size = new System.Drawing.Size(500, 600); 206 162 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit(); 207 163 this.tableLayoutPanel1.ResumeLayout(false); 208 this.panel4.ResumeLayout(false); 209 this.panel4.PerformLayout(); 210 this.panel2.ResumeLayout(false); 211 this.panel2.PerformLayout(); 212 this.panel1.ResumeLayout(false); 213 this.panel1.PerformLayout(); 214 this.panel3.ResumeLayout(false); 215 this.panel3.PerformLayout(); 164 this.tableLayoutPanel5.ResumeLayout(false); 165 this.tableLayoutPanel5.PerformLayout(); 216 166 this.ResumeLayout(false); 217 167 … … 222 172 protected System.Windows.Forms.Label labelEnable; 223 173 protected System.Windows.Forms.CheckBox checkBoxActive; 224 protected System.Windows.Forms.TextBox textBoxActualName;225 protected System.Windows.Forms.Label labelActualName;226 174 protected System.Windows.Forms.TextBox textBoxName; 227 175 protected System.Windows.Forms.Label label1; 228 176 protected System.Windows.Forms.Label labelDescription; 229 177 protected System.Windows.Forms.TextBox textBoxDescription; 230 private System.Windows.Forms.Panel panel1;231 private System.Windows.Forms.Panel panel3;232 private System.Windows.Forms.Panel panel2;233 private System.Windows.Forms.Panel panel4;234 178 protected System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; 179 private System.Windows.Forms.TableLayoutPanel tableLayoutPanel5; 235 180 } 236 181 } -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Shared/JsonItemBaseControl.cs
r17464 r17471 26 26 InitializeComponent(); 27 27 VM = vm; 28 tableLayoutPanel1.Controls.Add(control, 0, 4); 28 control.Margin = new Padding() { All = 0 }; 29 tableLayoutPanel1.Controls.Add(control, 0, 1); 29 30 control.Dock = DockStyle.Fill; 30 31 Init(); … … 36 37 textBoxName.DataBindings.Add("Text", VM, nameof(IJsonItemVM.Name)); 37 38 textBoxDescription.DataBindings.Add("Text", VM, nameof(IJsonItemVM.Description)); 38 textBoxActualName.DataBindings.Add("Text", VM, nameof(IJsonItemVM.ActualName));39 40 if (string.IsNullOrWhiteSpace(VM.Item.ActualName)) {41 textBoxActualName.Enabled = false;42 tableLayoutPanel1.Controls.Remove(panel4);43 tableLayoutPanel1.RowStyles[3].Height = 0;44 //textBoxActualName.ReadOnly = true;45 } else46 textBoxActualName.Text = VM.Item.ActualName;47 39 } 48 40 -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Shared/NumericRangeControl.Designer.cs
r17464 r17471 25 25 private void InitializeComponent() { 26 26 this.components = new System.ComponentModel.Container(); 27 this.textBoxFrom = new System.Windows.Forms.TextBox();28 27 this.groupBox2 = new System.Windows.Forms.GroupBox(); 29 28 this.checkBoxTo = new System.Windows.Forms.CheckBox(); 30 29 this.textBoxTo = new System.Windows.Forms.TextBox(); 30 this.errorProvider = new System.Windows.Forms.ErrorProvider(this.components); 31 this.textBoxFrom = new System.Windows.Forms.TextBox(); 31 32 this.checkBoxFrom = new System.Windows.Forms.CheckBox(); 32 this. errorProvider = new System.Windows.Forms.ErrorProvider(this.components);33 this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); 33 34 this.groupBox2.SuspendLayout(); 34 35 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit(); 36 this.tableLayoutPanel2.SuspendLayout(); 35 37 this.SuspendLayout(); 36 //37 // textBoxFrom38 //39 this.textBoxFrom.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)40 | System.Windows.Forms.AnchorStyles.Right)));41 this.errorProvider.SetIconAlignment(this.textBoxFrom, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);42 this.textBoxFrom.Location = new System.Drawing.Point(87, 16);43 this.textBoxFrom.Name = "textBoxFrom";44 this.textBoxFrom.ReadOnly = true;45 this.textBoxFrom.Size = new System.Drawing.Size(407, 20);46 this.textBoxFrom.TabIndex = 2;47 this.textBoxFrom.Validating += new System.ComponentModel.CancelEventHandler(this.textBoxFrom_Validating);48 38 // 49 39 // groupBox2 50 40 // 51 this.groupBox2.Controls.Add(this.checkBoxTo); 52 this.groupBox2.Controls.Add(this.textBoxTo); 53 this.groupBox2.Controls.Add(this.checkBoxFrom); 54 this.groupBox2.Controls.Add(this.textBoxFrom); 41 this.groupBox2.Controls.Add(this.tableLayoutPanel2); 55 42 this.groupBox2.Dock = System.Windows.Forms.DockStyle.Fill; 56 43 this.groupBox2.Location = new System.Drawing.Point(0, 0); 44 this.groupBox2.Margin = new System.Windows.Forms.Padding(0); 57 45 this.groupBox2.Name = "groupBox2"; 58 this.groupBox2.Size = new System.Drawing.Size(5 00, 75);46 this.groupBox2.Size = new System.Drawing.Size(526, 63); 59 47 this.groupBox2.TabIndex = 19; 60 48 this.groupBox2.TabStop = false; … … 64 52 // 65 53 this.checkBoxTo.AutoSize = true; 66 this.checkBoxTo.Location = new System.Drawing.Point(9, 45); 54 this.checkBoxTo.Dock = System.Windows.Forms.DockStyle.Fill; 55 this.checkBoxTo.Location = new System.Drawing.Point(0, 22); 56 this.checkBoxTo.Margin = new System.Windows.Forms.Padding(0); 67 57 this.checkBoxTo.Name = "checkBoxTo"; 68 this.checkBoxTo.Size = new System.Drawing.Size( 42, 17);58 this.checkBoxTo.Size = new System.Drawing.Size(100, 22); 69 59 this.checkBoxTo.TabIndex = 7; 70 60 this.checkBoxTo.Text = "To:"; … … 73 63 // textBoxTo 74 64 // 75 this.textBoxTo. Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)76 | System.Windows.Forms.AnchorStyles.Right)));77 this. errorProvider.SetIconAlignment(this.textBoxTo, System.Windows.Forms.ErrorIconAlignment.TopLeft);78 this.textBoxTo. Location = new System.Drawing.Point(87, 42);65 this.textBoxTo.Dock = System.Windows.Forms.DockStyle.Fill; 66 this.errorProvider.SetIconAlignment(this.textBoxTo, System.Windows.Forms.ErrorIconAlignment.MiddleLeft); 67 this.textBoxTo.Location = new System.Drawing.Point(100, 22); 68 this.textBoxTo.Margin = new System.Windows.Forms.Padding(0); 79 69 this.textBoxTo.Name = "textBoxTo"; 80 70 this.textBoxTo.ReadOnly = true; 81 this.textBoxTo.Size = new System.Drawing.Size(4 07, 20);71 this.textBoxTo.Size = new System.Drawing.Size(420, 20); 82 72 this.textBoxTo.TabIndex = 6; 83 73 this.textBoxTo.Validating += new System.ComponentModel.CancelEventHandler(this.textBoxTo_Validating); 84 //85 // checkBoxFrom86 //87 this.checkBoxFrom.AutoSize = true;88 this.checkBoxFrom.Location = new System.Drawing.Point(9, 19);89 this.checkBoxFrom.Name = "checkBoxFrom";90 this.checkBoxFrom.Size = new System.Drawing.Size(52, 17);91 this.checkBoxFrom.TabIndex = 4;92 this.checkBoxFrom.Text = "From:";93 this.checkBoxFrom.UseVisualStyleBackColor = true;94 74 // 95 75 // errorProvider … … 97 77 this.errorProvider.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.NeverBlink; 98 78 this.errorProvider.ContainerControl = this; 79 // 80 // textBoxFrom 81 // 82 this.textBoxFrom.Dock = System.Windows.Forms.DockStyle.Fill; 83 this.errorProvider.SetIconAlignment(this.textBoxFrom, System.Windows.Forms.ErrorIconAlignment.MiddleLeft); 84 this.textBoxFrom.Location = new System.Drawing.Point(100, 0); 85 this.textBoxFrom.Margin = new System.Windows.Forms.Padding(0); 86 this.textBoxFrom.Name = "textBoxFrom"; 87 this.textBoxFrom.ReadOnly = true; 88 this.textBoxFrom.Size = new System.Drawing.Size(420, 20); 89 this.textBoxFrom.TabIndex = 2; 90 this.textBoxFrom.Validating += new System.ComponentModel.CancelEventHandler(this.textBoxFrom_Validating); 91 // 92 // checkBoxFrom 93 // 94 this.checkBoxFrom.AutoSize = true; 95 this.checkBoxFrom.Dock = System.Windows.Forms.DockStyle.Fill; 96 this.checkBoxFrom.Location = new System.Drawing.Point(0, 0); 97 this.checkBoxFrom.Margin = new System.Windows.Forms.Padding(0); 98 this.checkBoxFrom.Name = "checkBoxFrom"; 99 this.checkBoxFrom.Size = new System.Drawing.Size(100, 22); 100 this.checkBoxFrom.TabIndex = 4; 101 this.checkBoxFrom.Text = "From:"; 102 this.checkBoxFrom.UseVisualStyleBackColor = true; 103 // 104 // tableLayoutPanel2 105 // 106 this.tableLayoutPanel2.ColumnCount = 2; 107 this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 100F)); 108 this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); 109 this.tableLayoutPanel2.Controls.Add(this.textBoxTo, 1, 1); 110 this.tableLayoutPanel2.Controls.Add(this.textBoxFrom, 1, 0); 111 this.tableLayoutPanel2.Controls.Add(this.checkBoxFrom, 0, 0); 112 this.tableLayoutPanel2.Controls.Add(this.checkBoxTo, 0, 1); 113 this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill; 114 this.tableLayoutPanel2.Location = new System.Drawing.Point(3, 16); 115 this.tableLayoutPanel2.Margin = new System.Windows.Forms.Padding(0); 116 this.tableLayoutPanel2.Name = "tableLayoutPanel2"; 117 this.tableLayoutPanel2.RowCount = 2; 118 this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); 119 this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); 120 this.tableLayoutPanel2.Size = new System.Drawing.Size(520, 44); 121 this.tableLayoutPanel2.TabIndex = 22; 99 122 // 100 123 // NumericRangeControl … … 104 127 this.Controls.Add(this.groupBox2); 105 128 this.Name = "NumericRangeControl"; 106 this.Size = new System.Drawing.Size(5 00, 75);129 this.Size = new System.Drawing.Size(526, 63); 107 130 this.groupBox2.ResumeLayout(false); 108 this.groupBox2.PerformLayout();109 131 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit(); 132 this.tableLayoutPanel2.ResumeLayout(false); 133 this.tableLayoutPanel2.PerformLayout(); 110 134 this.ResumeLayout(false); 111 135 … … 113 137 114 138 #endregion 115 private System.Windows.Forms.TextBox textBoxFrom;116 139 private System.Windows.Forms.GroupBox groupBox2; 117 140 private System.Windows.Forms.CheckBox checkBoxTo; 118 141 private System.Windows.Forms.TextBox textBoxTo; 142 private System.Windows.Forms.ErrorProvider errorProvider; 119 143 private System.Windows.Forms.CheckBox checkBoxFrom; 120 private System.Windows.Forms.ErrorProvider errorProvider; 144 private System.Windows.Forms.TextBox textBoxFrom; 145 private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2; 121 146 } 122 147 } -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/ArrayValueVM.cs
r17464 r17471 5 5 using System.Text; 6 6 using System.Threading.Tasks; 7 using System.Windows.Forms; 7 8 8 9 namespace HeuristicLab.JsonInterface.OptimizerIntegration { … … 15 16 protected override double MaxTypeValue => double.MaxValue; 16 17 17 public override JsonItemBaseControl Control =>18 new JsonItem BaseControl(this, new JsonItemDoubleArrayValueControl(this));18 public override UserControl Control => 19 new JsonItemDoubleArrayValueControl(this); 19 20 20 21 public override double[] Value { … … 34 35 protected override int MaxTypeValue => int.MaxValue; 35 36 36 public override JsonItemBaseControl Control =>37 public override UserControl Control => 37 38 new JsonItemBaseControl(this, new JsonItemIntArrayValueControl(this)); 38 39 -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/JsonItemVMBase.cs
r17451 r17471 9 9 10 10 namespace HeuristicLab.JsonInterface.OptimizerIntegration { 11 public class JsonItemVMBase : IJsonItemVM { 12 public event PropertyChangedEventHandler PropertyChanged; 13 public event Action ItemChanged; 14 11 public abstract class JsonItemVMBase : IJsonItemVM { 15 12 private IJsonItem item; 16 13 public IJsonItem Item { … … 23 20 } 24 21 } 25 26 22 public TreeNode TreeNode { get; set; } 27 23 public TreeView TreeView { get; set; } 28 29 protected void OnPropertyChange(object sender, string propertyName) {30 // Make a temporary copy of the event to avoid possibility of31 // a race condition if the last subscriber unsubscribes32 // immediately after the null check and before the event is raised.33 // https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/events/how-to-raise-base-class-events-in-derived-classes34 35 PropertyChangedEventHandler tmp = PropertyChanged;36 tmp?.Invoke(this, new PropertyChangedEventArgs(propertyName));37 }38 39 public virtual Type JsonItemType => typeof(JsonItem);40 41 42 24 public bool Selected { 43 25 get => Item.Active; … … 53 35 } 54 36 } 55 56 37 public string Name { 57 38 get => Item.Name; … … 61 42 } 62 43 } 63 64 44 public string Description { 65 45 get => Item.Description; … … 70 50 } 71 51 72 public string ActualName { 73 get => Item.ActualName; 74 set { 75 Item.ActualName = value; 76 OnPropertyChange(this, nameof(ActualName)); 77 } 52 public abstract Type JsonItemType { get; } 53 public abstract UserControl Control { get; } 54 55 public event PropertyChangedEventHandler PropertyChanged; 56 public event Action ItemChanged; 57 58 59 protected void OnPropertyChange(object sender, string propertyName) { 60 // Make a temporary copy of the event to avoid possibility of 61 // a race condition if the last subscriber unsubscribes 62 // immediately after the null check and before the event is raised. 63 // https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/events/how-to-raise-base-class-events-in-derived-classes 64 65 PropertyChangedEventHandler tmp = PropertyChanged; 66 tmp?.Invoke(this, new PropertyChangedEventArgs(propertyName)); 78 67 } 79 80 public virtual JsonItemBaseControl Control => new JsonItemBaseControl(this);81 68 82 69 #region IDisposable Support -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/MatrixValueVM.cs
r17464 r17471 5 5 using System.Text; 6 6 using System.Threading.Tasks; 7 using System.Windows.Forms; 7 8 8 9 namespace HeuristicLab.JsonInterface.OptimizerIntegration { … … 10 11 public class DoubleMatrixValueVM : MatrixValueVM<double, DoubleMatrixJsonItem> { 11 12 public override Type JsonItemType => typeof(DoubleMatrixJsonItem); 12 public override JsonItemBaseControl Control => null;13 //new JsonItemDoubleMatrixValueControl(this);13 public override UserControl Control => 14 new JsonItemDoubleMatrixValueControl(this); 14 15 15 16 public override double[][] Value { … … 45 46 } 46 47 48 public IEnumerable<string> RowNames { 49 get => ((JsonItemType)Item).RowNames; 50 set { 51 ((JsonItemType)Item).RowNames = value; 52 OnPropertyChange(this, nameof(RowNames)); 53 } 54 } 55 public IEnumerable<string> ColumnNames { 56 get => ((JsonItemType)Item).ColumnNames; 57 set { 58 ((JsonItemType)Item).ColumnNames = value; 59 OnPropertyChange(this, nameof(ColumnNames)); 60 } 61 } 62 47 63 public void SetCellValue(T data, int row, int col) { 48 64 -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/RangeVM.cs
r17464 r17471 5 5 using System.Text; 6 6 using System.Threading.Tasks; 7 using System.Windows.Forms; 7 8 8 9 namespace HeuristicLab.JsonInterface.OptimizerIntegration { … … 15 16 protected override int MaxTypeValue => int.MaxValue; 16 17 17 public override JsonItemBaseControl Control =>18 new JsonItem BaseControl(this, new JsonItemRangeControl(this));18 public override UserControl Control => 19 new JsonItemRangeControl(this); 19 20 } 20 21 … … 26 27 protected override double MaxTypeValue => double.MaxValue; 27 28 28 public override JsonItemBaseControl Control =>29 new JsonItem BaseControl(this, new JsonItemRangeControl(this));29 public override UserControl Control => 30 new JsonItemRangeControl(this); 30 31 } 31 32 -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/ResultItemVM.cs
r17451 r17471 4 4 using System.Text; 5 5 using System.Threading.Tasks; 6 using System.Windows.Forms; 6 7 7 8 namespace HeuristicLab.JsonInterface.OptimizerIntegration { 8 9 public class ResultItemVM : JsonItemVMBase { 9 10 public override Type JsonItemType => typeof(ResultJsonItem); 10 public override JsonItemBaseControl Control =>11 public override UserControl Control => 11 12 new JsonItemBaseControl(this); 12 13 13 14 14 } -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/SingleValueVM.cs
r17464 r17471 14 14 protected override int MaxTypeValue => int.MaxValue; 15 15 16 public override JsonItemBaseControl Control =>17 new JsonItem BaseControl(this, new JsonItemIntValueControl(this));16 public override UserControl Control => 17 new JsonItemIntValueControl(this); 18 18 } 19 19 … … 24 24 protected override double MaxTypeValue => double.MaxValue; 25 25 26 public override JsonItemBaseControl Control =>27 new JsonItem BaseControl(this, new JsonItemDoubleValueControl(this));26 public override UserControl Control => 27 new JsonItemDoubleValueControl(this); 28 28 } 29 29 … … 34 34 protected override bool MaxTypeValue => true; 35 35 36 public override JsonItemBaseControl Control =>37 new JsonItemB aseControl(this, new JsonItemBoolControl(this));36 public override UserControl Control => 37 new JsonItemBoolControl(this); 38 38 } 39 39 -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/StringValueVM.cs
r17464 r17471 3 3 using System.Linq; 4 4 using System.Text; 5 using System.Threading; 5 6 using System.Threading.Tasks; 7 using System.Windows.Forms; 6 8 7 9 namespace HeuristicLab.JsonInterface.OptimizerIntegration { 8 10 public class StringValueVM : JsonItemVMBase { 9 11 public override Type JsonItemType => typeof(StringJsonItem); 10 public override JsonItemBaseControl Control =>11 new JsonItem BaseControl(this, new JsonItemValidValuesControl(this));12 public override UserControl Control => 13 new JsonItemValidValuesControl(this); 12 14 13 15 public string Value { -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/ExportJsonDialog.cs
r17453 r17471 51 51 private void InitCache() { 52 52 JI2VM = new Dictionary<Type, Type>(); 53 foreach (var vmType in ApplicationManager.Manager.GetTypes(typeof( JsonItemVMBase))) {54 JsonItemVMBase vm = (JsonItemVMBase)Activator.CreateInstance(vmType);53 foreach (var vmType in ApplicationManager.Manager.GetTypes(typeof(IJsonItemVM))) { 54 IJsonItemVM vm = (IJsonItemVM)Activator.CreateInstance(vmType); 55 55 JI2VM.Add(vm.JsonItemType, vmType); 56 56 } … … 96 96 foreach (var c in item.Children) { 97 97 if (IsDrawableItem(c)) { 98 if (c is ResultJsonItem) {98 if (c is IResultJsonItem) { 99 99 TreeNode childNode = new TreeNode(c.Name); 100 100 treeViewResults.Nodes.Add(childNode); … … 113 113 114 114 private void RegisterItem(TreeNode node, IJsonItem item, TreeView tv) { 115 if (JI2VM.TryGetValue(item.GetType(), out Type vmType)) { 115 if (JI2VM.TryGetValue(item.GetType(), out Type vmType)) { // TODO: enhance for interfaces? 116 116 IJsonItemVM vm = (IJsonItemVM)Activator.CreateInstance(vmType); 117 117 … … 123 123 VMs.Add(vm); 124 124 Node2VM.Add(node, vm); 125 UserControl control = vm.Control;125 UserControl control = new JsonItemBaseControl(vm, vm.Control); 126 126 Node2Control.Add(node, control); 127 } else { 128 //node. 127 129 } 128 130 } … … 136 138 } 137 139 138 return b || (item.Value != null || item.Range != null || item .ActualName != null || item isResultJsonItem);140 return b || (item.Value != null || item.Range != null || item is ILookupJsonItem || item is IResultJsonItem); 139 141 } 140 142 -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/JsonItemBoolControl.Designer.cs
r17464 r17471 26 26 this.checkBoxValue = new System.Windows.Forms.CheckBox(); 27 27 this.label2 = new System.Windows.Forms.Label(); 28 this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); 29 this.tableLayoutPanel1.SuspendLayout(); 28 30 this.SuspendLayout(); 29 31 // 30 32 // checkBoxValue 31 33 // 32 this.checkBoxValue.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)33 | System.Windows.Forms.AnchorStyles.Right)));34 34 this.checkBoxValue.AutoSize = true; 35 this.checkBoxValue.Location = new System.Drawing.Point(89, 1); 35 this.checkBoxValue.Dock = System.Windows.Forms.DockStyle.Fill; 36 this.checkBoxValue.Location = new System.Drawing.Point(100, 0); 37 this.checkBoxValue.Margin = new System.Windows.Forms.Padding(0); 36 38 this.checkBoxValue.Name = "checkBoxValue"; 37 this.checkBoxValue.Size = new System.Drawing.Size( 15, 14);39 this.checkBoxValue.Size = new System.Drawing.Size(400, 22); 38 40 this.checkBoxValue.TabIndex = 19; 39 41 this.checkBoxValue.UseVisualStyleBackColor = true; … … 42 44 // 43 45 this.label2.AutoSize = true; 44 this.label2.Location = new System.Drawing.Point(3, 1); 46 this.label2.Dock = System.Windows.Forms.DockStyle.Fill; 47 this.label2.Location = new System.Drawing.Point(0, 0); 48 this.label2.Margin = new System.Windows.Forms.Padding(0); 45 49 this.label2.Name = "label2"; 46 this.label2.Size = new System.Drawing.Size( 34, 13);50 this.label2.Size = new System.Drawing.Size(100, 22); 47 51 this.label2.TabIndex = 20; 48 52 this.label2.Text = "Value"; 53 this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; 54 // 55 // tableLayoutPanel1 56 // 57 this.tableLayoutPanel1.ColumnCount = 2; 58 this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 100F)); 59 this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); 60 this.tableLayoutPanel1.Controls.Add(this.checkBoxValue, 1, 0); 61 this.tableLayoutPanel1.Controls.Add(this.label2, 0, 0); 62 this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Top; 63 this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0); 64 this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(0); 65 this.tableLayoutPanel1.Name = "tableLayoutPanel1"; 66 this.tableLayoutPanel1.RowCount = 1; 67 this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); 68 this.tableLayoutPanel1.Size = new System.Drawing.Size(500, 22); 69 this.tableLayoutPanel1.TabIndex = 22; 49 70 // 50 71 // JsonItemBoolControl … … 52 73 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 53 74 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 54 this.Controls.Add(this. checkBoxValue);55 this. Controls.Add(this.label2);75 this.Controls.Add(this.tableLayoutPanel1); 76 this.Margin = new System.Windows.Forms.Padding(0); 56 77 this.Name = "JsonItemBoolControl"; 57 this.Size = new System.Drawing.Size(500, 15); 78 this.Size = new System.Drawing.Size(500, 22); 79 this.tableLayoutPanel1.ResumeLayout(false); 80 this.tableLayoutPanel1.PerformLayout(); 58 81 this.ResumeLayout(false); 59 this.PerformLayout();60 82 61 83 } … … 64 86 private System.Windows.Forms.CheckBox checkBoxValue; 65 87 private System.Windows.Forms.Label label2; 88 private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; 66 89 } 67 90 } -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/JsonItemMultiValueControl.Designer.cs
r17464 r17471 33 33 this.checkBoxRows = new System.Windows.Forms.CheckBox(); 34 34 this.errorProvider = new System.Windows.Forms.ErrorProvider(this.components); 35 this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); 36 this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); 37 this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel(); 35 38 ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit(); 36 39 this.groupBox1.SuspendLayout(); 37 40 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit(); 41 this.tableLayoutPanel1.SuspendLayout(); 42 this.tableLayoutPanel2.SuspendLayout(); 43 this.tableLayoutPanel3.SuspendLayout(); 38 44 this.SuspendLayout(); 39 45 // … … 44 50 this.dataGridView.AllowUserToResizeColumns = false; 45 51 this.dataGridView.AllowUserToResizeRows = false; 46 this.dataGridView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)47 | System.Windows.Forms.AnchorStyles.Left)48 | System.Windows.Forms.AnchorStyles.Right)));49 52 this.dataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; 50 this.dataGridView.Location = new System.Drawing.Point(9, 70); 53 this.dataGridView.Dock = System.Windows.Forms.DockStyle.Fill; 54 this.dataGridView.Location = new System.Drawing.Point(0, 44); 55 this.dataGridView.Margin = new System.Windows.Forms.Padding(0); 51 56 this.dataGridView.Name = "dataGridView"; 52 this.dataGridView.Size = new System.Drawing.Size(4 87, 143);57 this.dataGridView.Size = new System.Drawing.Size(475, 172); 53 58 this.dataGridView.TabIndex = 13; 54 59 // … … 57 62 this.numericRangeControl1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) 58 63 | System.Windows.Forms.AnchorStyles.Right))); 59 this.numericRangeControl1.Location = new System.Drawing.Point(0, 225); 64 this.numericRangeControl1.Location = new System.Drawing.Point(0, 235); 65 this.numericRangeControl1.Margin = new System.Windows.Forms.Padding(0); 60 66 this.numericRangeControl1.Name = "numericRangeControl1"; 61 this.numericRangeControl1.Size = new System.Drawing.Size( 502, 71);67 this.numericRangeControl1.Size = new System.Drawing.Size(481, 63); 62 68 this.numericRangeControl1.TabIndex = 14; 63 69 // 64 70 // groupBox1 65 71 // 66 this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 67 | System.Windows.Forms.AnchorStyles.Left) 68 | System.Windows.Forms.AnchorStyles.Right))); 69 this.groupBox1.Controls.Add(this.textBoxColumns); 70 this.groupBox1.Controls.Add(this.textBoxRows); 71 this.groupBox1.Controls.Add(this.checkBoxColumns); 72 this.groupBox1.Controls.Add(this.checkBoxRows); 73 this.groupBox1.Controls.Add(this.dataGridView); 72 this.groupBox1.Controls.Add(this.tableLayoutPanel2); 73 this.groupBox1.Dock = System.Windows.Forms.DockStyle.Fill; 74 74 this.groupBox1.Location = new System.Drawing.Point(0, 0); 75 75 this.groupBox1.Margin = new System.Windows.Forms.Padding(0); 76 76 this.groupBox1.Name = "groupBox1"; 77 this.groupBox1.Size = new System.Drawing.Size( 502, 222);77 this.groupBox1.Size = new System.Drawing.Size(481, 235); 78 78 this.groupBox1.TabIndex = 15; 79 79 this.groupBox1.TabStop = false; … … 82 82 // textBoxColumns 83 83 // 84 this.textBoxColumns. Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)85 | System.Windows.Forms.AnchorStyles.Right)));86 this. errorProvider.SetIconAlignment(this.textBoxRows, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);87 this.textBoxColumns. Location = new System.Drawing.Point(86, 46);84 this.textBoxColumns.Dock = System.Windows.Forms.DockStyle.Fill; 85 this.errorProvider.SetIconAlignment(this.textBoxColumns, System.Windows.Forms.ErrorIconAlignment.MiddleLeft); 86 this.textBoxColumns.Location = new System.Drawing.Point(100, 22); 87 this.textBoxColumns.Margin = new System.Windows.Forms.Padding(0); 88 88 this.textBoxColumns.Name = "textBoxColumns"; 89 89 this.textBoxColumns.ReadOnly = true; 90 this.textBoxColumns.Size = new System.Drawing.Size( 410, 20);90 this.textBoxColumns.Size = new System.Drawing.Size(375, 20); 91 91 this.textBoxColumns.TabIndex = 17; 92 this.textBoxColumns. TextChanged+= new System.EventHandler(this.textBoxColumns_TextChanged);92 this.textBoxColumns.Leave += new System.EventHandler(this.textBoxColumns_TextChanged); 93 93 this.textBoxColumns.Validating += new System.ComponentModel.CancelEventHandler(this.textBoxColumns_Validating); 94 94 // 95 95 // textBoxRows 96 96 // 97 this.textBoxRows. Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)98 | System.Windows.Forms.AnchorStyles.Right)));99 this. errorProvider.SetIconAlignment(this.textBoxColumns, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);100 this.textBoxRows. Location = new System.Drawing.Point(86, 20);97 this.textBoxRows.Dock = System.Windows.Forms.DockStyle.Fill; 98 this.errorProvider.SetIconAlignment(this.textBoxRows, System.Windows.Forms.ErrorIconAlignment.MiddleLeft); 99 this.textBoxRows.Location = new System.Drawing.Point(100, 0); 100 this.textBoxRows.Margin = new System.Windows.Forms.Padding(0); 101 101 this.textBoxRows.Name = "textBoxRows"; 102 102 this.textBoxRows.ReadOnly = true; 103 this.textBoxRows.Size = new System.Drawing.Size( 410, 20);103 this.textBoxRows.Size = new System.Drawing.Size(375, 20); 104 104 this.textBoxRows.TabIndex = 16; 105 this.textBoxRows. TextChanged+= new System.EventHandler(this.textBoxRows_TextChanged);105 this.textBoxRows.Leave += new System.EventHandler(this.textBoxRows_TextChanged); 106 106 this.textBoxRows.Validating += new System.ComponentModel.CancelEventHandler(this.textBoxRows_Validating); 107 107 // … … 109 109 // 110 110 this.checkBoxColumns.AutoSize = true; 111 this.checkBoxColumns.Location = new System.Drawing.Point(10, 46); 111 this.checkBoxColumns.Dock = System.Windows.Forms.DockStyle.Fill; 112 this.checkBoxColumns.Location = new System.Drawing.Point(0, 22); 113 this.checkBoxColumns.Margin = new System.Windows.Forms.Padding(0); 112 114 this.checkBoxColumns.Name = "checkBoxColumns"; 113 this.checkBoxColumns.Size = new System.Drawing.Size( 69, 17);115 this.checkBoxColumns.Size = new System.Drawing.Size(100, 22); 114 116 this.checkBoxColumns.TabIndex = 15; 115 117 this.checkBoxColumns.Text = "Columns:"; … … 119 121 // 120 122 this.checkBoxRows.AutoSize = true; 121 this.checkBoxRows.Location = new System.Drawing.Point(10, 23); 123 this.checkBoxRows.Dock = System.Windows.Forms.DockStyle.Fill; 124 this.checkBoxRows.Location = new System.Drawing.Point(0, 0); 125 this.checkBoxRows.Margin = new System.Windows.Forms.Padding(0); 122 126 this.checkBoxRows.Name = "checkBoxRows"; 123 this.checkBoxRows.Size = new System.Drawing.Size( 56, 17);127 this.checkBoxRows.Size = new System.Drawing.Size(100, 22); 124 128 this.checkBoxRows.TabIndex = 14; 125 129 this.checkBoxRows.Text = "Rows:"; … … 130 134 this.errorProvider.ContainerControl = this; 131 135 // 136 // tableLayoutPanel1 137 // 138 this.tableLayoutPanel1.ColumnCount = 2; 139 this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 100F)); 140 this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); 141 this.tableLayoutPanel1.Controls.Add(this.textBoxColumns, 1, 1); 142 this.tableLayoutPanel1.Controls.Add(this.checkBoxRows, 0, 0); 143 this.tableLayoutPanel1.Controls.Add(this.textBoxRows, 1, 0); 144 this.tableLayoutPanel1.Controls.Add(this.checkBoxColumns, 0, 1); 145 this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Top; 146 this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0); 147 this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(0); 148 this.tableLayoutPanel1.Name = "tableLayoutPanel1"; 149 this.tableLayoutPanel1.RowCount = 2; 150 this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); 151 this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); 152 this.tableLayoutPanel1.Size = new System.Drawing.Size(475, 44); 153 this.tableLayoutPanel1.TabIndex = 16; 154 // 155 // tableLayoutPanel2 156 // 157 this.tableLayoutPanel2.ColumnCount = 1; 158 this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); 159 this.tableLayoutPanel2.Controls.Add(this.dataGridView, 0, 1); 160 this.tableLayoutPanel2.Controls.Add(this.tableLayoutPanel1, 0, 0); 161 this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill; 162 this.tableLayoutPanel2.Location = new System.Drawing.Point(3, 16); 163 this.tableLayoutPanel2.Margin = new System.Windows.Forms.Padding(0); 164 this.tableLayoutPanel2.Name = "tableLayoutPanel2"; 165 this.tableLayoutPanel2.RowCount = 2; 166 this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 44F)); 167 this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); 168 this.tableLayoutPanel2.Size = new System.Drawing.Size(475, 216); 169 this.tableLayoutPanel2.TabIndex = 17; 170 // 171 // tableLayoutPanel3 172 // 173 this.tableLayoutPanel3.ColumnCount = 1; 174 this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); 175 this.tableLayoutPanel3.Controls.Add(this.numericRangeControl1, 0, 1); 176 this.tableLayoutPanel3.Controls.Add(this.groupBox1, 0, 0); 177 this.tableLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill; 178 this.tableLayoutPanel3.Location = new System.Drawing.Point(0, 0); 179 this.tableLayoutPanel3.Margin = new System.Windows.Forms.Padding(0); 180 this.tableLayoutPanel3.Name = "tableLayoutPanel3"; 181 this.tableLayoutPanel3.RowCount = 2; 182 this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); 183 this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 63F)); 184 this.tableLayoutPanel3.Size = new System.Drawing.Size(481, 298); 185 this.tableLayoutPanel3.TabIndex = 16; 186 // 132 187 // JsonItemMultiValueControl 133 188 // 134 189 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 135 190 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 136 this.Controls.Add(this.groupBox1); 137 this.Controls.Add(this.numericRangeControl1); 191 this.Controls.Add(this.tableLayoutPanel3); 138 192 this.errorProvider.SetIconAlignment(this, System.Windows.Forms.ErrorIconAlignment.MiddleLeft); 193 this.Margin = new System.Windows.Forms.Padding(0); 139 194 this.Name = "JsonItemMultiValueControl"; 140 this.Size = new System.Drawing.Size( 502, 296);195 this.Size = new System.Drawing.Size(481, 298); 141 196 ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit(); 142 197 this.groupBox1.ResumeLayout(false); 143 this.groupBox1.PerformLayout();144 198 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit(); 199 this.tableLayoutPanel1.ResumeLayout(false); 200 this.tableLayoutPanel1.PerformLayout(); 201 this.tableLayoutPanel2.ResumeLayout(false); 202 this.tableLayoutPanel3.ResumeLayout(false); 145 203 this.ResumeLayout(false); 146 204 … … 157 215 private System.Windows.Forms.TextBox textBoxColumns; 158 216 private System.Windows.Forms.ErrorProvider errorProvider; 217 private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; 218 private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2; 219 private System.Windows.Forms.TableLayoutPanel tableLayoutPanel3; 159 220 } 160 221 } -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/JsonItemMultiValueControl.cs
r17464 r17471 11 11 namespace HeuristicLab.JsonInterface.OptimizerIntegration { 12 12 13 public class JsonItemDoubleNamedMatrixValueControl : JsonItemMultiValueControl<double> {14 protected override IEnumerable<string> RowNames {15 get => ((DoubleNamedMatrixValueVM)VM).RowNames;16 set => ((DoubleNamedMatrixValueVM)VM).RowNames = value;17 }18 protected override IEnumerable<string> ColumnNames {19 get => ((DoubleNamedMatrixValueVM)VM).ColumnNames;20 set => ((DoubleNamedMatrixValueVM)VM).ColumnNames = value;21 }22 23 public JsonItemDoubleNamedMatrixValueControl(DoubleNamedMatrixValueVM vm) : base(vm, vm.Value) { }24 25 protected override void SaveCellData(double data, int row, int col) {26 DoubleNamedMatrixValueVM vm = VM as DoubleNamedMatrixValueVM;27 vm.SetCellValue(data, row, col);28 }29 }30 31 13 public class JsonItemDoubleMatrixValueControl : JsonItemMultiValueControl<double> { 32 protected override IEnumerable<string> RowNames { get => null; set { } }33 protected override IEnumerable<string> ColumnNames { get => null; set { } }34 35 14 public JsonItemDoubleMatrixValueControl(DoubleMatrixValueVM vm) : base(vm, vm.Value) { } 36 15 37 16 protected override void SaveCellData(double data, int row, int col) { 38 17 DoubleMatrixValueVM vm = VM as DoubleMatrixValueVM; 39 18 vm.SetCellValue(data, row, col); 40 19 } 20 41 21 } 42 22 43 23 public class JsonItemIntArrayValueControl : JsonItemMultiValueControl<int> { 44 protected override IEnumerable<string> RowNames { get => null; set { } }45 protected override IEnumerable<string> ColumnNames { get => null; set { } }46 47 24 public JsonItemIntArrayValueControl(IntArrayValueVM vm) : base(vm, vm.Value) { } 48 25 49 26 protected override void SaveCellData(int data, int row, int col) { 50 27 IntArrayValueVM vm = VM as IntArrayValueVM; 51 28 vm.SetIndexValue(data, row); 52 29 } 30 53 31 } 54 32 55 33 public class JsonItemDoubleArrayValueControl : JsonItemMultiValueControl<double> { 56 protected override IEnumerable<string> RowNames { get => null; set { } }57 protected override IEnumerable<string> ColumnNames { get => null; set { } }58 59 34 public JsonItemDoubleArrayValueControl(DoubleArrayValueVM vm) : base(vm, vm.Value) { } 60 35 61 36 protected override void SaveCellData(double data, int row, int col) { 62 37 DoubleArrayValueVM vm = VM as DoubleArrayValueVM; 63 38 vm.SetIndexValue(data, row); 64 39 } 40 65 41 } 66 42 … … 68 44 protected IJsonItemVM VM { get; set; } 69 45 protected NumericRangeControl NumericRangeControl { get; set; } 70 private int _rows; 71 private int Rows { 72 get => _rows; 46 private int Rows { get; set; } 47 private int Columns { get; set; } 48 49 private T[][] Matrix { get; set; } 50 51 protected IEnumerable<string> RowNames { 52 get { 53 if(VM is IMatrixJsonItemVM mVM) 54 return mVM.RowNames; 55 return null; 56 } 73 57 set { 74 _rows = value; 75 RefreshMatrix(); 76 } 77 } 78 79 private int _cols; 80 private int Columns { 81 get => _cols; 58 if (VM is IMatrixJsonItemVM mVM) 59 mVM.RowNames = value; 60 } 61 } 62 protected IEnumerable<string> ColumnNames { 63 get { 64 if (VM is IMatrixJsonItemVM mVM) 65 return mVM.ColumnNames; 66 return null; 67 } 82 68 set { 83 _cols = value; 84 RefreshMatrix(); 85 } 86 } 87 88 private T[][] Matrix { get; set; } 89 90 protected abstract IEnumerable<string> RowNames { get; set; } 91 protected abstract IEnumerable<string> ColumnNames { get; set; } 92 93 public JsonItemMultiValueControl(IMatrixJsonItemVM vm, T[][] matrix) /*: base(vm)*/ { 69 if (VM is IMatrixJsonItemVM mVM) 70 mVM.ColumnNames = value; 71 } 72 } 73 74 public JsonItemMultiValueControl(IMatrixJsonItemVM vm, T[][] matrix) { 94 75 InitializeComponent(); 95 76 VM = vm; … … 101 82 102 83 Matrix = matrix; 103 _cols = cols;104 _rows = rows;84 Columns = cols; 85 Rows = rows; 105 86 RefreshMatrix(); 106 87 InitSizeConfiguration(rows, cols); … … 109 90 } 110 91 111 public JsonItemMultiValueControl(IArrayJsonItemVM vm, T[] array) /*: base(vm)*/{92 public JsonItemMultiValueControl(IArrayJsonItemVM vm, T[] array) { 112 93 InitializeComponent(); 113 94 VM = vm; … … 118 99 Matrix = new T[1][]; 119 100 Matrix[0] = array; 120 _cols = 1;121 _rows = length;101 Columns = 1; 102 Rows = length; 122 103 RefreshMatrix(); 123 104 … … 154 135 Matrix = new T[Columns][]; 155 136 156 // columns must added first 157 if(RowNames != null && RowNames.Count() == Columns) { 158 foreach(var name in RowNames) { 159 dataGridView.Columns.Add(name, name); 160 } 161 } else { 162 for(int c = 0; c < Columns; ++c) { 163 dataGridView.Columns.Add($"Column {c}", $"Column {c}"); 164 } 137 for (int c = 0; c < Columns; ++c) { 138 string name = $"Column {c}"; 139 if (RowNames != null && c < RowNames.Count()) 140 name = RowNames.ElementAt(c); 141 dataGridView.Columns.Add(name, name); 165 142 } 166 143 … … 178 155 //col and row is switched for dataGridView 179 156 dataGridView[c, r].Value = Matrix[c][r]; 157 string name = $"Row {r}"; 180 158 if (ColumnNames != null && r < ColumnNames.Count()) 181 dataGridView.Rows[r].HeaderCell.Value = ColumnNames.ElementAt(r); 182 else 183 dataGridView.Rows[r].HeaderCell.Value = $"Row {r}"; 159 name = ColumnNames.ElementAt(r); 160 dataGridView.Rows[r].HeaderCell.Value = name; 184 161 } 185 162 } 186 163 } 187 164 dataGridView.RowHeadersWidth = 100; 188 189 165 } 190 166 … … 230 206 231 207 private void textBoxRows_TextChanged(object sender, EventArgs e) { 232 if( int.TryParse(textBoxRows.Text, out int r)) {208 if(!textBoxRows.ReadOnly && int.TryParse(textBoxRows.Text, out int r) && Rows != r) { 233 209 Rows = r; 210 RefreshMatrix(); 234 211 } 235 212 } 236 213 237 214 private void textBoxColumns_TextChanged(object sender, EventArgs e) { 238 if ( int.TryParse(textBoxColumns.Text, out int c)) {215 if (!textBoxColumns.ReadOnly && int.TryParse(textBoxColumns.Text, out int c) && Columns != c) { 239 216 Columns = c; 217 RefreshMatrix(); 240 218 } 241 219 } -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/JsonItemRangeControl.Designer.cs
r17464 r17471 27 27 this.groupBox1 = new System.Windows.Forms.GroupBox(); 28 28 this.textBoxValueTo = new System.Windows.Forms.TextBox(); 29 this.textBoxValueFrom = new System.Windows.Forms.TextBox();30 29 this.label4 = new System.Windows.Forms.Label(); 31 30 this.label2 = new System.Windows.Forms.Label(); 31 this.errorProvider = new System.Windows.Forms.ErrorProvider(this.components); 32 this.textBoxValueFrom = new System.Windows.Forms.TextBox(); 33 this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); 32 34 this.numericRangeControl = new HeuristicLab.JsonInterface.OptimizerIntegration.NumericRangeControl(); 33 this.errorProvider = new System.Windows.Forms.ErrorProvider(this.components);34 35 this.groupBox1.SuspendLayout(); 35 36 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit(); 37 this.tableLayoutPanel1.SuspendLayout(); 36 38 this.SuspendLayout(); 37 39 // … … 40 42 this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 41 43 | System.Windows.Forms.AnchorStyles.Right))); 42 this.groupBox1.Controls.Add(this.textBoxValueTo); 43 this.groupBox1.Controls.Add(this.textBoxValueFrom); 44 this.groupBox1.Controls.Add(this.label4); 45 this.groupBox1.Controls.Add(this.label2); 44 this.groupBox1.Controls.Add(this.tableLayoutPanel1); 46 45 this.groupBox1.Location = new System.Drawing.Point(0, 0); 47 46 this.groupBox1.Margin = new System.Windows.Forms.Padding(0); … … 54 53 // textBoxValueTo 55 54 // 56 this.textBoxValueTo. Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)57 | System.Windows.Forms.AnchorStyles.Right)));58 this.textBoxValueTo. Location = new System.Drawing.Point(85, 39);55 this.textBoxValueTo.Dock = System.Windows.Forms.DockStyle.Fill; 56 this.textBoxValueTo.Location = new System.Drawing.Point(100, 24); 57 this.textBoxValueTo.Margin = new System.Windows.Forms.Padding(0); 59 58 this.textBoxValueTo.Name = "textBoxValueTo"; 60 this.textBoxValueTo.Size = new System.Drawing.Size( 409, 20);59 this.textBoxValueTo.Size = new System.Drawing.Size(394, 20); 61 60 this.textBoxValueTo.TabIndex = 3; 61 // 62 // label4 63 // 64 this.label4.AutoSize = true; 65 this.label4.Dock = System.Windows.Forms.DockStyle.Fill; 66 this.label4.Location = new System.Drawing.Point(0, 24); 67 this.label4.Margin = new System.Windows.Forms.Padding(0); 68 this.label4.Name = "label4"; 69 this.label4.Size = new System.Drawing.Size(100, 25); 70 this.label4.TabIndex = 1; 71 this.label4.Text = "To:"; 72 this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; 73 // 74 // label2 75 // 76 this.label2.AutoSize = true; 77 this.label2.Dock = System.Windows.Forms.DockStyle.Fill; 78 this.label2.Location = new System.Drawing.Point(0, 0); 79 this.label2.Margin = new System.Windows.Forms.Padding(0); 80 this.label2.Name = "label2"; 81 this.label2.Size = new System.Drawing.Size(100, 24); 82 this.label2.TabIndex = 0; 83 this.label2.Text = "From:"; 84 this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; 85 // 86 // errorProvider 87 // 88 this.errorProvider.ContainerControl = this; 62 89 // 63 90 // textBoxValueFrom 64 91 // 65 this.textBoxValueFrom. Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)66 | System.Windows.Forms.AnchorStyles.Right)));67 this.textBoxValueFrom. Location = new System.Drawing.Point(85, 13);92 this.textBoxValueFrom.Dock = System.Windows.Forms.DockStyle.Fill; 93 this.textBoxValueFrom.Location = new System.Drawing.Point(100, 0); 94 this.textBoxValueFrom.Margin = new System.Windows.Forms.Padding(0); 68 95 this.textBoxValueFrom.Name = "textBoxValueFrom"; 69 this.textBoxValueFrom.Size = new System.Drawing.Size( 409, 20);96 this.textBoxValueFrom.Size = new System.Drawing.Size(394, 20); 70 97 this.textBoxValueFrom.TabIndex = 2; 71 98 // 72 // label499 // tableLayoutPanel1 73 100 // 74 this.label4.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 75 | System.Windows.Forms.AnchorStyles.Right))); 76 this.label4.AutoSize = true; 77 this.label4.Location = new System.Drawing.Point(6, 42); 78 this.label4.Name = "label4"; 79 this.label4.Size = new System.Drawing.Size(23, 13); 80 this.label4.TabIndex = 1; 81 this.label4.Text = "To:"; 82 // 83 // label2 84 // 85 this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 86 | System.Windows.Forms.AnchorStyles.Right))); 87 this.label2.AutoSize = true; 88 this.label2.Location = new System.Drawing.Point(6, 16); 89 this.label2.Name = "label2"; 90 this.label2.Size = new System.Drawing.Size(33, 13); 91 this.label2.TabIndex = 0; 92 this.label2.Text = "From:"; 101 this.tableLayoutPanel1.ColumnCount = 2; 102 this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 100F)); 103 this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); 104 this.tableLayoutPanel1.Controls.Add(this.label2, 0, 0); 105 this.tableLayoutPanel1.Controls.Add(this.textBoxValueTo, 1, 1); 106 this.tableLayoutPanel1.Controls.Add(this.textBoxValueFrom, 1, 0); 107 this.tableLayoutPanel1.Controls.Add(this.label4, 0, 1); 108 this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; 109 this.tableLayoutPanel1.Location = new System.Drawing.Point(3, 16); 110 this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(0); 111 this.tableLayoutPanel1.Name = "tableLayoutPanel1"; 112 this.tableLayoutPanel1.RowCount = 2; 113 this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); 114 this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); 115 this.tableLayoutPanel1.Size = new System.Drawing.Size(494, 49); 116 this.tableLayoutPanel1.TabIndex = 19; 93 117 // 94 118 // numericRangeControl … … 97 121 | System.Windows.Forms.AnchorStyles.Right))); 98 122 this.numericRangeControl.Location = new System.Drawing.Point(0, 71); 123 this.numericRangeControl.Margin = new System.Windows.Forms.Padding(0); 99 124 this.numericRangeControl.Name = "numericRangeControl"; 100 125 this.numericRangeControl.Size = new System.Drawing.Size(500, 74); 101 126 this.numericRangeControl.TabIndex = 18; 102 //103 // errorProvider104 //105 this.errorProvider.ContainerControl = this;106 127 // 107 128 // JsonItemRangeControl … … 112 133 this.Controls.Add(this.groupBox1); 113 134 this.errorProvider.SetIconAlignment(this, System.Windows.Forms.ErrorIconAlignment.MiddleLeft); 135 this.Margin = new System.Windows.Forms.Padding(0); 114 136 this.Name = "JsonItemRangeControl"; 115 this.Size = new System.Drawing.Size(500, 14 6);137 this.Size = new System.Drawing.Size(500, 147); 116 138 this.groupBox1.ResumeLayout(false); 117 this.groupBox1.PerformLayout();118 139 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit(); 140 this.tableLayoutPanel1.ResumeLayout(false); 141 this.tableLayoutPanel1.PerformLayout(); 119 142 this.ResumeLayout(false); 120 143 … … 125 148 private System.Windows.Forms.GroupBox groupBox1; 126 149 private System.Windows.Forms.TextBox textBoxValueTo; 127 private System.Windows.Forms.TextBox textBoxValueFrom;128 150 private System.Windows.Forms.Label label4; 129 151 private System.Windows.Forms.Label label2; 130 152 private NumericRangeControl numericRangeControl; 131 153 private System.Windows.Forms.ErrorProvider errorProvider; 154 private System.Windows.Forms.TextBox textBoxValueFrom; 155 private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; 132 156 } 133 157 } -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/JsonItemValidValuesControl.Designer.cs
r17464 r17471 30 30 this.groupBoxRange = new System.Windows.Forms.GroupBox(); 31 31 this.errorProvider = new System.Windows.Forms.ErrorProvider(this.components); 32 this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); 33 this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); 32 34 this.groupBoxRange.SuspendLayout(); 33 35 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit(); 36 this.tableLayoutPanel1.SuspendLayout(); 37 this.tableLayoutPanel2.SuspendLayout(); 34 38 this.SuspendLayout(); 35 39 // … … 47 51 this.tableOptions.RowCount = 1; 48 52 this.tableOptions.RowStyles.Add(new System.Windows.Forms.RowStyle()); 49 this.tableOptions.Size = new System.Drawing.Size(49 1, 190);53 this.tableOptions.Size = new System.Drawing.Size(494, 217); 50 54 this.tableOptions.TabIndex = 12; 51 55 // 52 56 // comboBoxValues 53 57 // 54 this.comboBoxValues.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 55 | System.Windows.Forms.AnchorStyles.Right))); 58 this.comboBoxValues.Dock = System.Windows.Forms.DockStyle.Fill; 56 59 this.comboBoxValues.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 57 60 this.comboBoxValues.FormattingEnabled = true; 58 this.comboBoxValues.Location = new System.Drawing.Point( 89, 1);61 this.comboBoxValues.Location = new System.Drawing.Point(100, 0); 59 62 this.comboBoxValues.Margin = new System.Windows.Forms.Padding(0); 60 63 this.comboBoxValues.Name = "comboBoxValues"; 61 this.comboBoxValues.Size = new System.Drawing.Size(40 8, 21);64 this.comboBoxValues.Size = new System.Drawing.Size(400, 21); 62 65 this.comboBoxValues.TabIndex = 15; 63 66 // … … 65 68 // 66 69 this.label2.AutoSize = true; 67 this.label2.Location = new System.Drawing.Point(3, 1); 70 this.label2.Dock = System.Windows.Forms.DockStyle.Fill; 71 this.label2.Location = new System.Drawing.Point(0, 0); 72 this.label2.Margin = new System.Windows.Forms.Padding(0); 68 73 this.label2.Name = "label2"; 69 this.label2.Size = new System.Drawing.Size( 34, 13);74 this.label2.Size = new System.Drawing.Size(100, 22); 70 75 this.label2.TabIndex = 16; 71 76 this.label2.Text = "Value"; 77 this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; 72 78 // 73 79 // groupBoxRange 74 80 // 75 this.groupBoxRange.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)76 | System.Windows.Forms.AnchorStyles.Left)77 | System.Windows.Forms.AnchorStyles.Right)));78 81 this.groupBoxRange.Controls.Add(this.tableOptions); 82 this.groupBoxRange.Dock = System.Windows.Forms.DockStyle.Fill; 79 83 this.groupBoxRange.Location = new System.Drawing.Point(0, 22); 80 this.groupBoxRange.Margin = new System.Windows.Forms.Padding(0 , 3, 0, 0);84 this.groupBoxRange.Margin = new System.Windows.Forms.Padding(0); 81 85 this.groupBoxRange.Name = "groupBoxRange"; 82 this.groupBoxRange.Size = new System.Drawing.Size( 497, 209);86 this.groupBoxRange.Size = new System.Drawing.Size(500, 236); 83 87 this.groupBoxRange.TabIndex = 17; 84 88 this.groupBoxRange.TabStop = false; … … 89 93 this.errorProvider.ContainerControl = this; 90 94 // 95 // tableLayoutPanel1 96 // 97 this.tableLayoutPanel1.ColumnCount = 1; 98 this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); 99 this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanel2, 0, 0); 100 this.tableLayoutPanel1.Controls.Add(this.groupBoxRange, 0, 1); 101 this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; 102 this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0); 103 this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(0); 104 this.tableLayoutPanel1.Name = "tableLayoutPanel1"; 105 this.tableLayoutPanel1.RowCount = 2; 106 this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 22F)); 107 this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); 108 this.tableLayoutPanel1.Size = new System.Drawing.Size(500, 258); 109 this.tableLayoutPanel1.TabIndex = 18; 110 // 111 // tableLayoutPanel2 112 // 113 this.tableLayoutPanel2.ColumnCount = 2; 114 this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 100F)); 115 this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); 116 this.tableLayoutPanel2.Controls.Add(this.label2, 0, 0); 117 this.tableLayoutPanel2.Controls.Add(this.comboBoxValues, 1, 0); 118 this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill; 119 this.tableLayoutPanel2.Location = new System.Drawing.Point(0, 0); 120 this.tableLayoutPanel2.Margin = new System.Windows.Forms.Padding(0); 121 this.tableLayoutPanel2.Name = "tableLayoutPanel2"; 122 this.tableLayoutPanel2.RowCount = 1; 123 this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); 124 this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); 125 this.tableLayoutPanel2.Size = new System.Drawing.Size(500, 22); 126 this.tableLayoutPanel2.TabIndex = 19; 127 // 91 128 // JsonItemValidValuesControl 92 129 // 93 130 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 94 131 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 95 this.Controls.Add(this.groupBoxRange); 96 this.Controls.Add(this.label2); 97 this.Controls.Add(this.comboBoxValues); 132 this.Controls.Add(this.tableLayoutPanel1); 98 133 this.ForeColor = System.Drawing.Color.Black; 99 134 this.errorProvider.SetIconAlignment(this, System.Windows.Forms.ErrorIconAlignment.MiddleLeft); 135 this.Margin = new System.Windows.Forms.Padding(0); 100 136 this.Name = "JsonItemValidValuesControl"; 101 this.Size = new System.Drawing.Size(500, 2 31);137 this.Size = new System.Drawing.Size(500, 258); 102 138 this.groupBoxRange.ResumeLayout(false); 103 139 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit(); 140 this.tableLayoutPanel1.ResumeLayout(false); 141 this.tableLayoutPanel2.ResumeLayout(false); 142 this.tableLayoutPanel2.PerformLayout(); 104 143 this.ResumeLayout(false); 105 this.PerformLayout();106 144 107 145 } … … 113 151 private System.Windows.Forms.GroupBox groupBoxRange; 114 152 private System.Windows.Forms.ErrorProvider errorProvider; 153 private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2; 154 private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; 115 155 } 116 156 } -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/JsonItemValueControl.Designer.cs
r17464 r17471 29 29 this.numericRangeControl1 = new HeuristicLab.JsonInterface.OptimizerIntegration.NumericRangeControl(); 30 30 this.errorProvider = new System.Windows.Forms.ErrorProvider(this.components); 31 this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); 32 this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); 31 33 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit(); 34 this.tableLayoutPanel1.SuspendLayout(); 35 this.tableLayoutPanel2.SuspendLayout(); 32 36 this.SuspendLayout(); 33 37 // 34 38 // textBoxValue 35 39 // 36 this.textBoxValue.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 37 | System.Windows.Forms.AnchorStyles.Right))); 38 this.textBoxValue.Location = new System.Drawing.Point(89, 1); 40 this.textBoxValue.Dock = System.Windows.Forms.DockStyle.Fill; 41 this.textBoxValue.Location = new System.Drawing.Point(100, 0); 39 42 this.textBoxValue.Margin = new System.Windows.Forms.Padding(0); 40 43 this.textBoxValue.Name = "textBoxValue"; 41 this.textBoxValue.Size = new System.Drawing.Size( 408, 20);44 this.textBoxValue.Size = new System.Drawing.Size(577, 20); 42 45 this.textBoxValue.TabIndex = 14; 43 46 this.textBoxValue.Validating += new System.ComponentModel.CancelEventHandler(this.textBoxValue_Validating); … … 46 49 // 47 50 this.label2.AutoSize = true; 48 this.label2.Location = new System.Drawing.Point(3, 1); 51 this.label2.Dock = System.Windows.Forms.DockStyle.Fill; 52 this.label2.Location = new System.Drawing.Point(0, 0); 53 this.label2.Margin = new System.Windows.Forms.Padding(0); 49 54 this.label2.Name = "label2"; 50 this.label2.Size = new System.Drawing.Size( 34, 13);55 this.label2.Size = new System.Drawing.Size(100, 22); 51 56 this.label2.TabIndex = 15; 52 57 this.label2.Text = "Value"; 58 this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; 53 59 // 54 60 // numericRangeControl1 55 61 // 56 this.numericRangeControl1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 57 | System.Windows.Forms.AnchorStyles.Right))); 58 this.numericRangeControl1.Location = new System.Drawing.Point(0, 24); 59 this.numericRangeControl1.Margin = new System.Windows.Forms.Padding(0, 3, 0, 0); 62 this.numericRangeControl1.Dock = System.Windows.Forms.DockStyle.Fill; 63 this.numericRangeControl1.Location = new System.Drawing.Point(0, 22); 64 this.numericRangeControl1.Margin = new System.Windows.Forms.Padding(0); 60 65 this.numericRangeControl1.Name = "numericRangeControl1"; 61 this.numericRangeControl1.Size = new System.Drawing.Size( 497, 72);66 this.numericRangeControl1.Size = new System.Drawing.Size(677, 66); 62 67 this.numericRangeControl1.TabIndex = 16; 63 68 // … … 66 71 this.errorProvider.ContainerControl = this; 67 72 // 73 // tableLayoutPanel1 74 // 75 this.tableLayoutPanel1.ColumnCount = 2; 76 this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 100F)); 77 this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); 78 this.tableLayoutPanel1.Controls.Add(this.label2, 0, 0); 79 this.tableLayoutPanel1.Controls.Add(this.textBoxValue, 1, 0); 80 this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Top; 81 this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0); 82 this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(0); 83 this.tableLayoutPanel1.Name = "tableLayoutPanel1"; 84 this.tableLayoutPanel1.RowCount = 1; 85 this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); 86 this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 22F)); 87 this.tableLayoutPanel1.Size = new System.Drawing.Size(677, 22); 88 this.tableLayoutPanel1.TabIndex = 17; 89 // 90 // tableLayoutPanel2 91 // 92 this.tableLayoutPanel2.ColumnCount = 1; 93 this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); 94 this.tableLayoutPanel2.Controls.Add(this.numericRangeControl1, 0, 1); 95 this.tableLayoutPanel2.Controls.Add(this.tableLayoutPanel1, 0, 0); 96 this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Top; 97 this.tableLayoutPanel2.Location = new System.Drawing.Point(0, 0); 98 this.tableLayoutPanel2.Margin = new System.Windows.Forms.Padding(0); 99 this.tableLayoutPanel2.Name = "tableLayoutPanel2"; 100 this.tableLayoutPanel2.RowCount = 2; 101 this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 22F)); 102 this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); 103 this.tableLayoutPanel2.Size = new System.Drawing.Size(677, 88); 104 this.tableLayoutPanel2.TabIndex = 18; 105 // 68 106 // JsonItemValueControl 69 107 // 70 108 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 71 109 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 72 this.Controls.Add(this.numericRangeControl1); 73 this.Controls.Add(this.label2); 74 this.Controls.Add(this.textBoxValue); 110 this.Controls.Add(this.tableLayoutPanel2); 75 111 this.errorProvider.SetIconAlignment(this, System.Windows.Forms.ErrorIconAlignment.MiddleLeft); 112 this.Margin = new System.Windows.Forms.Padding(0); 76 113 this.Name = "JsonItemValueControl"; 77 this.Size = new System.Drawing.Size( 500, 97);114 this.Size = new System.Drawing.Size(677, 88); 78 115 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit(); 116 this.tableLayoutPanel1.ResumeLayout(false); 117 this.tableLayoutPanel1.PerformLayout(); 118 this.tableLayoutPanel2.ResumeLayout(false); 79 119 this.ResumeLayout(false); 80 this.PerformLayout();81 120 82 121 } … … 88 127 private NumericRangeControl numericRangeControl1; 89 128 private System.Windows.Forms.ErrorProvider errorProvider; 129 private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; 130 private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2; 90 131 } 91 132 } -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/JsonItemValueControl.cs
r17464 r17471 28 28 protected override string ValuePropertyId => nameof(DoubleValueVM.Value); 29 29 #endregion 30 30 31 31 public JsonItemDoubleValueControl(DoubleValueVM vm) : base(vm) { 32 32 Init(); … … 45 45 #endregion 46 46 47 public JsonItemValueControl(JsonItemVMBase vm) { 47 public JsonItemValueControl() { 48 InitializeComponent(); 49 } 50 51 public JsonItemValueControl(IJsonItemVM vm) { 48 52 InitializeComponent(); 49 53 VM = vm; -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/LookupParameterConverter.cs
r17433 r17471 12 12 13 13 public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) => 14 ((ILookupParameter)item).ActualName = data.ActualName as string;14 ((ILookupParameter)item).ActualName = ((ILookupJsonItem)data).ActualName as string; 15 15 16 16 public override IJsonItem Extract(IItem value, IJsonItemConverter root) { 17 17 IParameter parameter = value as IParameter; 18 18 19 IJsonItem item = new JsonItem() {19 IJsonItem item = new LookupJsonItem() { 20 20 Name = parameter.Name, 21 21 Description = parameter.Description, -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/RegressionProblemDataConverter.cs
r17464 r17471 18 18 public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) { 19 19 var dictTmp = new Dictionary<string, IList>(); 20 Double NamedMatrixJsonItem matrix = data.Children[0] as DoubleNamedMatrixJsonItem;20 DoubleMatrixJsonItem matrix = data.Children[0] as DoubleMatrixJsonItem; 21 21 if(matrix != null) { 22 22 int c = 0; … … 68 68 ++c; 69 69 } 70 item.AddChildren(new Double NamedMatrixJsonItem() {70 item.AddChildren(new DoubleMatrixJsonItem() { 71 71 Name = "Dataset", 72 72 Value = mat, -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ResultParameterConverter.cs
r17451 r17471 17 17 return new ResultJsonItem() { 18 18 Name = res.ActualName, 19 ActualName = res.ActualName,20 19 Value = res.ActualName, 21 20 Description = res.Description -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ValueLookupParameterConverter.cs
r17451 r17471 13 13 public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) { 14 14 IValueLookupParameter param = item as IValueLookupParameter; 15 param.ActualName = CastValue<string>( data.ActualName);15 param.ActualName = CastValue<string>(((IValueLookupJsonItem)data).ActualName); 16 16 if (param.Value != null) 17 17 root.Inject(param.Value, data, root); … … 21 21 IValueLookupParameter param = value as IValueLookupParameter; 22 22 23 I JsonItem item = newJsonItem() {};23 IValueLookupJsonItem item = new ValueLookupJsonItem() {}; 24 24 25 25 if (param.Value != null) { 26 26 IJsonItem tmp = root.Extract(param.Value, root); 27 item = tmp; 27 item.Value = tmp.Value; 28 item.Range = tmp.Range; 29 item.Name = tmp.Name; 30 item.Description = tmp.Description; 31 item.AddChildren(tmp.Children); 32 item.Active = tmp.Active; 33 item.JsonItemReference = tmp; 28 34 } else { 29 35 var min = GetMinValue(param.DataType); -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ValueTypeMatrixConverter.cs
r17451 r17471 33 33 public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) { 34 34 DoubleMatrix mat = item as DoubleMatrix; 35 Double NamedMatrixJsonItem d = data as DoubleNamedMatrixJsonItem;35 DoubleMatrixJsonItem d = data as DoubleMatrixJsonItem; 36 36 CopyMatrixData(mat, d.Value); 37 37 } 38 38 39 39 public override IJsonItem Extract(IItem value, IJsonItemConverter root) => 40 new Double NamedMatrixJsonItem() {40 new DoubleMatrixJsonItem() { 41 41 Name = "[OverridableParamName]", 42 42 Description = value.ItemDescription, -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/HeuristicLab.JsonInterface.csproj
r17451 r17471 70 70 <Compile Include="Interfaces\IJsonItem.cs" /> 71 71 <Compile Include="Interfaces\IJsonItemValidator.cs" /> 72 <Compile Include="Interfaces\ILookupJsonItem.cs" /> 72 73 <Compile Include="Interfaces\IMatrixJsonItem.cs" /> 73 <Compile Include="Interfaces\INamedMatrixJsonItem.cs" /> 74 <Compile Include="Interfaces\IResultJsonItem.cs" /> 75 <Compile Include="Interfaces\IValueLookupJsonItem.cs" /> 74 76 <Compile Include="Models\ArrayJsonItemBase.cs" /> 75 77 <Compile Include="Models\BoolJsonItems.cs" /> … … 79 81 <Compile Include="Models\IntJsonItems.cs" /> 80 82 <Compile Include="Models\JsonItem.cs" /> 83 <Compile Include="Models\LookupJsonItem.cs" /> 81 84 <Compile Include="Models\MatrixJsonItemBase.cs" /> 82 <Compile Include="Models\NamedMatrixJsonItemBase.cs" />83 85 <Compile Include="Models\ResultJsonItem.cs" /> 84 86 <Compile Include="Models\StringJsonItem.cs" /> 85 87 <Compile Include="Models\UnsupportedJsonItem.cs" /> 88 <Compile Include="Models\ValueLookupJsonItem.cs" /> 86 89 <Compile Include="SingleLineArrayJsonWriter.cs" /> 87 90 <Compile Include="Extensions\TypeExtensions.cs" /> -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Interfaces/IJsonItem.cs
r17451 r17471 27 27 28 28 IEnumerable<object> Range { get; set; } 29 30 string ActualName { get; set; } 31 29 32 30 IJsonItemValidator GetValidator(); 33 31 -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Interfaces/IMatrixJsonItem.cs
r17446 r17471 9 9 bool RowsResizable { get; set; } 10 10 bool ColumnsResizable { get; set; } 11 IEnumerable<string> RowNames { get; set; } 12 IEnumerable<string> ColumnNames { get; set; } 11 13 } 12 14 } -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/JCGenerator.cs
r17451 r17471 41 41 // filter result items 42 42 foreach (var item in jsonItems) { 43 if (item is ResultJsonItem)43 if (item is IResultJsonItem) 44 44 resultItems.Add(Serialize(item)); 45 45 else … … 62 62 IEnumerable<IJsonItem> children = item.Children; 63 63 64 if (item.Active && (item.Value != null || item.Range != null || item is ResultJsonItem || item.ActualName != null)) {64 if (item.Active && (item.Value != null || item.Range != null || item is IResultJsonItem || item is ILookupJsonItem)) { 65 65 jsonItems.Add(item); 66 66 } -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Models/DoubleJsonItems.cs
r17451 r17471 23 23 } 24 24 } 25 26 public class DoubleNamedMatrixJsonItem : NamedMatrixJsonItemBase<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 }37 25 } -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Models/IntJsonItems.cs
r17454 r17471 7 7 namespace HeuristicLab.JsonInterface { 8 8 public class IntJsonItem : JsonItem<int> { 9 //public new IEnumerable<int> Range { get; } 9 10 /* 10 11 public int MinValue { get; set; } -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Models/JsonItem.cs
r17451 r17471 66 66 public virtual IEnumerable<object> Range { get; set; } 67 67 68 // TODO eigene items für LookUp?69 public virtual string ActualName { get; set; }70 71 68 // TODO jsonIgnore dataType? 72 69 … … 110 107 Value = jObject[nameof(IJsonItem.Value)]?.ToObject<object>(); 111 108 Range = jObject[nameof(IJsonItem.Range)]?.ToObject<object[]>(); 112 ActualName = jObject[nameof(IJsonItem.ActualName)]?.ToString();113 109 } 114 110 #endregion … … 118 114 * TODO protected abstract bool Validate(); 119 115 */ 120 116 121 117 protected virtual bool IsInRange() { 122 118 bool b1 = true, b2 = true; -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Models/MatrixJsonItemBase.cs
r17446 r17471 11 11 public virtual bool ColumnsResizable { get; set; } 12 12 13 IList<string> rows = new List<string>(); 14 public IEnumerable<string> RowNames { 15 get => rows; 16 set => rows = new List<string>(value); 17 } 18 19 IList<string> cols = new List<string>(); 20 public IEnumerable<string> ColumnNames { 21 get => cols; 22 set => cols = new List<string>(value); 23 } 24 13 25 public override void SetFromJObject(JObject jObject) { 14 26 base.SetFromJObject(jObject); 15 27 RowsResizable = (jObject[nameof(IMatrixJsonItem.RowsResizable)]?.ToObject<bool>()).GetValueOrDefault(); 16 28 ColumnsResizable = (jObject[nameof(IMatrixJsonItem.ColumnsResizable)]?.ToObject<bool>()).GetValueOrDefault(); 29 RowNames = jObject[nameof(IMatrixJsonItem.RowNames)]?.ToObject<IEnumerable<string>>(); 30 ColumnNames = jObject[nameof(IMatrixJsonItem.ColumnNames)]?.ToObject<IEnumerable<string>>(); 17 31 } 18 32 } -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Models/ResultJsonItem.cs
r17451 r17471 6 6 7 7 namespace HeuristicLab.JsonInterface { 8 public class ResultJsonItem : JsonItem {8 public class ResultJsonItem : JsonItem, IResultJsonItem { 9 9 10 10 } -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Models/UnsupportedJsonItem.cs
r17433 r17471 43 43 set => throw new NotSupportedException(); 44 44 } 45 46 public override string ActualName {47 get => throw new NotSupportedException();48 set => throw new NotSupportedException();49 }50 45 } 51 46 }
Note: See TracChangeset
for help on using the changeset viewer.