Changeset 3355 for trunk/sources/HeuristicLab.Operators.Views.GraphVisualization/3.3/OperatorGraphView.cs
- Timestamp:
- 04/15/10 16:07:38 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Operators.Views.GraphVisualization/3.3/OperatorGraphView.cs
r3176 r3355 72 72 if (createdVisualizationInfo) 73 73 this.graphVisualizationInfoView.RelayoutGraph(); 74 } 74 75 this.SetEnableStateOfControls(); 76 } 77 78 protected override void OnReadOnlyChanged() { 79 base.OnReadOnlyChanged(); 80 this.SetEnableStateOfControls(); 81 } 82 83 private void SetEnableStateOfControls() { 84 if (Content == null) { 85 selectButton.Enabled = false; 86 panButton.Enabled = false; 87 relayoutButton.Enabled = false; 88 zoomAreaButton.Enabled = false; 89 zoomInButton.Enabled = false; 90 zoomOutButton.Enabled = false; 91 screenshotButton.Enabled = false; 92 detailsViewHost.Enabled = false; 93 graphVisualizationInfoView.ReadOnly = true; 94 connectButton.Enabled = false; 95 96 } else { 97 selectButton.Enabled = true; 98 panButton.Enabled = true; 99 relayoutButton.Enabled = true; 100 zoomAreaButton.Enabled = true; 101 zoomInButton.Enabled = true; 102 zoomOutButton.Enabled = true; 103 screenshotButton.Enabled = true; 104 detailsViewHost.Enabled = true; 105 detailsViewHost.ReadOnly = ReadOnly; 106 graphVisualizationInfoView.ReadOnly = ReadOnly; 107 connectButton.Enabled = !ReadOnly; 108 } 109 } 75 110 76 111 private GraphVisualizationInfo VisualizationInfo { … … 160 195 161 196 private void initialOperatorToolStripMenuItem_Click(object sender, EventArgs e) { 162 IOperatorShapeInfo shapeInfo = this.shapeContextMenu.Tag as IOperatorShapeInfo; 163 if (this.VisualizationInfo.InitialShape == shapeInfo) 164 this.VisualizationInfo.InitialShape = null; 165 else 166 this.VisualizationInfo.InitialShape = shapeInfo; 197 if (!ReadOnly) { 198 IOperatorShapeInfo shapeInfo = this.shapeContextMenu.Tag as IOperatorShapeInfo; 199 if (this.VisualizationInfo.InitialShape == shapeInfo) 200 this.VisualizationInfo.InitialShape = null; 201 else 202 this.VisualizationInfo.InitialShape = shapeInfo; 203 } 167 204 } 168 205 169 206 private void breakPointToolStripMenuItem_Click(object sender, EventArgs e) { 170 IOperatorShapeInfo shapeInfo = this.shapeContextMenu.Tag as IOperatorShapeInfo; 171 if (shapeInfo != null) { 172 IOperator op = this.VisualizationInfo.GetOperatorForShapeInfo(shapeInfo); 173 op.Breakpoint = !op.Breakpoint; 207 if (!ReadOnly) { 208 IOperatorShapeInfo shapeInfo = this.shapeContextMenu.Tag as IOperatorShapeInfo; 209 if (shapeInfo != null) { 210 IOperator op = this.VisualizationInfo.GetOperatorForShapeInfo(shapeInfo); 211 op.Breakpoint = !op.Breakpoint; 212 } 174 213 } 175 214 } … … 179 218 private void OperatorGraphView_DragEnter(object sender, DragEventArgs e) { 180 219 e.Effect = DragDropEffects.None; 220 if (ReadOnly) 221 return; 181 222 Type type = e.Data.GetData("Type") as Type; 182 223 if ((type != null) && (typeof(IOperator).IsAssignableFrom(type))) {
Note: See TracChangeset
for help on using the changeset viewer.