Changeset 2898 for trunk/sources/HeuristicLab.Operators.Views.GraphVisualization/3.3/OperatorGraphView.cs
- Timestamp:
- 03/01/10 15:16:17 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Operators.Views.GraphVisualization/3.3/OperatorGraphView.cs
r2895 r2898 45 45 46 46 this.graphVisualizationInfoView.Controller.OnShowContextMenu += new EventHandler<EntityMenuEventArgs>(Controller_OnShowContextMenu); 47 this.graphVisualizationInfoView.Controller.Model.Selection.OnNewSelection += new EventHandler(Controller_ OnShowSelectionProperties);47 this.graphVisualizationInfoView.Controller.Model.Selection.OnNewSelection += new EventHandler(Controller_SelectionChanged); 48 48 } 49 49 … … 59 59 60 60 protected override void OnContentChanged() { 61 if (this.VisualizationInfo == null) 61 bool createdVisualizationInfo = false; 62 if (this.VisualizationInfo == null) { 62 63 this.VisualizationInfo = new GraphVisualizationInfo(this.Content); 64 createdVisualizationInfo = true; 65 } 63 66 this.graphVisualizationInfoView.Content = this.VisualizationInfo; 67 if (createdVisualizationInfo) 68 this.graphVisualizationInfoView.RelayoutOperatorGraph(); 64 69 } 65 70 … … 69 74 } 70 75 71 private void Controller_OnShowSelectionProperties(object sender, EventArgs e) { 76 77 #region connector tooltips 78 79 #endregion 80 81 private void Controller_SelectionChanged(object sender, EventArgs e) { 72 82 CollectionBase<IDiagramEntity> selectedObjects = this.graphVisualizationInfoView.Controller.Model.Selection.SelectedItems; 73 this. propertyViewHost.ViewType = null;83 this.detailsViewHost.ViewType = null; 74 84 if (selectedObjects.Count == 1) { 75 85 IShape shape = selectedObjects[0] as IShape; 76 86 if (shape != null) { 77 87 IShapeInfo shapeInfo = shape.Tag as ShapeInfo; 78 this.propertyViewHost.Content = this.VisualizationInfo.GetOperatorForShapeInfo(shapeInfo); 88 IOperator op = this.VisualizationInfo.GetOperatorForShapeInfo(shapeInfo); 89 this.detailsViewHost.Content = op; 79 90 return; 80 91 } 81 92 } 82 this.propertyViewHost.ViewType = null; 83 this.propertyViewHost.Content = null; 93 IConnector connector = this.graphVisualizationInfoView.Controller.Model.Selection.Connector; 94 if (connector != null) { 95 IShape shape = connector.Parent as IShape; 96 string connectorName = connector.Name; 97 if (shape == null) { 98 shape = connector.AttachedTo.Parent as IShape; //connection connector selected 99 connectorName = connector.AttachedTo.Name; 100 } 101 if (shape != null) { 102 IShapeInfo shapeInfo = shape.Tag as ShapeInfo; 103 IOperator op = this.VisualizationInfo.GetOperatorForShapeInfo(shapeInfo); 104 if (connectorName != "Predecessor") { 105 IParameter parameter = op.Parameters.Where(p => p.Name == connectorName).First(); 106 this.detailsViewHost.Content = parameter; 107 return; 108 } 109 } 110 } 111 this.detailsViewHost.ViewType = null; 112 this.detailsViewHost.Content = null; 84 113 } 85 114
Note: See TracChangeset
for help on using the changeset viewer.