Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/11/14 03:32:15 (10 years ago)
Author:
swagner
Message:

#2205: Worked on optimization networks

Location:
branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3
Files:
6 added
8 edited

Legend:

Unmodified
Added
Removed
  • branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/HeuristicLab.Optimization.Networks.Views-3.3.csproj

    r11423 r11449  
    8585  </ItemGroup>
    8686  <ItemGroup>
     87    <Compile Include="EntitySelector.cs">
     88      <SubType>UserControl</SubType>
     89    </Compile>
     90    <Compile Include="EntitySelector.Designer.cs">
     91      <DependentUpon>EntitySelector.cs</DependentUpon>
     92    </Compile>
     93    <Compile Include="EntitySelectorDialog.cs">
     94      <SubType>Form</SubType>
     95    </Compile>
     96    <Compile Include="EntitySelectorDialog.Designer.cs">
     97      <DependentUpon>EntitySelectorDialog.cs</DependentUpon>
     98    </Compile>
     99    <Compile Include="EntityView.cs">
     100      <SubType>UserControl</SubType>
     101    </Compile>
     102    <Compile Include="EntityView.Designer.cs">
     103      <DependentUpon>EntityView.cs</DependentUpon>
     104    </Compile>
    87105    <Compile Include="PortView.cs">
    88106      <SubType>UserControl</SubType>
  • branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/InputPortView.Designer.cs

    r11438 r11449  
    2727    private System.ComponentModel.IContainer components = null;
    2828
    29     /// <summary>
    30     /// Clean up any resources being used.
    31     /// </summary>
    32     /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
    33     protected override void Dispose(bool disposing) {
    34       if (disposing) {
    35         if (components != null) components.Dispose();
    36       }
    37       base.Dispose(disposing);
    38     }
    39 
    4029    #region Component Designer generated code
    4130
     
    4534    /// </summary>
    4635    private void InitializeComponent() {
     36      System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(InputPortView));
    4737      this.outputPortGroupBox = new System.Windows.Forms.GroupBox();
     38      this.setOutputPortButton = new System.Windows.Forms.Button();
     39      this.clearOutputPortButton = new System.Windows.Forms.Button();
    4840      this.outputPortView = new HeuristicLab.Optimization.Networks.Views.PortView();
    4941      this.valueGroupBox.SuspendLayout();
     
    5547      // valueGroupBox
    5648      //
    57       this.valueGroupBox.Location = new System.Drawing.Point(0, 129);
    58       this.valueGroupBox.Size = new System.Drawing.Size(645, 388);
    59       this.valueGroupBox.TabIndex = 6;
     49      this.valueGroupBox.Location = new System.Drawing.Point(0, 82);
     50      this.valueGroupBox.Size = new System.Drawing.Size(645, 435);
     51      this.valueGroupBox.TabIndex = 4;
    6052      //
    6153      // valuePanel
    6254      //
    63       this.valuePanel.Size = new System.Drawing.Size(633, 363);
     55      this.valuePanel.Size = new System.Drawing.Size(633, 410);
    6456      //
    6557      // valueViewHost
    6658      //
    67       this.valueViewHost.Size = new System.Drawing.Size(633, 363);
    68       //
    69       // pathTextBox
    70       //
    71       this.pathTextBox.Location = new System.Drawing.Point(71, 26);
    72       this.pathTextBox.Size = new System.Drawing.Size(549, 20);
     59      this.valueViewHost.Size = new System.Drawing.Size(633, 410);
    7360      //
    7461      // nameTextBox
     
    8370      this.outputPortGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    8471            | System.Windows.Forms.AnchorStyles.Right)));
     72      this.outputPortGroupBox.Controls.Add(this.setOutputPortButton);
     73      this.outputPortGroupBox.Controls.Add(this.clearOutputPortButton);
    8574      this.outputPortGroupBox.Controls.Add(this.outputPortView);
    86       this.outputPortGroupBox.Location = new System.Drawing.Point(0, 52);
     75      this.outputPortGroupBox.Location = new System.Drawing.Point(0, 26);
    8776      this.outputPortGroupBox.Name = "outputPortGroupBox";
    88       this.outputPortGroupBox.Size = new System.Drawing.Size(645, 71);
    89       this.outputPortGroupBox.TabIndex = 5;
     77      this.outputPortGroupBox.Size = new System.Drawing.Size(645, 50);
     78      this.outputPortGroupBox.TabIndex = 3;
    9079      this.outputPortGroupBox.TabStop = false;
    9180      this.outputPortGroupBox.Text = "&Output Port";
    92       this.outputPortGroupBox.DragDrop += new System.Windows.Forms.DragEventHandler(this.outputPortGroupBox_DragDrop);
    93       this.outputPortGroupBox.DragEnter += new System.Windows.Forms.DragEventHandler(this.outputPortGroupBox_DragEnterOver);
    94       this.outputPortGroupBox.DragOver += new System.Windows.Forms.DragEventHandler(this.outputPortGroupBox_DragEnterOver);
     81      //
     82      // setOutputPortButton
     83      //
     84      this.setOutputPortButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Edit;
     85      this.setOutputPortButton.Location = new System.Drawing.Point(6, 19);
     86      this.setOutputPortButton.Name = "setOutputPortButton";
     87      this.setOutputPortButton.Size = new System.Drawing.Size(24, 24);
     88      this.setOutputPortButton.TabIndex = 0;
     89      this.setOutputPortButton.UseVisualStyleBackColor = true;
     90      this.setOutputPortButton.Click += new System.EventHandler(this.setOutputPortButton_Click);
     91      //
     92      // clearOutputPortButton
     93      //
     94      this.clearOutputPortButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Remove;
     95      this.clearOutputPortButton.Location = new System.Drawing.Point(36, 19);
     96      this.clearOutputPortButton.Name = "clearOutputPortButton";
     97      this.clearOutputPortButton.Size = new System.Drawing.Size(24, 24);
     98      this.clearOutputPortButton.TabIndex = 1;
     99      this.clearOutputPortButton.UseVisualStyleBackColor = true;
     100      this.clearOutputPortButton.Click += new System.EventHandler(this.clearOutputPortButton_Click);
    95101      //
    96102      // outputPortView
    97103      //
    98       this.outputPortView.Caption = "Port View";
     104      this.outputPortView.AllowDrop = true;
     105      this.outputPortView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     106            | System.Windows.Forms.AnchorStyles.Left)
     107            | System.Windows.Forms.AnchorStyles.Right)));
     108      this.outputPortView.Caption = "Output Port View";
    99109      this.outputPortView.Content = null;
    100       this.outputPortView.Dock = System.Windows.Forms.DockStyle.Fill;
    101       this.outputPortView.Location = new System.Drawing.Point(3, 16);
     110      this.outputPortView.Location = new System.Drawing.Point(66, 21);
    102111      this.outputPortView.Name = "outputPortView";
    103112      this.outputPortView.ReadOnly = true;
    104       this.outputPortView.Size = new System.Drawing.Size(639, 52);
    105       this.outputPortView.TabIndex = 0;
     113      this.outputPortView.Size = new System.Drawing.Size(573, 23);
     114      this.outputPortView.TabIndex = 2;
     115      this.outputPortView.DragDrop += new System.Windows.Forms.DragEventHandler(this.outputPortView_DragDrop);
     116      this.outputPortView.DragEnter += new System.Windows.Forms.DragEventHandler(this.outputPortView_DragEnterOver);
     117      this.outputPortView.DragOver += new System.Windows.Forms.DragEventHandler(this.outputPortView_DragEnterOver);
    106118      //
    107119      // InputPortView
     
    110122      this.Controls.Add(this.outputPortGroupBox);
    111123      this.Name = "InputPortView";
    112       this.Controls.SetChildIndex(this.pathLabel, 0);
    113       this.Controls.SetChildIndex(this.pathTextBox, 0);
    114124      this.Controls.SetChildIndex(this.nameLabel, 0);
    115125      this.Controls.SetChildIndex(this.nameTextBox, 0);
     
    130140    protected System.Windows.Forms.GroupBox outputPortGroupBox;
    131141    protected PortView outputPortView;
     142    protected System.Windows.Forms.Button clearOutputPortButton;
     143    protected System.Windows.Forms.Button setOutputPortButton;
    132144
    133145
  • branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/InputPortView.cs

    r11438 r11449  
    3030  [Content(typeof(IInputPort), false)]
    3131  public partial class InputPortView : ValuePortView {
     32    protected EntitySelectorDialog entitySelectorDialog;
     33
    3234    public new IInputPort Content {
    3335      get { return (IInputPort)base.Content; }
     
    3739    public InputPortView() {
    3840      InitializeComponent();
     41    }
     42
     43    protected override void Dispose(bool disposing) {
     44      if (disposing) {
     45        if (entitySelectorDialog != null) entitySelectorDialog.Dispose();
     46        if (components != null) components.Dispose();
     47      }
     48      base.Dispose(disposing);
    3949    }
    4050
     
    5666      base.SetEnabledStateOfControls();
    5767      outputPortGroupBox.Enabled = Content != null && !ReadOnly;
     68      setOutputPortButton.Enabled = Content != null && !ReadOnly;
     69      clearOutputPortButton.Enabled = Content != null && Content.OutputPort != null && !ReadOnly;
    5870    }
    5971
     
    6274        Invoke(new EventHandler(Content_OutputPortChanged), sender, e);
    6375      else {
     76        clearOutputPortButton.Enabled = Content.OutputPort != null && !ReadOnly;
    6477        outputPortView.Content = Content.OutputPort;
    6578      }
    6679    }
    6780
    68     protected virtual void outputPortGroupBox_DragEnterOver(object sender, DragEventArgs e) {
     81    protected virtual void setOutputPortButton_Click(object sender, EventArgs e) {
     82      if (entitySelectorDialog == null) {
     83        entitySelectorDialog = new EntitySelectorDialog();
     84        entitySelectorDialog.Caption = "Select Output Port";
     85      }
     86
     87      IEntity root = Content;
     88      while (root.Parent != null)
     89        root = root.Parent;
     90      entitySelectorDialog.EntitySelector.Root = root;
     91
     92      if (entitySelectorDialog.ShowDialog(this) == DialogResult.OK) {
     93        Content.OutputPort = entitySelectorDialog.EntitySelector.SelectedEntity as IOutputPort;
     94      }
     95    }
     96    protected virtual void clearOutputPortButton_Click(object sender, EventArgs e) {
     97      Content.OutputPort = null;
     98    }
     99
     100    protected virtual void outputPortView_DragEnterOver(object sender, DragEventArgs e) {
    69101      e.Effect = DragDropEffects.None;
    70102      if (!ReadOnly && (e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat) is IOutputPort)) {
     
    72104      }
    73105    }
    74     protected virtual void outputPortGroupBox_DragDrop(object sender, DragEventArgs e) {
     106    protected virtual void outputPortView_DragDrop(object sender, DragEventArgs e) {
    75107      if (e.Effect != DragDropEffects.None) {
    76108        IOutputPort port = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat) as IOutputPort;
  • branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/NetworkView.cs

    r11409 r11449  
    2828  [Content(typeof(Network), true)]
    2929  [Content(typeof(INetwork), false)]
    30   public partial class NetworkView : NamedItemView {
     30  public partial class NetworkView : EntityView {
    3131    public new INetwork Content {
    3232      get { return (INetwork)base.Content; }
  • branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/NodeView.cs

    r11409 r11449  
    2828  [Content(typeof(Node), true)]
    2929  [Content(typeof(INode), false)]
    30   public partial class NodeView : NamedItemView {
     30  public partial class NodeView : EntityView {
    3131    public new INode Content {
    3232      get { return (INode)base.Content; }
  • branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/PortView.Designer.cs

    r11438 r11449  
    4545    /// </summary>
    4646    private void InitializeComponent() {
    47       this.pathLabel = new System.Windows.Forms.Label();
    48       this.pathTextBox = new System.Windows.Forms.TextBox();
    4947      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
    5048      this.SuspendLayout();
     
    5452      this.errorProvider.SetIconAlignment(this.nameTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
    5553      this.errorProvider.SetIconPadding(this.nameTextBox, 2);
    56       this.nameTextBox.Location = new System.Drawing.Point(69, 0);
    57       this.nameTextBox.Size = new System.Drawing.Size(551, 20);
    58       //
    59       // infoLabel
    60       //
    61       this.infoLabel.Location = new System.Drawing.Point(626, 3);
    62       //
    63       // pathLabel
    64       //
    65       this.pathLabel.AutoSize = true;
    66       this.pathLabel.Location = new System.Drawing.Point(3, 29);
    67       this.pathLabel.Name = "pathLabel";
    68       this.pathLabel.Size = new System.Drawing.Size(32, 13);
    69       this.pathLabel.TabIndex = 3;
    70       this.pathLabel.Text = "&Path:";
    71       //
    72       // pathTextBox
    73       //
    74       this.pathTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    75             | System.Windows.Forms.AnchorStyles.Right)));
    76       this.pathTextBox.Location = new System.Drawing.Point(69, 26);
    77       this.pathTextBox.Name = "pathTextBox";
    78       this.pathTextBox.ReadOnly = true;
    79       this.pathTextBox.Size = new System.Drawing.Size(551, 20);
    80       this.pathTextBox.TabIndex = 4;
    8154      //
    8255      // PortView
    8356      //
    8457      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
    85       this.Controls.Add(this.pathTextBox);
    86       this.Controls.Add(this.pathLabel);
    8758      this.Name = "PortView";
    88       this.Size = new System.Drawing.Size(645, 517);
    89       this.Controls.SetChildIndex(this.nameLabel, 0);
    90       this.Controls.SetChildIndex(this.nameTextBox, 0);
    91       this.Controls.SetChildIndex(this.infoLabel, 0);
    92       this.Controls.SetChildIndex(this.pathLabel, 0);
    93       this.Controls.SetChildIndex(this.pathTextBox, 0);
    9459      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
    9560      this.ResumeLayout(false);
     
    10065    #endregion
    10166
    102     protected System.Windows.Forms.Label pathLabel;
    103     protected System.Windows.Forms.TextBox pathTextBox;
    10467
    10568
  • branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/PortView.cs

    r11438 r11449  
    2929  [Content(typeof(Port), true)]
    3030  [Content(typeof(IPort), false)]
    31   public partial class PortView : NamedItemView {
     31  public partial class PortView : EntityView {
    3232    public new IPort Content {
    3333      get { return (IPort)base.Content; }
     
    3939    }
    4040
    41     protected override void DeregisterContentEvents() {
    42       Content.PathChanged -= Content_PathChanged;
    43       base.DeregisterContentEvents();
    44     }
    45     protected override void RegisterContentEvents() {
    46       base.RegisterContentEvents();
    47       Content.PathChanged += Content_PathChanged;
    48     }
    49 
    5041    protected override void OnContentChanged() {
    5142      base.OnContentChanged();
    52       pathTextBox.Text = Content == null ? string.Empty : Content.Path;
    5343    }
    5444
    5545    protected override void SetEnabledStateOfControls() {
    5646      base.SetEnabledStateOfControls();
    57       pathTextBox.Enabled = Content != null;
    58     }
    59 
    60     protected virtual void Content_PathChanged(object sender, System.EventArgs e) {
    61       if (InvokeRequired)
    62         Invoke(new EventHandler(Content_PathChanged), sender, e);
    63       else {
    64         pathTextBox.Text = Content.Path;
    65       }
    6647    }
    6748  }
  • branches/OptimizationNetworks/HeuristicLab.Optimization.Networks.Views/3.3/ValuePortView.Designer.cs

    r11438 r11449  
    6464            | System.Windows.Forms.AnchorStyles.Right)));
    6565      this.valueGroupBox.Controls.Add(this.valuePanel);
    66       this.valueGroupBox.Location = new System.Drawing.Point(0, 52);
     66      this.valueGroupBox.Location = new System.Drawing.Point(0, 26);
    6767      this.valueGroupBox.Name = "valueGroupBox";
    68       this.valueGroupBox.Size = new System.Drawing.Size(645, 465);
    69       this.valueGroupBox.TabIndex = 5;
     68      this.valueGroupBox.Size = new System.Drawing.Size(645, 491);
     69      this.valueGroupBox.TabIndex = 3;
    7070      this.valueGroupBox.TabStop = false;
    7171      this.valueGroupBox.Text = "Value";
     
    7979      this.valuePanel.Location = new System.Drawing.Point(6, 19);
    8080      this.valuePanel.Name = "valuePanel";
    81       this.valuePanel.Size = new System.Drawing.Size(633, 440);
     81      this.valuePanel.Size = new System.Drawing.Size(633, 466);
    8282      this.valuePanel.TabIndex = 0;
    8383      //
     
    9191      this.valueViewHost.Name = "valueViewHost";
    9292      this.valueViewHost.ReadOnly = false;
    93       this.valueViewHost.Size = new System.Drawing.Size(633, 440);
     93      this.valueViewHost.Size = new System.Drawing.Size(633, 466);
    9494      this.valueViewHost.TabIndex = 0;
    9595      this.valueViewHost.ViewsLabelVisible = true;
     
    101101      this.Controls.Add(this.valueGroupBox);
    102102      this.Name = "ValuePortView";
    103       this.Controls.SetChildIndex(this.pathLabel, 0);
    104       this.Controls.SetChildIndex(this.pathTextBox, 0);
    105103      this.Controls.SetChildIndex(this.nameLabel, 0);
    106104      this.Controls.SetChildIndex(this.nameTextBox, 0);
Note: See TracChangeset for help on using the changeset viewer.