Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/23/10 14:28:32 (15 years ago)
Author:
mkommend
Message:

implemented application review comments from abeham (ticket #867)

Location:
trunk/sources/HeuristicLab.Operators.Views.GraphVisualization/3.3
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Operators.Views.GraphVisualization/3.3/General/GraphVisualizationInfoView.cs

    r3386 r3514  
    4242  [View("GraphVisualizationInfo View")]
    4343  [Content(typeof(IGraphVisualizationInfo), true)]
    44   public partial class GraphVisualizationInfoView : ContentView {
     44  public partial class GraphVisualizationInfoView : AsynchronousContentView {
    4545    private BidirectionalLookup<IShapeInfo, IShape> shapeInfoShapeMapping;
    4646    private BidirectionalLookup<IConnectionInfo, IConnection> connectionInfoConnectionMapping;
     
    7878      this.SetEnabledStateOfControls();
    7979    }
     80    protected override void OnLockedChanged() {
     81      base.OnLockedChanged();
     82      this.SetEnabledStateOfControls();
     83    }
    8084    private void SetEnabledStateOfControls() {
    8185      DeleteTool deleteTool = (DeleteTool)this.Controller.Tools.Where(t => t.Name == ControllerBase.DeleteToolName).FirstOrDefault();
     
    8488        controller.RemoveTool(deleteTool);
    8589      else {
    86         if (ReadOnly && deleteTool != null && controller != null)
     90        if ((ReadOnly || Locked) && deleteTool != null && controller != null)
    8791          controller.RemoveTool(deleteTool);
    88         else if (!ReadOnly && deleteTool == null)
     92        else if ((!ReadOnly && !Locked) && deleteTool == null)
    8993          this.Controller.AddTool(new DeleteTool(ControllerBase.DeleteToolName));
    9094      }
     
    171175    }
    172176    private void RemoveShapeInfo(IShapeInfo shapeInfo) {
    173         this.DeregisterShapeInfoEvents(shapeInfo);
    174         IShape shape = this.shapeInfoShapeMapping.GetByFirst(shapeInfo);
    175         this.DeregisterShapeEvents(shape);
    176         this.shapeInfoShapeMapping.RemoveByFirst(shapeInfo);
    177 
    178         if (this.graphVisualization.Controller.Model.Shapes.Contains(shape)) {
    179           this.graphVisualization.Controller.Model.RemoveShape(shape);
    180           this.graphVisualization.Invalidate();
    181         }
     177      this.DeregisterShapeInfoEvents(shapeInfo);
     178      IShape shape = this.shapeInfoShapeMapping.GetByFirst(shapeInfo);
     179      this.DeregisterShapeEvents(shape);
     180      this.shapeInfoShapeMapping.RemoveByFirst(shapeInfo);
     181
     182      if (this.graphVisualization.Controller.Model.Shapes.Contains(shape)) {
     183        this.graphVisualization.Controller.Model.RemoveShape(shape);
     184        this.graphVisualization.Controller.Model.Selection.Clear();
     185        this.graphVisualization.Invalidate();
     186      }
    182187    }
    183188
     
    240245      this.connectionInfoConnectionMapping.RemoveByFirst(connectionInfo);
    241246      this.RemoveConnection(connection);
    242      
     247
    243248    }
    244249    private void RemoveConnection(IConnection connection) {
  • trunk/sources/HeuristicLab.Operators.Views.GraphVisualization/3.3/OperatorGraphVisualization/OperatorGraphView.Designer.cs

    r3386 r3514  
    2525    private void InitializeComponent() {
    2626      this.components = new System.ComponentModel.Container();
     27      System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(OperatorGraphView));
    2728      this.graphVisualizationInfoView = new HeuristicLab.Operators.Views.GraphVisualization.GraphVisualizationInfoView();
    2829      this.shapeContextMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
     
    3132      this.breakPointToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
    3233      this.splitContainer = new System.Windows.Forms.SplitContainer();
     34      this.screenshotButton = new System.Windows.Forms.Button();
     35      this.zoomOutButton = new System.Windows.Forms.Button();
     36      this.zoomInButton = new System.Windows.Forms.Button();
     37      this.zoomAreaButton = new System.Windows.Forms.Button();
     38      this.relayoutButton = new System.Windows.Forms.Button();
     39      this.connectButton = new System.Windows.Forms.Button();
     40      this.panButton = new System.Windows.Forms.Button();
     41      this.selectButton = new System.Windows.Forms.Button();
    3342      this.detailsGroupBox = new System.Windows.Forms.GroupBox();
    3443      this.detailsViewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
    35       this.selectButton = new System.Windows.Forms.Button();
    36       this.panButton = new System.Windows.Forms.Button();
    37       this.connectButton = new System.Windows.Forms.Button();
    38       this.relayoutButton = new System.Windows.Forms.Button();
    39       this.zoomAreaButton = new System.Windows.Forms.Button();
    40       this.zoomInButton = new System.Windows.Forms.Button();
    41       this.zoomOutButton = new System.Windows.Forms.Button();
    42       this.screenshotButton = new System.Windows.Forms.Button();
    43       this.buttonToolTip = new System.Windows.Forms.ToolTip();
     44      this.buttonToolTip = new System.Windows.Forms.ToolTip(this.components);
    4445      this.shapeContextMenu.SuspendLayout();
    4546      this.splitContainer.Panel1.SuspendLayout();
     
    5859      this.graphVisualizationInfoView.Location = new System.Drawing.Point(3, 30);
    5960      this.graphVisualizationInfoView.Name = "graphVisualizationInfoView";
     61      this.graphVisualizationInfoView.ReadOnly = false;
    6062      this.graphVisualizationInfoView.Size = new System.Drawing.Size(662, 248);
    6163      this.graphVisualizationInfoView.TabIndex = 0;
     
    7375      // openViewToolStripMenuItem
    7476      //
     77      this.openViewToolStripMenuItem.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold);
    7578      this.openViewToolStripMenuItem.Name = "openViewToolStripMenuItem";
    7679      this.openViewToolStripMenuItem.Size = new System.Drawing.Size(153, 22);
     
    8992      this.breakPointToolStripMenuItem.Name = "breakPointToolStripMenuItem";
    9093      this.breakPointToolStripMenuItem.Size = new System.Drawing.Size(153, 22);
    91       this.breakPointToolStripMenuItem.Text = "Break Point";
     94      this.breakPointToolStripMenuItem.Text = "Breakpoint";
    9295      this.breakPointToolStripMenuItem.Click += new System.EventHandler(this.breakPointToolStripMenuItem_Click);
    9396      //
     
    118121      this.splitContainer.TabIndex = 1;
    119122      //
     123      // screenshotButton
     124      //
     125      this.screenshotButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Image;
     126      this.screenshotButton.Location = new System.Drawing.Point(243, 3);
     127      this.screenshotButton.Name = "screenshotButton";
     128      this.screenshotButton.Size = new System.Drawing.Size(24, 24);
     129      this.screenshotButton.TabIndex = 8;
     130      this.buttonToolTip.SetToolTip(this.screenshotButton, "Screenshot");
     131      this.screenshotButton.UseVisualStyleBackColor = true;
     132      this.screenshotButton.Click += new System.EventHandler(this.screenshotButton_Click);
     133      //
     134      // zoomOutButton
     135      //
     136      this.zoomOutButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.ZoomOut;
     137      this.zoomOutButton.Location = new System.Drawing.Point(213, 3);
     138      this.zoomOutButton.Name = "zoomOutButton";
     139      this.zoomOutButton.Size = new System.Drawing.Size(24, 24);
     140      this.zoomOutButton.TabIndex = 7;
     141      this.buttonToolTip.SetToolTip(this.zoomOutButton, "Zoom Out");
     142      this.zoomOutButton.UseVisualStyleBackColor = true;
     143      this.zoomOutButton.Click += new System.EventHandler(this.zoomOutButton_Click);
     144      //
     145      // zoomInButton
     146      //
     147      this.zoomInButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.ZoomIn;
     148      this.zoomInButton.Location = new System.Drawing.Point(183, 3);
     149      this.zoomInButton.Name = "zoomInButton";
     150      this.zoomInButton.Size = new System.Drawing.Size(24, 24);
     151      this.zoomInButton.TabIndex = 6;
     152      this.buttonToolTip.SetToolTip(this.zoomInButton, "Zoom In");
     153      this.zoomInButton.UseVisualStyleBackColor = true;
     154      this.zoomInButton.Click += new System.EventHandler(this.zoomInButton_Click);
     155      //
     156      // zoomAreaButton
     157      //
     158      this.zoomAreaButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.ActualSize;
     159      this.zoomAreaButton.Location = new System.Drawing.Point(153, 3);
     160      this.zoomAreaButton.Name = "zoomAreaButton";
     161      this.zoomAreaButton.Size = new System.Drawing.Size(24, 24);
     162      this.zoomAreaButton.TabIndex = 5;
     163      this.buttonToolTip.SetToolTip(this.zoomAreaButton, "Zoom Area Tool");
     164      this.zoomAreaButton.UseVisualStyleBackColor = true;
     165      this.zoomAreaButton.Click += new System.EventHandler(this.zoomAreaButton_Click);
     166      //
     167      // relayoutButton
     168      //
     169      this.relayoutButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.RefreshDocument;
     170      this.relayoutButton.Location = new System.Drawing.Point(123, 3);
     171      this.relayoutButton.Name = "relayoutButton";
     172      this.relayoutButton.Size = new System.Drawing.Size(24, 24);
     173      this.relayoutButton.TabIndex = 4;
     174      this.buttonToolTip.SetToolTip(this.relayoutButton, "Relayout Graph");
     175      this.relayoutButton.UseVisualStyleBackColor = true;
     176      this.relayoutButton.Click += new System.EventHandler(this.relayoutButton_Click);
     177      //
     178      // connectButton
     179      //
     180      this.connectButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Interface;
     181      this.connectButton.Location = new System.Drawing.Point(63, 3);
     182      this.connectButton.Name = "connectButton";
     183      this.connectButton.Size = new System.Drawing.Size(24, 24);
     184      this.connectButton.TabIndex = 3;
     185      this.buttonToolTip.SetToolTip(this.connectButton, "Connection Tool");
     186      this.connectButton.UseVisualStyleBackColor = true;
     187      this.connectButton.Click += new System.EventHandler(this.connectButton_Click);
     188      //
     189      // panButton
     190      //
     191      this.panButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Breakpoint;
     192      this.panButton.Location = new System.Drawing.Point(33, 3);
     193      this.panButton.Name = "panButton";
     194      this.panButton.Size = new System.Drawing.Size(24, 24);
     195      this.panButton.TabIndex = 2;
     196      this.buttonToolTip.SetToolTip(this.panButton, "Pan Tool");
     197      this.panButton.UseVisualStyleBackColor = true;
     198      this.panButton.Click += new System.EventHandler(this.panButton_Click);
     199      //
     200      // selectButton
     201      //
     202      this.selectButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Pointer;
     203      this.selectButton.Location = new System.Drawing.Point(3, 3);
     204      this.selectButton.Name = "selectButton";
     205      this.selectButton.Size = new System.Drawing.Size(24, 24);
     206      this.selectButton.TabIndex = 1;
     207      this.buttonToolTip.SetToolTip(this.selectButton, "Select Tool");
     208      this.selectButton.UseVisualStyleBackColor = true;
     209      this.selectButton.Click += new System.EventHandler(this.selectButton_Click);
     210      //
    120211      // detailsGroupBox
    121212      //
     213      this.detailsGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     214                  | System.Windows.Forms.AnchorStyles.Left)
     215                  | System.Windows.Forms.AnchorStyles.Right)));
    122216      this.detailsGroupBox.Controls.Add(this.detailsViewHost);
    123       this.detailsGroupBox.Dock = System.Windows.Forms.DockStyle.Fill;
    124217      this.detailsGroupBox.Location = new System.Drawing.Point(0, 0);
    125218      this.detailsGroupBox.Name = "detailsGroupBox";
     
    131224      // detailsViewHost
    132225      //
     226      this.detailsViewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     227                  | System.Windows.Forms.AnchorStyles.Left)
     228                  | System.Windows.Forms.AnchorStyles.Right)));
     229      this.detailsViewHost.Caption = null;
    133230      this.detailsViewHost.Content = null;
    134       this.detailsViewHost.Dock = System.Windows.Forms.DockStyle.Fill;
    135231      this.detailsViewHost.Location = new System.Drawing.Point(3, 16);
    136232      this.detailsViewHost.Name = "detailsViewHost";
     233      this.detailsViewHost.ReadOnly = false;
    137234      this.detailsViewHost.Size = new System.Drawing.Size(659, 142);
    138235      this.detailsViewHost.TabIndex = 0;
    139236      this.detailsViewHost.ViewType = null;
    140       //
    141       // selectButton
    142       //
    143       this.selectButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Pointer;
    144       this.selectButton.Location = new System.Drawing.Point(3, 3);
    145       this.selectButton.Name = "selectButton";
    146       this.selectButton.Size = new System.Drawing.Size(24, 24);
    147       this.selectButton.TabIndex = 1;
    148       this.selectButton.UseVisualStyleBackColor = true;
    149       this.selectButton.Click += new System.EventHandler(selectButton_Click);
    150       this.buttonToolTip.SetToolTip(this.selectButton, "Select Tool");
    151       //
    152       // panButton
    153       //
    154       this.panButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Breakpoint;
    155       this.panButton.Location = new System.Drawing.Point(33, 3);
    156       this.panButton.Name = "panButton";
    157       this.panButton.Size = new System.Drawing.Size(24, 24);
    158       this.panButton.TabIndex = 2;
    159       this.panButton.UseVisualStyleBackColor = true;
    160       this.panButton.Click += new System.EventHandler(panButton_Click);
    161       this.buttonToolTip.SetToolTip(this.panButton, "Pan Tool");
    162       //
    163       // connectButton
    164       //
    165       this.connectButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Interface;
    166       this.connectButton.Location = new System.Drawing.Point(63, 3);
    167       this.connectButton.Name = "connectButton";
    168       this.connectButton.Size = new System.Drawing.Size(24, 24);
    169       this.connectButton.TabIndex = 3;
    170       this.connectButton.UseVisualStyleBackColor = true;
    171       this.connectButton.Click += new System.EventHandler(connectButton_Click);
    172       this.buttonToolTip.SetToolTip(this.connectButton, "Connection Tool");
    173       //
    174       // relayoutButton
    175       //
    176       this.relayoutButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.RefreshDocument;
    177       this.relayoutButton.Location = new System.Drawing.Point(123, 3);
    178       this.relayoutButton.Name = "relayoutButton";
    179       this.relayoutButton.Size = new System.Drawing.Size(24, 24);
    180       this.relayoutButton.TabIndex = 4;
    181       this.relayoutButton.UseVisualStyleBackColor = true;
    182       this.relayoutButton.Click += new System.EventHandler(relayoutButton_Click);
    183       this.buttonToolTip.SetToolTip(this.relayoutButton, "Relayout Graph");
    184       //
    185       // zoomAreaButton
    186       //
    187       this.zoomAreaButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Zoom;
    188       this.zoomAreaButton.Location = new System.Drawing.Point(153, 3);
    189       this.zoomAreaButton.Name = "zoomAreaButton";
    190       this.zoomAreaButton.Size = new System.Drawing.Size(24, 24);
    191       this.zoomAreaButton.TabIndex = 5;
    192       this.zoomAreaButton.UseVisualStyleBackColor = true;
    193       this.zoomAreaButton.Click += new System.EventHandler(zoomAreaButton_Click);
    194       this.buttonToolTip.SetToolTip(this.zoomAreaButton, "Zoom Area Tool");
    195       //
    196       // zoomInButton
    197       //
    198       this.zoomInButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.ZoomIn;
    199       this.zoomInButton.Location = new System.Drawing.Point(183, 3);
    200       this.zoomInButton.Name = "zoomInButton";
    201       this.zoomInButton.Size = new System.Drawing.Size(24, 24);
    202       this.zoomInButton.TabIndex = 6;
    203       this.zoomInButton.UseVisualStyleBackColor = true;
    204       this.zoomInButton.Click += new System.EventHandler(zoomInButton_Click);
    205       this.buttonToolTip.SetToolTip(this.zoomInButton, "Zoom In");
    206       //
    207       // zoomOutButton
    208       //
    209       this.zoomOutButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.ZoomOut;
    210       this.zoomOutButton.Location = new System.Drawing.Point(213, 3);
    211       this.zoomOutButton.Name = "zoomOutButton";
    212       this.zoomOutButton.Size = new System.Drawing.Size(24, 24);
    213       this.zoomOutButton.TabIndex = 7;
    214       this.zoomOutButton.UseVisualStyleBackColor = true;
    215       this.zoomOutButton.Click += new System.EventHandler(zoomOutButton_Click);
    216       this.buttonToolTip.SetToolTip(this.zoomOutButton, "Zoom Out");
    217       //
    218       // screenshotButton
    219       //
    220       this.screenshotButton.Image = HeuristicLab.Common.Resources.VS2008ImageLibrary.Copy;
    221       this.screenshotButton.Location = new System.Drawing.Point(243, 3);
    222       this.screenshotButton.Name = "screenshotButton";
    223       this.screenshotButton.Size = new System.Drawing.Size(24, 24);
    224       this.screenshotButton.TabIndex = 8;
    225       this.screenshotButton.UseVisualStyleBackColor = true;
    226       this.screenshotButton.Click += new System.EventHandler(screenshotButton_Click);
    227       this.buttonToolTip.SetToolTip(this.screenshotButton, "Screenshot");
    228237      //
    229238      // OperatorGraphView
  • trunk/sources/HeuristicLab.Operators.Views.GraphVisualization/3.3/OperatorGraphVisualization/OperatorGraphView.cs

    r3455 r3514  
    3939  [View("OperatorGraph View (Chart)")]
    4040  [Content(typeof(OperatorGraph), true)]
    41   public partial class OperatorGraphView : ContentView {
     41  public partial class OperatorGraphView : AsynchronousContentView {
    4242    public OperatorGraphView() {
    4343      InitializeComponent();
     
    7878    protected override void OnReadOnlyChanged() {
    7979      base.OnReadOnlyChanged();
     80      this.SetEnabledStateOfControls();
     81    }
     82
     83    protected override void OnLockedChanged() {
     84      base.OnLockedChanged();
    8085      this.SetEnabledStateOfControls();
    8186    }
     
    9196        screenshotButton.Enabled = false;
    9297        detailsViewHost.Enabled = false;
    93         graphVisualizationInfoView.ReadOnly = true;
    9498        connectButton.Enabled = false;
    9599      } else {
     
    102106        screenshotButton.Enabled = true;
    103107        detailsViewHost.Enabled = true;
    104         connectButton.Enabled = !ReadOnly;
    105       }
    106     } 
     108        connectButton.Enabled = !ReadOnly && !Locked;
     109      }
     110    }
    107111
    108112    private OperatorGraphVisualizationInfo VisualizationInfo {
     
    112116
    113117    private void Controller_SelectionChanged(object sender, EventArgs e) {
     118      this.detailsViewHost.ViewType = null;
     119      this.detailsViewHost.Content = null;
     120
    114121      CollectionBase<IDiagramEntity> selectedObjects = this.graphVisualizationInfoView.Controller.Model.Selection.SelectedItems;
    115       this.detailsViewHost.ViewType = null;
    116122      if (selectedObjects.Count == 1) {
    117123        IShape shape = selectedObjects[0] as IShape;
     
    119125          IOperatorShapeInfo shapeInfo = shape.Tag as IOperatorShapeInfo;
    120126          IOperator op = this.VisualizationInfo.GetOperatorForShapeInfo(shapeInfo);
    121           this.detailsViewHost.ViewType = null;
    122127          this.detailsViewHost.Content = op;
    123           return;
    124         }
    125       }
     128        }
     129      }
     130
    126131      IConnector connector = this.graphVisualizationInfoView.Controller.Model.Selection.Connector;
    127132      if (connector != null) {
     
    139144            this.detailsViewHost.ViewType = null;
    140145            this.detailsViewHost.Content = parameter;
    141             return;
    142146          }
    143147        }
    144148      }
    145       this.detailsViewHost.ViewType = null;
    146       this.detailsViewHost.Content = null;
     149
    147150    }
    148151
     
    184187        IOperator op = this.VisualizationInfo.GetOperatorForShapeInfo(shapeInfo);
    185188        this.initialToolStripMenuItem.Checked = this.Content.InitialOperator == op;
     189        this.initialToolStripMenuItem.Enabled = !ReadOnly && !Locked;
    186190        this.breakPointToolStripMenuItem.Checked = op.Breakpoint;
     191        this.breakPointToolStripMenuItem.Enabled = !ReadOnly && !Locked;
    187192      }
    188193    }
     
    318323      saveFileDialog.Filter = "Bitmap|*.bmp|All Files|*.*";
    319324      saveFileDialog.FilterIndex = 1;
     325      saveFileDialog.AddExtension = true;
    320326
    321327      if (saveFileDialog.ShowDialog() == DialogResult.OK) {
  • trunk/sources/HeuristicLab.Operators.Views.GraphVisualization/3.3/OperatorGraphVisualization/OperatorGraphVisualizationInfo.cs

    r3422 r3514  
    126126          clone.parameterOperatorMapping.Add(param, oper);
    127127          IValueParameter opParam = param as IValueParameter;
    128           if (opParam != null && typeof(IOperator).IsAssignableFrom(param.DataType)) 
     128          if (opParam != null && typeof(IOperator).IsAssignableFrom(param.DataType))
    129129            clone.RegisterOperatorParameterEvents(opParam);
    130130          else
     
    237237      IOperatorShapeInfo shapeInfo = (IOperatorShapeInfo)connectionInfo.From;
    238238      IOperator op = this.operatorShapeInfoMapping.GetBySecond(shapeInfo);
    239       IValueParameter param = (IValueParameter)op.Parameters.Where(p => p.Name == connectionInfo.ConnectorFrom).Single();
    240239      IOperatorShapeInfo shapeInfoTo = (IOperatorShapeInfo)connectionInfo.To;
    241240      IOperator opTo = this.operatorShapeInfoMapping.GetBySecond(shapeInfoTo);
    242       param.Value = opTo;
     241      IValueParameter param = (IValueParameter)op.Parameters.Where(p => p.Name == connectionInfo.ConnectorFrom).SingleOrDefault();
     242      if (param != null)
     243        param.Value = opTo;
    243244    }
    244245    #endregion
Note: See TracChangeset for help on using the changeset viewer.