Changeset 17828 for branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration
- Timestamp:
- 02/01/21 14:37:18 (4 years ago)
- Location:
- branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration
- Files:
-
- 10 added
- 21 deleted
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/FileManager.cs
r17477 r17828 26 26 IStorableContent content = view.Content as IStorableContent; 27 27 if (!view.Locked && content != null) { 28 exportDialog.Content = content; 29 exportDialog.ShowDialog(); 28 if(content is IOptimizer) { 29 exportDialog.Content = content; 30 exportDialog.ShowDialog(); 31 } else { 32 MessageBox.Show("This cannot item cannot be converted.", "Unsupported Item", MessageBoxButtons.OK); 33 } 30 34 } 31 35 } -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/HeuristicLab.JsonInterface.OptimizerIntegration.csproj
r17519 r17828 95 95 <DependentUpon>Resources.resx</DependentUpon> 96 96 </Compile> 97 <Compile Include="Shared\ArrayJsonItemControl.cs"> 98 <SubType>UserControl</SubType> 99 </Compile> 100 <Compile Include="Shared\ArrayJsonItemControl.Designer.cs"> 101 <DependentUpon>ArrayJsonItemControl.cs</DependentUpon> 102 </Compile> 103 <Compile Include="Shared\CompoundControl.cs"> 104 <SubType>UserControl</SubType> 105 </Compile> 106 <Compile Include="Shared\CompoundControl.Designer.cs"> 107 <DependentUpon>CompoundControl.cs</DependentUpon> 108 </Compile> 97 109 <Compile Include="Shared\JsonItemBaseControl.cs"> 98 110 <SubType>UserControl</SubType> … … 101 113 <DependentUpon>JsonItemBaseControl.cs</DependentUpon> 102 114 </Compile> 115 <Compile Include="Shared\MatrixJsonItemControl.cs"> 116 <SubType>UserControl</SubType> 117 </Compile> 118 <Compile Include="Shared\MatrixJsonItemControl.Designer.cs"> 119 <DependentUpon>MatrixJsonItemControl.cs</DependentUpon> 120 </Compile> 103 121 <Compile Include="Shared\NumericRangeControl.cs"> 104 122 <SubType>UserControl</SubType> … … 108 126 </Compile> 109 127 <Compile Include="ViewModels\ArrayValueVM.cs" /> 128 <Compile Include="ViewModels\ConcreteRestrictedJsonItemVM.cs" /> 110 129 <Compile Include="ViewModels\DoubleVMs.cs" /> 111 130 <Compile Include="ViewModels\IntVMs.cs" /> … … 132 151 </Compile> 133 152 <Compile Include="FileManager.cs" /> 134 <Compile Include="Views\JsonItemConcreteItemArrayControl.cs">135 <SubType>UserControl</SubType>136 </Compile>137 <Compile Include="Views\JsonItemConcreteItemArrayControl.Designer.cs">138 <DependentUpon>JsonItemConcreteItemArrayControl.cs</DependentUpon>139 </Compile>140 <Compile Include="Views\JsonItemMultiValueControl.cs">141 <SubType>UserControl</SubType>142 </Compile>143 <Compile Include="Views\JsonItemMultiValueControl.Designer.cs">144 <DependentUpon>JsonItemMultiValueControl.cs</DependentUpon>145 </Compile>146 <Compile Include="Views\JsonItemBoolControl.cs">147 <SubType>UserControl</SubType>148 </Compile>149 <Compile Include="Views\JsonItemBoolControl.Designer.cs">150 <DependentUpon>JsonItemBoolControl.cs</DependentUpon>151 </Compile>152 <Compile Include="Views\JsonItemRangeControl.cs">153 <SubType>UserControl</SubType>154 </Compile>155 <Compile Include="Views\JsonItemRangeControl.Designer.cs">156 <DependentUpon>JsonItemRangeControl.cs</DependentUpon>157 </Compile>158 <Compile Include="Views\JsonItemValueControl.cs">159 <SubType>UserControl</SubType>160 </Compile>161 <Compile Include="Views\JsonItemValueControl.Designer.cs">162 <DependentUpon>JsonItemValueControl.cs</DependentUpon>163 </Compile>164 <Compile Include="Views\JsonItemValidValuesControl.cs">165 <SubType>UserControl</SubType>166 </Compile>167 <Compile Include="Views\JsonItemValidValuesControl.Designer.cs">168 <DependentUpon>JsonItemValidValuesControl.cs</DependentUpon>169 </Compile>170 153 <Compile Include="MenuItems\ImportJsonTemplateMenuItem.cs" /> 171 154 <Compile Include="MenuItems\ExportJsonTemplateMenuItem.cs" /> 172 155 <Compile Include="Plugin.cs" /> 173 156 <Compile Include="Properties\AssemblyInfo.cs" /> 174 <Compile Include="Views\LookupJsonItemControl.cs">175 <SubType>UserControl</SubType>176 </Compile>177 <Compile Include="Views\LookupJsonItemControl.Designer.cs">178 <DependentUpon>LookupJsonItemControl.cs</DependentUpon>179 </Compile>180 157 <Compile Include="Views\ValueLookupJsonItemControl.cs"> 181 158 <SubType>UserControl</SubType> … … 232 209 <LastGenOutput>Resources.Designer.cs</LastGenOutput> 233 210 </EmbeddedResource> 211 <EmbeddedResource Include="Shared\ArrayJsonItemControl.resx"> 212 <DependentUpon>ArrayJsonItemControl.cs</DependentUpon> 213 </EmbeddedResource> 214 <EmbeddedResource Include="Shared\CompoundControl.resx"> 215 <DependentUpon>CompoundControl.cs</DependentUpon> 216 </EmbeddedResource> 234 217 <EmbeddedResource Include="Shared\JsonItemBaseControl.resx"> 235 218 <DependentUpon>JsonItemBaseControl.cs</DependentUpon> 236 219 </EmbeddedResource> 220 <EmbeddedResource Include="Shared\MatrixJsonItemControl.resx"> 221 <DependentUpon>MatrixJsonItemControl.cs</DependentUpon> 222 </EmbeddedResource> 237 223 <EmbeddedResource Include="Shared\NumericRangeControl.resx"> 238 224 <DependentUpon>NumericRangeControl.cs</DependentUpon> … … 243 229 <EmbeddedResource Include="Views\ExportJsonDialog.resx"> 244 230 <DependentUpon>ExportJsonDialog.cs</DependentUpon> 245 </EmbeddedResource>246 <EmbeddedResource Include="Views\JsonItemConcreteItemArrayControl.resx">247 <DependentUpon>JsonItemConcreteItemArrayControl.cs</DependentUpon>248 </EmbeddedResource>249 <EmbeddedResource Include="Views\JsonItemMultiValueControl.resx">250 <DependentUpon>JsonItemMultiValueControl.cs</DependentUpon>251 </EmbeddedResource>252 <EmbeddedResource Include="Views\JsonItemBoolControl.resx">253 <DependentUpon>JsonItemBoolControl.cs</DependentUpon>254 </EmbeddedResource>255 <EmbeddedResource Include="Views\JsonItemRangeControl.resx">256 <DependentUpon>JsonItemRangeControl.cs</DependentUpon>257 </EmbeddedResource>258 <EmbeddedResource Include="Views\JsonItemValueControl.resx">259 <DependentUpon>JsonItemValueControl.cs</DependentUpon>260 </EmbeddedResource>261 <EmbeddedResource Include="Views\JsonItemValidValuesControl.resx">262 <DependentUpon>JsonItemValidValuesControl.cs</DependentUpon>263 </EmbeddedResource>264 <EmbeddedResource Include="Views\LookupJsonItemControl.resx">265 <DependentUpon>LookupJsonItemControl.cs</DependentUpon>266 231 </EmbeddedResource> 267 232 <EmbeddedResource Include="Views\ValueLookupJsonItemControl.resx"> -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Shared/ConcreteItemsRestrictor.Designer.cs
r17519 r17828 25 25 private void InitializeComponent() { 26 26 this.tableOptions = new System.Windows.Forms.TableLayoutPanel(); 27 this.groupBox1 = new System.Windows.Forms.GroupBox(); 28 this.groupBox1.SuspendLayout(); 27 29 this.SuspendLayout(); 28 30 // … … 36 38 this.tableOptions.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F)); 37 39 this.tableOptions.Dock = System.Windows.Forms.DockStyle.Fill; 38 this.tableOptions.Location = new System.Drawing.Point(0, 0); 40 this.tableOptions.Location = new System.Drawing.Point(3, 16); 41 this.tableOptions.Margin = new System.Windows.Forms.Padding(0); 39 42 this.tableOptions.Name = "tableOptions"; 40 43 this.tableOptions.RowCount = 1; 41 44 this.tableOptions.RowStyles.Add(new System.Windows.Forms.RowStyle()); 42 this.tableOptions.Size = new System.Drawing.Size( 500, 200);45 this.tableOptions.Size = new System.Drawing.Size(494, 181); 43 46 this.tableOptions.TabIndex = 13; 47 // 48 // groupBox1 49 // 50 this.groupBox1.Controls.Add(this.tableOptions); 51 this.groupBox1.Dock = System.Windows.Forms.DockStyle.Fill; 52 this.groupBox1.Location = new System.Drawing.Point(0, 0); 53 this.groupBox1.Margin = new System.Windows.Forms.Padding(0); 54 this.groupBox1.Name = "groupBox1"; 55 this.groupBox1.Size = new System.Drawing.Size(500, 200); 56 this.groupBox1.TabIndex = 0; 57 this.groupBox1.TabStop = false; 58 this.groupBox1.Text = "Allowed Items"; 44 59 // 45 60 // ConcreteItemsRestrictor … … 47 62 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 48 63 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 49 this.Controls.Add(this. tableOptions);64 this.Controls.Add(this.groupBox1); 50 65 this.Margin = new System.Windows.Forms.Padding(0); 51 66 this.Name = "ConcreteItemsRestrictor"; 52 67 this.Size = new System.Drawing.Size(500, 200); 68 this.groupBox1.ResumeLayout(false); 53 69 this.ResumeLayout(false); 54 70 … … 58 74 59 75 private System.Windows.Forms.TableLayoutPanel tableOptions; 76 private System.Windows.Forms.GroupBox groupBox1; 60 77 } 61 78 } -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Shared/JsonItemBaseControl.Designer.cs
r17473 r17828 30 30 this.tableLayoutPanel5 = new System.Windows.Forms.TableLayoutPanel(); 31 31 this.textBoxDescription = new System.Windows.Forms.TextBox(); 32 this.checkBoxActive = new System.Windows.Forms.CheckBox();33 32 this.label1 = new System.Windows.Forms.Label(); 34 33 this.labelDescription = new System.Windows.Forms.Label(); 35 this.labelEnable = new System.Windows.Forms.Label();36 34 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit(); 37 35 this.tableLayoutPanel1.SuspendLayout(); … … 48 46 this.textBoxName.Dock = System.Windows.Forms.DockStyle.Fill; 49 47 this.errorProvider.SetIconAlignment(this.textBoxName, System.Windows.Forms.ErrorIconAlignment.MiddleLeft); 50 this.textBoxName.Location = new System.Drawing.Point(100, 2 5);51 this.textBoxName.Margin = new System.Windows.Forms.Padding(0 );48 this.textBoxName.Location = new System.Drawing.Point(100, 2); 49 this.textBoxName.Margin = new System.Windows.Forms.Padding(0, 2, 0, 0); 52 50 this.textBoxName.Name = "textBoxName"; 53 51 this.textBoxName.Size = new System.Drawing.Size(394, 20); … … 65 63 this.tableLayoutPanel1.Name = "tableLayoutPanel1"; 66 64 this.tableLayoutPanel1.RowCount = 2; 67 this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 75F));65 this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 50F)); 68 66 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 67 this.tableLayoutPanel1.Size = new System.Drawing.Size(494, 594); 72 68 this.tableLayoutPanel1.TabIndex = 16; … … 77 73 this.tableLayoutPanel5.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 100F)); 78 74 this.tableLayoutPanel5.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); 79 this.tableLayoutPanel5.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F)); 80 this.tableLayoutPanel5.Controls.Add(this.textBoxDescription, 1, 2); 81 this.tableLayoutPanel5.Controls.Add(this.textBoxName, 1, 1); 82 this.tableLayoutPanel5.Controls.Add(this.checkBoxActive, 1, 0); 83 this.tableLayoutPanel5.Controls.Add(this.label1, 0, 1); 84 this.tableLayoutPanel5.Controls.Add(this.labelDescription, 0, 2); 85 this.tableLayoutPanel5.Controls.Add(this.labelEnable, 0, 0); 75 this.tableLayoutPanel5.Controls.Add(this.textBoxDescription, 1, 1); 76 this.tableLayoutPanel5.Controls.Add(this.textBoxName, 1, 0); 77 this.tableLayoutPanel5.Controls.Add(this.label1, 0, 0); 78 this.tableLayoutPanel5.Controls.Add(this.labelDescription, 0, 1); 86 79 this.tableLayoutPanel5.Dock = System.Windows.Forms.DockStyle.Fill; 87 80 this.tableLayoutPanel5.Location = new System.Drawing.Point(0, 0); 88 81 this.tableLayoutPanel5.Margin = new System.Windows.Forms.Padding(0); 89 82 this.tableLayoutPanel5.Name = "tableLayoutPanel5"; 90 this.tableLayoutPanel5.RowCount = 3;91 this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));92 this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));93 this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType. Percent, 33.33333F));94 this.tableLayoutPanel5.Size = new System.Drawing.Size(494, 75);83 this.tableLayoutPanel5.RowCount = 1; 84 this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); 85 this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); 86 this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); 87 this.tableLayoutPanel5.Size = new System.Drawing.Size(494, 50); 95 88 this.tableLayoutPanel5.TabIndex = 17; 96 89 // … … 98 91 // 99 92 this.textBoxDescription.Dock = System.Windows.Forms.DockStyle.Fill; 100 this.textBoxDescription.Location = new System.Drawing.Point(100, 52);93 this.textBoxDescription.Location = new System.Drawing.Point(100, 27); 101 94 this.textBoxDescription.Margin = new System.Windows.Forms.Padding(0, 2, 0, 0); 102 95 this.textBoxDescription.Name = "textBoxDescription"; … … 104 97 this.textBoxDescription.TabIndex = 14; 105 98 // 106 // checkBoxActive107 //108 this.checkBoxActive.AutoSize = true;109 this.checkBoxActive.Dock = System.Windows.Forms.DockStyle.Fill;110 this.checkBoxActive.Location = new System.Drawing.Point(100, 0);111 this.checkBoxActive.Margin = new System.Windows.Forms.Padding(0);112 this.checkBoxActive.Name = "checkBoxActive";113 this.checkBoxActive.Size = new System.Drawing.Size(394, 25);114 this.checkBoxActive.TabIndex = 2;115 this.checkBoxActive.UseVisualStyleBackColor = true;116 //117 99 // label1 118 100 // 119 101 this.label1.AutoSize = true; 120 102 this.label1.Dock = System.Windows.Forms.DockStyle.Fill; 121 this.label1.Location = new System.Drawing.Point(0, 25);103 this.label1.Location = new System.Drawing.Point(0, 0); 122 104 this.label1.Margin = new System.Windows.Forms.Padding(0); 123 105 this.label1.Name = "label1"; … … 131 113 this.labelDescription.AutoSize = true; 132 114 this.labelDescription.Dock = System.Windows.Forms.DockStyle.Fill; 133 this.labelDescription.Location = new System.Drawing.Point(0, 50);115 this.labelDescription.Location = new System.Drawing.Point(0, 25); 134 116 this.labelDescription.Margin = new System.Windows.Forms.Padding(0); 135 117 this.labelDescription.Name = "labelDescription"; … … 138 120 this.labelDescription.Text = "Description"; 139 121 this.labelDescription.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; 140 //141 // labelEnable142 //143 this.labelEnable.AutoSize = true;144 this.labelEnable.Dock = System.Windows.Forms.DockStyle.Fill;145 this.labelEnable.Location = new System.Drawing.Point(0, 0);146 this.labelEnable.Margin = new System.Windows.Forms.Padding(0);147 this.labelEnable.Name = "labelEnable";148 this.labelEnable.Size = new System.Drawing.Size(100, 25);149 this.labelEnable.TabIndex = 3;150 this.labelEnable.Text = "Enable";151 this.labelEnable.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;152 122 // 153 123 // JsonItemBaseControl … … 170 140 #endregion 171 141 protected System.Windows.Forms.ErrorProvider errorProvider; 172 protected System.Windows.Forms.Label labelEnable;173 protected System.Windows.Forms.CheckBox checkBoxActive;174 142 protected System.Windows.Forms.TextBox textBoxName; 175 143 protected System.Windows.Forms.Label label1; -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Shared/JsonItemBaseControl.cs
r17471 r17828 26 26 InitializeComponent(); 27 27 VM = vm; 28 control.Margin = new Padding() { All = 0 }; 29 tableLayoutPanel1.Controls.Add(control, 0, 1); 30 control.Dock = DockStyle.Fill; 28 if(control != null) { 29 control.Margin = new Padding() { All = 0 }; 30 tableLayoutPanel1.Controls.Add(control, 0, 1); 31 control.Dock = DockStyle.Fill; 32 } 31 33 Init(); 32 34 } 33 35 34 36 private void Init() { 35 checkBoxActive.DataBindings.Add("Checked", VM, nameof(IJsonItemVM.Selected),36 false, DataSourceUpdateMode.OnPropertyChanged);37 37 textBoxName.DataBindings.Add("Text", VM, nameof(IJsonItemVM.Name)); 38 38 textBoxDescription.DataBindings.Add("Text", VM, nameof(IJsonItemVM.Description)); -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Shared/NumericRangeControl.Designer.cs
r17471 r17828 26 26 this.components = new System.ComponentModel.Container(); 27 27 this.groupBox2 = new System.Windows.Forms.GroupBox(); 28 this. checkBoxTo = new System.Windows.Forms.CheckBox();28 this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); 29 29 this.textBoxTo = new System.Windows.Forms.TextBox(); 30 this.errorProvider = new System.Windows.Forms.ErrorProvider(this.components);31 30 this.textBoxFrom = new System.Windows.Forms.TextBox(); 32 31 this.checkBoxFrom = new System.Windows.Forms.CheckBox(); 33 this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); 32 this.checkBoxTo = new System.Windows.Forms.CheckBox(); 33 this.errorProvider = new System.Windows.Forms.ErrorProvider(this.components); 34 this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); 34 35 this.groupBox2.SuspendLayout(); 36 this.tableLayoutPanel2.SuspendLayout(); 35 37 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit(); 36 this.tableLayoutPanel 2.SuspendLayout();38 this.tableLayoutPanel1.SuspendLayout(); 37 39 this.SuspendLayout(); 38 40 // … … 49 51 this.groupBox2.Text = "Range"; 50 52 // 51 // checkBoxTo53 // tableLayoutPanel2 52 54 // 53 this.checkBoxTo.AutoSize = true; 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); 57 this.checkBoxTo.Name = "checkBoxTo"; 58 this.checkBoxTo.Size = new System.Drawing.Size(100, 22); 59 this.checkBoxTo.TabIndex = 7; 60 this.checkBoxTo.Text = "To:"; 61 this.checkBoxTo.UseVisualStyleBackColor = true; 55 this.tableLayoutPanel2.ColumnCount = 2; 56 this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 100F)); 57 this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); 58 this.tableLayoutPanel2.Controls.Add(this.textBoxTo, 1, 1); 59 this.tableLayoutPanel2.Controls.Add(this.textBoxFrom, 1, 0); 60 this.tableLayoutPanel2.Controls.Add(this.checkBoxFrom, 0, 0); 61 this.tableLayoutPanel2.Controls.Add(this.checkBoxTo, 0, 1); 62 this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill; 63 this.tableLayoutPanel2.Location = new System.Drawing.Point(3, 16); 64 this.tableLayoutPanel2.Margin = new System.Windows.Forms.Padding(0); 65 this.tableLayoutPanel2.Name = "tableLayoutPanel2"; 66 this.tableLayoutPanel2.RowCount = 2; 67 this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); 68 this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); 69 this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); 70 this.tableLayoutPanel2.Size = new System.Drawing.Size(520, 44); 71 this.tableLayoutPanel2.TabIndex = 22; 62 72 // 63 73 // textBoxTo … … 72 82 this.textBoxTo.TabIndex = 6; 73 83 this.textBoxTo.Validating += new System.ComponentModel.CancelEventHandler(this.textBoxTo_Validating); 74 //75 // errorProvider76 //77 this.errorProvider.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.NeverBlink;78 this.errorProvider.ContainerControl = this;79 84 // 80 85 // textBoxFrom … … 102 107 this.checkBoxFrom.UseVisualStyleBackColor = true; 103 108 // 104 // tableLayoutPanel2109 // checkBoxTo 105 110 // 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; 111 this.checkBoxTo.AutoSize = true; 112 this.checkBoxTo.Dock = System.Windows.Forms.DockStyle.Fill; 113 this.checkBoxTo.Location = new System.Drawing.Point(0, 22); 114 this.checkBoxTo.Margin = new System.Windows.Forms.Padding(0); 115 this.checkBoxTo.Name = "checkBoxTo"; 116 this.checkBoxTo.Size = new System.Drawing.Size(100, 22); 117 this.checkBoxTo.TabIndex = 7; 118 this.checkBoxTo.Text = "To:"; 119 this.checkBoxTo.UseVisualStyleBackColor = true; 120 // 121 // errorProvider 122 // 123 this.errorProvider.BlinkStyle = System.Windows.Forms.ErrorBlinkStyle.NeverBlink; 124 this.errorProvider.ContainerControl = this; 125 // 126 // tableLayoutPanel1 127 // 128 this.tableLayoutPanel1.ColumnCount = 1; 129 this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); 130 this.tableLayoutPanel1.Controls.Add(this.groupBox2, 0, 0); 131 this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; 132 this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0); 133 this.tableLayoutPanel1.Name = "tableLayoutPanel1"; 134 this.tableLayoutPanel1.RowCount = 2; 135 this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 63F)); 136 this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); 137 this.tableLayoutPanel1.Size = new System.Drawing.Size(526, 63); 138 this.tableLayoutPanel1.TabIndex = 23; 122 139 // 123 140 // NumericRangeControl … … 125 142 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 126 143 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 127 this.Controls.Add(this. groupBox2);144 this.Controls.Add(this.tableLayoutPanel1); 128 145 this.Name = "NumericRangeControl"; 129 146 this.Size = new System.Drawing.Size(526, 63); 130 147 this.groupBox2.ResumeLayout(false); 131 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();132 148 this.tableLayoutPanel2.ResumeLayout(false); 133 149 this.tableLayoutPanel2.PerformLayout(); 150 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit(); 151 this.tableLayoutPanel1.ResumeLayout(false); 134 152 this.ResumeLayout(false); 135 153 … … 144 162 private System.Windows.Forms.TextBox textBoxFrom; 145 163 private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2; 164 private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; 146 165 } 147 166 } -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Shared/NumericRangeControl.cs
r17444 r17828 51 51 } 52 52 } 53 54 public static UserControl Create(IJsonItemVM vm) { 55 NumericRangeControl numericRangeControl = new NumericRangeControl(); 56 numericRangeControl.TBMinRange.DataBindings.Add("Text", vm, nameof(RangedValueBaseVM<int, IntJsonItem>.MinRange)); 57 numericRangeControl.TBMaxRange.DataBindings.Add("Text", vm, nameof(RangedValueBaseVM<int, IntJsonItem>.MaxRange)); 58 numericRangeControl.EnableMinRange.DataBindings.Add("Checked", vm, nameof(RangedValueBaseVM<int, IntJsonItem>.EnableMinRange), 59 false, DataSourceUpdateMode.OnPropertyChanged); 60 numericRangeControl.EnableMaxRange.DataBindings.Add("Checked", vm, nameof(RangedValueBaseVM<int, IntJsonItem>.EnableMaxRange), 61 false, DataSourceUpdateMode.OnPropertyChanged); 62 return numericRangeControl; 63 } 53 64 } 54 65 } -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/ArrayValueVM.cs
r17519 r17828 9 9 namespace HeuristicLab.JsonInterface.OptimizerIntegration { 10 10 11 12 13 14 15 /*16 public class StringArrayValueVM : ArrayValueVM<int, IntArrayJsonItem> {17 public override Type TargetedJsonItemType => typeof(StringArrayJsonItem);18 19 protected override int MinTypeValue => int.MinValue;20 21 protected override int MaxTypeValue => int.MaxValue;22 23 public override UserControl Control =>24 new JsonItemBaseControl(this, new JsonItemIntArrayValueControl(this));25 26 public override int[] Value {27 get => Item.Value;28 set {29 Item.Value = value;30 OnPropertyChange(this, nameof(Value));31 }32 }33 }34 */35 36 37 11 public abstract class ArrayValueVM<T, JsonItemType> : RangedValueBaseVM<T, JsonItemType>, IArrayJsonItemVM 38 12 where T : IComparable 39 13 where JsonItemType : class, IArrayJsonItem, IIntervalRestrictedJsonItem<T> { 40 14 15 public override UserControl Control => CompoundControl.Create(base.Control, ArrayJsonItemControl.Create(this)); 16 41 17 public ArrayValueVM() { } 42 18 -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/DoubleVMs.cs
r17519 r17828 8 8 namespace HeuristicLab.JsonInterface.OptimizerIntegration { 9 9 public class DoubleRangeVM : RangeVM<double, DoubleRangeJsonItem> { 10 11 10 protected override double MinTypeValue => double.MinValue; 12 13 11 protected override double MaxTypeValue => double.MaxValue; 14 15 public override UserControl Control =>16 new JsonItemRangeControl(this);17 12 } 18 13 19 14 public class DoubleArrayValueVM : ArrayValueVM<double, DoubleArrayJsonItem> { 20 21 15 protected override double MinTypeValue => double.MinValue; 22 23 16 protected override double MaxTypeValue => double.MaxValue; 24 25 public override UserControl Control =>26 new JsonItemDoubleArrayValueControl(this);27 28 17 public override double[] Value { 29 18 get => Item.Value; … … 36 25 37 26 public class DoubleMatrixValueVM : MatrixValueVM<double, DoubleMatrixJsonItem> { 38 public override UserControl Control =>39 new JsonItemDoubleMatrixValueControl(this);40 41 27 public override double[][] Value { 42 28 get => Item.Value; … … 46 32 } 47 33 } 48 49 34 protected override double MinTypeValue => double.MinValue; 50 51 35 protected override double MaxTypeValue => double.MaxValue; 52 36 } 53 37 54 38 public class DoubleValueVM : SingleValueVM<double, DoubleJsonItem> { 55 56 39 protected override double MinTypeValue => double.MinValue; 57 40 protected override double MaxTypeValue => double.MaxValue; 58 59 public override UserControl Control =>60 new JsonItemDoubleValueControl(this);61 41 } 62 42 } -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/IntVMs.cs
r17519 r17828 8 8 namespace HeuristicLab.JsonInterface.OptimizerIntegration { 9 9 public class IntArrayValueVM : ArrayValueVM<int, IntArrayJsonItem> { 10 11 10 protected override int MinTypeValue => int.MinValue; 12 13 11 protected override int MaxTypeValue => int.MaxValue; 14 15 public override UserControl Control =>16 new JsonItemBaseControl(this, new JsonItemIntArrayValueControl(this));17 12 18 13 public override int[] Value { … … 26 21 27 22 public class IntRangeVM : RangeVM<int, IntRangeJsonItem> { 28 29 23 protected override int MinTypeValue => int.MinValue; 30 31 24 protected override int MaxTypeValue => int.MaxValue; 32 33 public override UserControl Control =>34 new JsonItemRangeControl(this);35 25 } 36 26 37 27 public class IntValueVM : SingleValueVM<int, IntJsonItem> { 38 39 28 protected override int MinTypeValue => int.MinValue; 40 29 protected override int MaxTypeValue => int.MaxValue; 41 42 public override UserControl Control =>43 new JsonItemIntValueControl(this);44 30 } 45 31 -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/JsonItemVMBase.cs
r17519 r17828 9 9 10 10 namespace HeuristicLab.JsonInterface.OptimizerIntegration { 11 public abstract class JsonItemVMBase<JsonItemType> : IJsonItemVM<JsonItemType> //TODO: RENAME, oder vlt JsonItems direkt als VM?11 public abstract class JsonItemVMBase<JsonItemType> : IJsonItemVM<JsonItemType> 12 12 where JsonItemType : class, IJsonItem 13 13 { -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/LookupJsonItemVM.cs
r17519 r17828 8 8 namespace HeuristicLab.JsonInterface.OptimizerIntegration { 9 9 public class LookupJsonItemVM : JsonItemVMBase<LookupJsonItem>, ILookupJsonItemVM { 10 11 public override UserControl Control => new LookupJsonItemControl(this); 12 10 public override UserControl Control => null; 13 11 public string ActualName { 14 12 get => Item.ActualName; -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/MatrixValueVM.cs
r17519 r17828 13 13 where T : IComparable 14 14 where JsonItemType : class, IMatrixJsonItem, IIntervalRestrictedJsonItem<T> { 15 16 public override UserControl Control => CompoundControl.Create(base.Control, MatrixJsonItemControl.Create(this)); 17 15 18 public abstract T[][] Value { get; set; } 16 19 public bool RowsResizable { -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/RangedValueBaseVM.cs
r17473 r17828 4 4 using System.Text; 5 5 using System.Threading.Tasks; 6 using System.Windows.Forms; 6 7 7 8 namespace HeuristicLab.JsonInterface.OptimizerIntegration { … … 11 12 where JsonItemType : class, IIntervalRestrictedJsonItem<T> 12 13 { 14 public override UserControl Control => NumericRangeControl.Create(this); 15 13 16 public T MinRange { 14 17 get => Item.Minimum; -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/SingleValueVM.cs
r17519 r17828 19 19 } 20 20 21 public override UserControl Control => 22 new JsonItemBoolControl(this); 21 public override UserControl Control => null; 23 22 } 24 23 -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/StringValueVM.cs
r17560 r17828 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 using System.Threading; 6 using System.Threading.Tasks; 7 using System.Windows.Forms; 1 using System.Linq; 8 2 9 3 namespace HeuristicLab.JsonInterface.OptimizerIntegration { 10 public class StringValueVM : JsonItemVMBase<StringJsonItem> {11 public override UserControl Control =>12 new JsonItemValidValuesControl(this);13 4 14 public string Value { 15 get => Item.Value?.ToString(); 16 set { 17 Item.Value = value; 18 OnPropertyChange(this, nameof(Value)); 19 } 20 } 5 public class StringValueVM : ConcreteRestrictedJsonItemVM<StringJsonItem, string, string> { 6 protected override string GetDefaultValue() => Range.FirstOrDefault(); 21 7 22 public IEnumerable<string> Range { 23 get => Item.ConcreteRestrictedItems; 24 set { 25 Item.ConcreteRestrictedItems = value; 26 //check if value is still in range 27 if (!Range.Contains(Value)) { 28 Value = Range.FirstOrDefault(); 29 if (Range.Count() == 0) 30 //if no elements exists -> deselect item 31 base.Selected = false; 32 OnPropertyChange(this, nameof(Value)); 33 } 34 35 OnPropertyChange(this, nameof(Range)); 36 } 37 } 8 protected override bool RangeContainsValue() => Range.Contains(Value); 38 9 } 39 10 40 public class StringArrayVM : JsonItemVMBase<StringArrayJsonItem> { 41 public override UserControl Control => 42 new JsonItemConcreteItemArrayControl(this); 11 public class StringArrayVM : ConcreteRestrictedJsonItemVM<StringArrayJsonItem, string, string[]> { 12 protected override string[] GetDefaultValue() => Range.ToArray(); 43 13 44 public string[] Value { 45 get => Item.Value; 46 set { 47 Item.Value = value; 48 OnPropertyChange(this, nameof(Value)); 49 } 50 } 51 52 public IEnumerable<string> Range { 53 get => Item.ConcreteRestrictedItems; 54 set { 55 Item.ConcreteRestrictedItems = value; 56 OnPropertyChange(this, nameof(Range)); 57 } 58 } 14 protected override bool RangeContainsValue() => Value.All(x => Range.Any(y => x == y)); 59 15 } 60 16 } -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/ExportJsonDialog.Designer.cs
r17481 r17828 249 249 this.Name = "ExportJsonDialog"; 250 250 this.RightToLeft = System.Windows.Forms.RightToLeft.No; 251 this.ShowIcon = false;252 251 this.Text = "Export Json"; 253 252 this.groupBoxDetails.ResumeLayout(false); -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/ExportJsonDialog.cs
r17601 r17828 40 40 41 41 Optimizer = content as IOptimizer; 42 Root = JsonItemConverter.Extract(Optimizer); 43 TreeNode parent = new TreeNode(Root.Name); 44 treeView.AfterCheck += TreeView_AfterCheck; 45 BuildTreeNode(parent, Root); 46 treeView.Nodes.Add(parent); 47 treeView.ExpandAll(); 48 panelParameterDetails.Controls.Clear(); 49 panelResultDetails.Controls.Clear(); 50 42 if(Optimizer != null) { 43 Optimizer = (IOptimizer)Optimizer.Clone(); // clone the optimizer 44 Root = JsonItemConverter.Extract(Optimizer); 45 TreeNode parent = new TreeNode(Root.Name); 46 treeView.AfterCheck += TreeView_AfterCheck; 47 BuildTreeNode(parent, Root); 48 treeView.Nodes.Add(parent); 49 treeView.ExpandAll(); 50 panelParameterDetails.Controls.Clear(); 51 panelResultDetails.Controls.Clear(); 52 } 51 53 } 52 54 } … … 62 64 public ExportJsonDialog() { 63 65 InitializeComponent(); 66 this.Icon = HeuristicLab.Common.Resources.HeuristicLab.Icon; 64 67 InitCache(); 65 68 } 66 69 67 70 private void exportButton_Click(object sender, EventArgs e) { 68 // to set default value for disabled items 69 JsonItemConverter.Inject(Optimizer, Root); 71 if (FolderBrowserDialog == null) { 72 FolderBrowserDialog = new FolderBrowserDialog(); 73 FolderBrowserDialog.Description = "Select .json-Template Directory"; 74 } 70 75 71 // clear all runs 72 Optimizer.Runs.Clear(); 73 74 var validationResult = Root.GetValidator().Validate(); 75 if (!validationResult.Success) { 76 IList<Exception> list = new List<Exception>(); 77 //print faultyItems 78 foreach (var x in validationResult.Errors) { 79 list.Add(new Exception(x)); 80 } 81 ErrorHandling.ShowErrorDialog(this, new AggregateException(list)); 82 } else { 83 if (FolderBrowserDialog == null) { 84 FolderBrowserDialog = new FolderBrowserDialog(); 85 FolderBrowserDialog.Description = "Select .json-Template Dictionary"; 86 } 87 88 if (FolderBrowserDialog.ShowDialog() == DialogResult.OK) { 89 JsonTemplateGenerator.GenerateTemplate(FolderBrowserDialog.SelectedPath, textBoxTemplateName.Text, Optimizer, Root); 76 if (FolderBrowserDialog.ShowDialog() == DialogResult.OK) { 77 try { 78 JsonTemplateGenerator.GenerateTemplate( 79 Path.Combine(FolderBrowserDialog.SelectedPath, textBoxTemplateName.Text), 80 Optimizer, Root); 90 81 Close(); 82 } catch (Exception ex) { 83 ErrorHandling.ShowErrorDialog(this, ex); 91 84 } 92 85 } … … 98 91 foreach (var c in item.Children) { 99 92 if (IsDrawableItem(c)) { 93 TreeNode childNode = new TreeNode(c.Name); 100 94 if (c is IResultJsonItem) { 101 TreeNode childNode = new TreeNode(c.Name);102 95 treeViewResults.Nodes.Add(childNode); 103 RegisterItem(childNode, c, treeViewResults); 104 if(Node2VM.TryGetValue(childNode, out IJsonItemVM vm)) 105 vm.Selected = true; 106 96 IJsonItemVM vm = RegisterItem(childNode, c, treeViewResults); 97 if (vm != null) vm.Selected = true; 107 98 } else { 108 TreeNode childNode = new TreeNode(c.Name);109 99 node.Nodes.Add(childNode); 110 100 BuildTreeNode(childNode, c); … … 115 105 } 116 106 117 private voidRegisterItem(TreeNode node, IJsonItem item, TreeView tv) {118 if (JI2VM.TryGetValue(item.GetType(), out Type vmType)) { // TODO: enhance for interfaces?107 private IJsonItemVM RegisterItem(TreeNode node, IJsonItem item, TreeView tv) { 108 if (JI2VM.TryGetValue(item.GetType(), out Type vmType)) { 119 109 IJsonItemVM vm = (IJsonItemVM)Activator.CreateInstance(vmType); 120 110 … … 128 118 UserControl control = new JsonItemBaseControl(vm, vm.Control); 129 119 Node2Control.Add(node, control); 120 return vm; 130 121 } else { 131 122 node.ForeColor = Color.LightGray; 132 123 node.NodeFont = new Font(SystemFonts.DialogFont, FontStyle.Italic); 133 124 } 125 return null; 134 126 } 135 127 … … 142 134 } 143 135 144 return b || !(item is EmptyJsonItem) ;136 return b || !(item is EmptyJsonItem) || !(item is UnsupportedJsonItem); 145 137 } 146 138 -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/ValueLookupJsonItemControl.cs
r17473 r17828 11 11 12 12 namespace HeuristicLab.JsonInterface.OptimizerIntegration { 13 public partial class ValueLookupJsonItemControl : LookupJsonItemControl {13 public partial class ValueLookupJsonItemControl : UserControl { 14 14 private static IDictionary<Type, Type> JI2VM { get; set; } 15 15 16 public ValueLookupJsonItemControl(IValueLookupJsonItemVM vm) : base(vm){16 public ValueLookupJsonItemControl(IValueLookupJsonItemVM vm) { 17 17 InitializeComponent(); 18 18 InitCache(); … … 22 22 content.Controls.Clear(); 23 23 UserControl control = tmp.Control; 24 content.Controls.Add(control); 25 control.Dock = DockStyle.Fill; 26 24 if(control != null) { 25 content.Controls.Add(control); 26 control.Dock = DockStyle.Fill; 27 } 27 28 } 28 29 }
Note: See TracChangeset
for help on using the changeset viewer.