- Timestamp:
- 04/23/10 14:28:32 (15 years ago)
- 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 42 42 [View("GraphVisualizationInfo View")] 43 43 [Content(typeof(IGraphVisualizationInfo), true)] 44 public partial class GraphVisualizationInfoView : ContentView {44 public partial class GraphVisualizationInfoView : AsynchronousContentView { 45 45 private BidirectionalLookup<IShapeInfo, IShape> shapeInfoShapeMapping; 46 46 private BidirectionalLookup<IConnectionInfo, IConnection> connectionInfoConnectionMapping; … … 78 78 this.SetEnabledStateOfControls(); 79 79 } 80 protected override void OnLockedChanged() { 81 base.OnLockedChanged(); 82 this.SetEnabledStateOfControls(); 83 } 80 84 private void SetEnabledStateOfControls() { 81 85 DeleteTool deleteTool = (DeleteTool)this.Controller.Tools.Where(t => t.Name == ControllerBase.DeleteToolName).FirstOrDefault(); … … 84 88 controller.RemoveTool(deleteTool); 85 89 else { 86 if ( ReadOnly&& deleteTool != null && controller != null)90 if ((ReadOnly || Locked) && deleteTool != null && controller != null) 87 91 controller.RemoveTool(deleteTool); 88 else if ( !ReadOnly&& deleteTool == null)92 else if ((!ReadOnly && !Locked) && deleteTool == null) 89 93 this.Controller.AddTool(new DeleteTool(ControllerBase.DeleteToolName)); 90 94 } … … 171 175 } 172 176 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 } 182 187 } 183 188 … … 240 245 this.connectionInfoConnectionMapping.RemoveByFirst(connectionInfo); 241 246 this.RemoveConnection(connection); 242 247 243 248 } 244 249 private void RemoveConnection(IConnection connection) { -
trunk/sources/HeuristicLab.Operators.Views.GraphVisualization/3.3/OperatorGraphVisualization/OperatorGraphView.Designer.cs
r3386 r3514 25 25 private void InitializeComponent() { 26 26 this.components = new System.ComponentModel.Container(); 27 System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(OperatorGraphView)); 27 28 this.graphVisualizationInfoView = new HeuristicLab.Operators.Views.GraphVisualization.GraphVisualizationInfoView(); 28 29 this.shapeContextMenu = new System.Windows.Forms.ContextMenuStrip(this.components); … … 31 32 this.breakPointToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 32 33 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(); 33 42 this.detailsGroupBox = new System.Windows.Forms.GroupBox(); 34 43 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); 44 45 this.shapeContextMenu.SuspendLayout(); 45 46 this.splitContainer.Panel1.SuspendLayout(); … … 58 59 this.graphVisualizationInfoView.Location = new System.Drawing.Point(3, 30); 59 60 this.graphVisualizationInfoView.Name = "graphVisualizationInfoView"; 61 this.graphVisualizationInfoView.ReadOnly = false; 60 62 this.graphVisualizationInfoView.Size = new System.Drawing.Size(662, 248); 61 63 this.graphVisualizationInfoView.TabIndex = 0; … … 73 75 // openViewToolStripMenuItem 74 76 // 77 this.openViewToolStripMenuItem.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold); 75 78 this.openViewToolStripMenuItem.Name = "openViewToolStripMenuItem"; 76 79 this.openViewToolStripMenuItem.Size = new System.Drawing.Size(153, 22); … … 89 92 this.breakPointToolStripMenuItem.Name = "breakPointToolStripMenuItem"; 90 93 this.breakPointToolStripMenuItem.Size = new System.Drawing.Size(153, 22); 91 this.breakPointToolStripMenuItem.Text = "Break Point";94 this.breakPointToolStripMenuItem.Text = "Breakpoint"; 92 95 this.breakPointToolStripMenuItem.Click += new System.EventHandler(this.breakPointToolStripMenuItem_Click); 93 96 // … … 118 121 this.splitContainer.TabIndex = 1; 119 122 // 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 // 120 211 // detailsGroupBox 121 212 // 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))); 122 216 this.detailsGroupBox.Controls.Add(this.detailsViewHost); 123 this.detailsGroupBox.Dock = System.Windows.Forms.DockStyle.Fill;124 217 this.detailsGroupBox.Location = new System.Drawing.Point(0, 0); 125 218 this.detailsGroupBox.Name = "detailsGroupBox"; … … 131 224 // detailsViewHost 132 225 // 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; 133 230 this.detailsViewHost.Content = null; 134 this.detailsViewHost.Dock = System.Windows.Forms.DockStyle.Fill;135 231 this.detailsViewHost.Location = new System.Drawing.Point(3, 16); 136 232 this.detailsViewHost.Name = "detailsViewHost"; 233 this.detailsViewHost.ReadOnly = false; 137 234 this.detailsViewHost.Size = new System.Drawing.Size(659, 142); 138 235 this.detailsViewHost.TabIndex = 0; 139 236 this.detailsViewHost.ViewType = null; 140 //141 // selectButton142 //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 // panButton153 //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 // connectButton164 //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 // relayoutButton175 //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 // zoomAreaButton186 //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 // zoomInButton197 //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 // zoomOutButton208 //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 // screenshotButton219 //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");228 237 // 229 238 // OperatorGraphView -
trunk/sources/HeuristicLab.Operators.Views.GraphVisualization/3.3/OperatorGraphVisualization/OperatorGraphView.cs
r3455 r3514 39 39 [View("OperatorGraph View (Chart)")] 40 40 [Content(typeof(OperatorGraph), true)] 41 public partial class OperatorGraphView : ContentView {41 public partial class OperatorGraphView : AsynchronousContentView { 42 42 public OperatorGraphView() { 43 43 InitializeComponent(); … … 78 78 protected override void OnReadOnlyChanged() { 79 79 base.OnReadOnlyChanged(); 80 this.SetEnabledStateOfControls(); 81 } 82 83 protected override void OnLockedChanged() { 84 base.OnLockedChanged(); 80 85 this.SetEnabledStateOfControls(); 81 86 } … … 91 96 screenshotButton.Enabled = false; 92 97 detailsViewHost.Enabled = false; 93 graphVisualizationInfoView.ReadOnly = true;94 98 connectButton.Enabled = false; 95 99 } else { … … 102 106 screenshotButton.Enabled = true; 103 107 detailsViewHost.Enabled = true; 104 connectButton.Enabled = !ReadOnly ;105 } 106 } 108 connectButton.Enabled = !ReadOnly && !Locked; 109 } 110 } 107 111 108 112 private OperatorGraphVisualizationInfo VisualizationInfo { … … 112 116 113 117 private void Controller_SelectionChanged(object sender, EventArgs e) { 118 this.detailsViewHost.ViewType = null; 119 this.detailsViewHost.Content = null; 120 114 121 CollectionBase<IDiagramEntity> selectedObjects = this.graphVisualizationInfoView.Controller.Model.Selection.SelectedItems; 115 this.detailsViewHost.ViewType = null;116 122 if (selectedObjects.Count == 1) { 117 123 IShape shape = selectedObjects[0] as IShape; … … 119 125 IOperatorShapeInfo shapeInfo = shape.Tag as IOperatorShapeInfo; 120 126 IOperator op = this.VisualizationInfo.GetOperatorForShapeInfo(shapeInfo); 121 this.detailsViewHost.ViewType = null;122 127 this.detailsViewHost.Content = op; 123 return;124 125 } 128 } 129 } 130 126 131 IConnector connector = this.graphVisualizationInfoView.Controller.Model.Selection.Connector; 127 132 if (connector != null) { … … 139 144 this.detailsViewHost.ViewType = null; 140 145 this.detailsViewHost.Content = parameter; 141 return;142 146 } 143 147 } 144 148 } 145 this.detailsViewHost.ViewType = null; 146 this.detailsViewHost.Content = null; 149 147 150 } 148 151 … … 184 187 IOperator op = this.VisualizationInfo.GetOperatorForShapeInfo(shapeInfo); 185 188 this.initialToolStripMenuItem.Checked = this.Content.InitialOperator == op; 189 this.initialToolStripMenuItem.Enabled = !ReadOnly && !Locked; 186 190 this.breakPointToolStripMenuItem.Checked = op.Breakpoint; 191 this.breakPointToolStripMenuItem.Enabled = !ReadOnly && !Locked; 187 192 } 188 193 } … … 318 323 saveFileDialog.Filter = "Bitmap|*.bmp|All Files|*.*"; 319 324 saveFileDialog.FilterIndex = 1; 325 saveFileDialog.AddExtension = true; 320 326 321 327 if (saveFileDialog.ShowDialog() == DialogResult.OK) { -
trunk/sources/HeuristicLab.Operators.Views.GraphVisualization/3.3/OperatorGraphVisualization/OperatorGraphVisualizationInfo.cs
r3422 r3514 126 126 clone.parameterOperatorMapping.Add(param, oper); 127 127 IValueParameter opParam = param as IValueParameter; 128 if (opParam != null && typeof(IOperator).IsAssignableFrom(param.DataType)) 128 if (opParam != null && typeof(IOperator).IsAssignableFrom(param.DataType)) 129 129 clone.RegisterOperatorParameterEvents(opParam); 130 130 else … … 237 237 IOperatorShapeInfo shapeInfo = (IOperatorShapeInfo)connectionInfo.From; 238 238 IOperator op = this.operatorShapeInfoMapping.GetBySecond(shapeInfo); 239 IValueParameter param = (IValueParameter)op.Parameters.Where(p => p.Name == connectionInfo.ConnectorFrom).Single();240 239 IOperatorShapeInfo shapeInfoTo = (IOperatorShapeInfo)connectionInfo.To; 241 240 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; 243 244 } 244 245 #endregion
Note: See TracChangeset
for help on using the changeset viewer.