Free cookie consent management tool by TermsFeed Policy Generator

Changeset 17443


Ignore:
Timestamp:
02/18/20 14:39:50 (5 years ago)
Author:
dpiringe
Message:

#3026:

  • added support for string values without range limitation (dropdown gets automatically replaced by textbox)
  • fixed a UI bug for JsonItemValidValuesControl -> now the control resizes correctly
  • fixed a bug in AlgorithmConverter -> now it searches for the ItemName (instead of Name) in method Inject
  • fixed a bug in StringValueConverter -> now it sets the correct name
Location:
branches/3026_IntegrationIntoSymSpace
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Shared/JsonItemBaseControl.Designer.cs

    r17435 r17443  
    6060      this.textBoxActualName.Location = new System.Drawing.Point(92, 75);
    6161      this.textBoxActualName.Name = "textBoxActualName";
    62       this.textBoxActualName.Size = new System.Drawing.Size(404, 20);
     62      this.textBoxActualName.Size = new System.Drawing.Size(402, 20);
    6363      this.textBoxActualName.TabIndex = 12;
    6464      //
     
    7979      this.textBoxName.Location = new System.Drawing.Point(92, 23);
    8080      this.textBoxName.Name = "textBoxName";
    81       this.textBoxName.Size = new System.Drawing.Size(404, 20);
     81      this.textBoxName.Size = new System.Drawing.Size(402, 20);
    8282      this.textBoxName.TabIndex = 10;
    8383      //
     
    107107      this.textBoxDescription.Location = new System.Drawing.Point(92, 49);
    108108      this.textBoxDescription.Name = "textBoxDescription";
    109       this.textBoxDescription.Size = new System.Drawing.Size(404, 20);
     109      this.textBoxDescription.Size = new System.Drawing.Size(402, 20);
    110110      this.textBoxDescription.TabIndex = 14;
    111111      //
     
    124124      this.Name = "JsonItemBaseControl";
    125125      this.Padding = new System.Windows.Forms.Padding(3);
    126       this.Size = new System.Drawing.Size(502, 154);
     126      this.Size = new System.Drawing.Size(500, 154);
    127127      this.ResumeLayout(false);
    128128      this.PerformLayout();
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Shared/JsonItemBaseControl.cs

    r17433 r17443  
    1616      InitializeComponent();
    1717    }
    18 
     18   
    1919    public JsonItemBaseControl(JsonItemVMBase vm) {
    2020      InitializeComponent();
     
    3131      else
    3232        textBoxActualName.Text = VM.Item.ActualName;
     33       
    3334    }
    3435  }
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/SingleValueVM.cs

    r17433 r17443  
    1414    protected override int MaxTypeValue => int.MaxValue;
    1515
    16     public override JsonItemBaseControl GetControl() => 
     16    public override JsonItemBaseControl GetControl() =>
    1717      new JsonItemIntValueControl(this);
    1818  }
     
    2424    protected override double MaxTypeValue => double.MaxValue;
    2525
    26     public override JsonItemBaseControl GetControl() => 
     26    public override JsonItemBaseControl GetControl() =>
    2727       new JsonItemDoubleValueControl(this);
    2828  }
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/StringValueVM.cs

    r17417 r17443  
    2020
    2121    public IEnumerable<string> Range {
    22       get => Item.Range.Cast<string>();
     22      get => Item.Range?.Cast<string>();
    2323      set {
    2424        Item.Range = value;
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/ExportJsonDialog.Designer.cs

    r17439 r17443  
    3838      this.tabPage2 = new System.Windows.Forms.TabPage();
    3939      this.jsonItemBindingSource = new System.Windows.Forms.BindingSource(this.components);
     40      this.treeViewResults = new System.Windows.Forms.TreeView();
    4041      this.groupBoxDetails.SuspendLayout();
    4142      this.groupBox2.SuspendLayout();
     
    111112            | System.Windows.Forms.AnchorStyles.Right)));
    112113      this.resultItems.FormattingEnabled = true;
    113       this.resultItems.Location = new System.Drawing.Point(6, 19);
     114      this.resultItems.Location = new System.Drawing.Point(6, 364);
    114115      this.resultItems.Name = "resultItems";
    115       this.resultItems.Size = new System.Drawing.Size(777, 499);
     116      this.resultItems.Size = new System.Drawing.Size(777, 154);
    116117      this.resultItems.TabIndex = 5;
    117118      //
     
    134135            | System.Windows.Forms.AnchorStyles.Left)
    135136            | System.Windows.Forms.AnchorStyles.Right)));
     137      this.groupBox3.Controls.Add(this.treeViewResults);
    136138      this.groupBox3.Controls.Add(this.resultItems);
    137139      this.groupBox3.Location = new System.Drawing.Point(6, 6);
     
    199201      //
    200202      this.jsonItemBindingSource.DataSource = typeof(HeuristicLab.JsonInterface.IJsonItem);
     203      //
     204      // treeViewResults
     205      //
     206      this.treeViewResults.CheckBoxes = true;
     207      this.treeViewResults.Location = new System.Drawing.Point(6, 19);
     208      this.treeViewResults.Name = "treeViewResults";
     209      this.treeViewResults.Size = new System.Drawing.Size(777, 339);
     210      this.treeViewResults.TabIndex = 6;
    201211      //
    202212      // ExportJsonDialog
     
    242252    private System.Windows.Forms.TabPage tabPage1;
    243253    private System.Windows.Forms.TabPage tabPage2;
     254    private System.Windows.Forms.TreeView treeViewResults;
    244255  }
    245256}
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/ExportJsonDialog.cs

    r17439 r17443  
    125125              if (c is ResultItem) {
    126126                resultItems.Items.Add(c.Name, true);
     127               
    127128                ResultItems.Add(c.Name, c);
    128129              } else {
     
    154155          panel.Controls.Add(control);
    155156          control.Width = panel.Width;
     157          control.Height = panel.Height;
    156158          control.Dock = DockStyle.Fill;
    157159          control.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/JsonItemBoolControl.Designer.cs

    r17433 r17443  
    5252      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    5353      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    54       this.BackColor = System.Drawing.SystemColors.Control;
    5554      this.Controls.Add(this.label2);
    5655      this.Controls.Add(this.checkBoxValue);
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/JsonItemRangeControl.Designer.cs

    r17433 r17443  
    102102      this.Controls.Add(this.groupBox1);
    103103      this.Name = "JsonItemRangeControl";
    104       this.Size = new System.Drawing.Size(500, 301);
     104      this.Size = new System.Drawing.Size(500, 290);
    105105      this.Controls.SetChildIndex(this.groupBox1, 0);
    106106      this.Controls.SetChildIndex(this.numericRangeControl1, 0);
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/JsonItemValidValuesControl.Designer.cs

    r17433 r17443  
    2525    private void InitializeComponent() {
    2626      this.tableOptions = new System.Windows.Forms.TableLayoutPanel();
    27       this.groupBoxRange = new System.Windows.Forms.GroupBox();
    2827      this.comboBoxValues = new System.Windows.Forms.ComboBox();
    2928      this.label2 = new System.Windows.Forms.Label();
     29      this.groupBoxRange = new System.Windows.Forms.GroupBox();
    3030      this.groupBoxRange.SuspendLayout();
    3131      this.SuspendLayout();
     
    3333      // tableOptions
    3434      //
    35       this.tableOptions.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    36             | System.Windows.Forms.AnchorStyles.Left)
    37             | System.Windows.Forms.AnchorStyles.Right)));
    38       this.tableOptions.AutoSize = true;
     35      this.tableOptions.AutoScroll = true;
     36      this.tableOptions.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
     37      this.tableOptions.BackColor = System.Drawing.SystemColors.Control;
    3938      this.tableOptions.ColumnCount = 2;
    4039      this.tableOptions.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
    4140      this.tableOptions.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
    42       this.tableOptions.Location = new System.Drawing.Point(6, 19);
     41      this.tableOptions.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
     42      this.tableOptions.Dock = System.Windows.Forms.DockStyle.Fill;
     43      this.tableOptions.Location = new System.Drawing.Point(3, 16);
    4344      this.tableOptions.Name = "tableOptions";
    4445      this.tableOptions.RowCount = 1;
    4546      this.tableOptions.RowStyles.Add(new System.Windows.Forms.RowStyle());
    46       this.tableOptions.Size = new System.Drawing.Size(478, 417);
     47      this.tableOptions.Size = new System.Drawing.Size(482, 170);
    4748      this.tableOptions.TabIndex = 12;
    48       //
    49       // groupBoxRange
    50       //
    51       this.groupBoxRange.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    52             | System.Windows.Forms.AnchorStyles.Left)
    53             | System.Windows.Forms.AnchorStyles.Right)));
    54       this.groupBoxRange.AutoSize = true;
    55       this.groupBoxRange.Controls.Add(this.tableOptions);
    56       this.groupBoxRange.Location = new System.Drawing.Point(6, 128);
    57       this.groupBoxRange.Name = "groupBoxRange";
    58       this.groupBoxRange.Size = new System.Drawing.Size(490, 442);
    59       this.groupBoxRange.TabIndex = 14;
    60       this.groupBoxRange.TabStop = false;
    61       this.groupBoxRange.Text = "Range";
    6249      //
    6350      // comboBoxValues
     
    6956      this.comboBoxValues.Location = new System.Drawing.Point(92, 101);
    7057      this.comboBoxValues.Name = "comboBoxValues";
    71       this.comboBoxValues.Size = new System.Drawing.Size(404, 21);
     58      this.comboBoxValues.Size = new System.Drawing.Size(402, 21);
    7259      this.comboBoxValues.TabIndex = 15;
    7360      //
     
    8168      this.label2.Text = "Value";
    8269      //
     70      // groupBoxRange
     71      //
     72      this.groupBoxRange.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     73            | System.Windows.Forms.AnchorStyles.Left)
     74            | System.Windows.Forms.AnchorStyles.Right)));
     75      this.groupBoxRange.Controls.Add(this.tableOptions);
     76      this.groupBoxRange.Location = new System.Drawing.Point(6, 128);
     77      this.groupBoxRange.Name = "groupBoxRange";
     78      this.groupBoxRange.Size = new System.Drawing.Size(488, 189);
     79      this.groupBoxRange.TabIndex = 17;
     80      this.groupBoxRange.TabStop = false;
     81      this.groupBoxRange.Text = "Range";
     82      //
    8383      // JsonItemValidValuesControl
    8484      //
    8585      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    8686      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    87       this.AutoSize = true;
     87      this.Controls.Add(this.groupBoxRange);
    8888      this.Controls.Add(this.label2);
    8989      this.Controls.Add(this.comboBoxValues);
    90       this.Controls.Add(this.groupBoxRange);
    9190      this.ForeColor = System.Drawing.Color.Black;
    9291      this.Name = "JsonItemValidValuesControl";
    93       this.Size = new System.Drawing.Size(500, 576);
    94       this.Controls.SetChildIndex(this.groupBoxRange, 0);
     92      this.Size = new System.Drawing.Size(500, 323);
    9593      this.Controls.SetChildIndex(this.comboBoxValues, 0);
    9694      this.Controls.SetChildIndex(this.label2, 0);
     95      this.Controls.SetChildIndex(this.groupBoxRange, 0);
    9796      this.groupBoxRange.ResumeLayout(false);
    98       this.groupBoxRange.PerformLayout();
    9997      this.ResumeLayout(false);
    10098      this.PerformLayout();
     
    104102    #endregion
    105103    private System.Windows.Forms.TableLayoutPanel tableOptions;
    106     private System.Windows.Forms.GroupBox groupBoxRange;
    107104    private System.Windows.Forms.ComboBox comboBoxValues;
    108105    private System.Windows.Forms.Label label2;
     106    private System.Windows.Forms.GroupBox groupBoxRange;
    109107  }
    110108}
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/JsonItemValidValuesControl.cs

    r17417 r17443  
    1414    public JsonItemValidValuesControl(StringValueVM vm) : base(vm) {
    1515      InitializeComponent();
    16       foreach (var i in VM.Item.Range)
    17         SetupOption((string)i);
    18 
    19       comboBoxValues.DataBindings.Add("SelectedItem", VM, nameof(StringValueVM.Value));
     16      if (VM.Item.Range != null) {
     17        foreach (var i in VM.Item.Range)
     18          SetupOption((string)i);
     19        comboBoxValues.DataBindings.Add("SelectedItem", VM, nameof(StringValueVM.Value));
     20      } else {
     21        comboBoxValues.Hide();
     22        groupBoxRange.Hide();
     23        TextBox tb = new TextBox();
     24        this.Controls.Add(tb);
     25        tb.Location = comboBoxValues.Location;
     26        tb.Size = comboBoxValues.Size;
     27        tb.Anchor = comboBoxValues.Anchor;
     28        tb.Dock = comboBoxValues.Dock;
     29        tb.DataBindings.Add("Text", VM, nameof(StringValueVM.Value));
     30        tb.Show();
     31      }
    2032    }
    2133   
     
    2436      TextBox tb = new TextBox();
    2537      tb.Text = opt;
     38      //tb.Size = new Size()
    2639      tb.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
    27       tb.Size = new Size(420, 20);
     40      //tb.Dock = DockStyle.Right | DockStyle.Left;
    2841      tb.ReadOnly = true;
    2942
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/JsonItemValueControl.Designer.cs

    r17433 r17443  
    3535      this.textBoxValue.Location = new System.Drawing.Point(92, 101);
    3636      this.textBoxValue.Name = "textBoxValue";
    37       this.textBoxValue.Size = new System.Drawing.Size(404, 20);
     37      this.textBoxValue.Size = new System.Drawing.Size(402, 20);
    3838      this.textBoxValue.TabIndex = 14;
    3939      //
     
    5353      this.numericRangeControl1.Location = new System.Drawing.Point(9, 127);
    5454      this.numericRangeControl1.Name = "numericRangeControl1";
    55       this.numericRangeControl1.Size = new System.Drawing.Size(487, 112);
     55      this.numericRangeControl1.Size = new System.Drawing.Size(485, 112);
    5656      this.numericRangeControl1.TabIndex = 16;
    5757      //
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/JsonItemValueControl.cs

    r17433 r17443  
    1313 
    1414  public class JsonItemIntValueControl : JsonItemValueControl {
    15 
     15   
    1616    #region Overriden Properties
    1717    protected override string ValuePropertyId => nameof(IntValueVM.Value);
    1818    #endregion
    19 
     19   
    2020    public JsonItemIntValueControl(IntValueVM vm) : base(vm) {
    2121      Init();
     
    2424
    2525  public class JsonItemDoubleValueControl : JsonItemValueControl {
    26 
     26   
    2727    #region Overriden Properties
    2828    protected override string ValuePropertyId => nameof(DoubleValueVM.Value);
     
    4949      NumericRangeControl = numericRangeControl1;
    5050    }
    51 
     51   
    5252    protected void Init() {
    5353      TBValue.DataBindings.Add("Text", base.VM, ValuePropertyId);
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/AlgorithmConverter.cs

    r17435 r17443  
    1616      base.Inject(item, data, root);
    1717      IAlgorithm algorithm = item as IAlgorithm;
    18       IJsonItem problemData = data.Children.Where(x => x.Name == algorithm.Problem.Name).First();
     18      IJsonItem problemData = data.Children.Where(x => x.Name == algorithm.Problem.ItemName).First();
    1919      root.Inject(algorithm.Problem, problemData, root);
    2020
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/StringValueConverter.cs

    r17433 r17443  
    1717    public override IJsonItem Extract(IItem value, IJsonItemConverter root) =>
    1818      new StringJsonItem() {
    19         Name = value.ItemName,
     19        Name = "[OverridableParamName]",
    2020        Description = value.ItemDescription,
    2121        Value = ((StringValue)value).Value
Note: See TracChangeset for help on using the changeset viewer.