Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/01/10 15:16:17 (14 years ago)
Author:
mkommend
Message:

added details view for parameters (ticket #867)

File:
1 edited

Legend:

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

    r2895 r2898  
    4545
    4646      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);
    4848    }
    4949
     
    5959
    6060    protected override void OnContentChanged() {
    61       if (this.VisualizationInfo == null)
     61      bool createdVisualizationInfo = false;
     62      if (this.VisualizationInfo == null) {
    6263        this.VisualizationInfo = new GraphVisualizationInfo(this.Content);
     64        createdVisualizationInfo = true;
     65      }
    6366      this.graphVisualizationInfoView.Content = this.VisualizationInfo;
     67      if (createdVisualizationInfo)
     68        this.graphVisualizationInfoView.RelayoutOperatorGraph();
    6469    }
    6570
     
    6974    }
    7075
    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) {
    7282      CollectionBase<IDiagramEntity> selectedObjects = this.graphVisualizationInfoView.Controller.Model.Selection.SelectedItems;
    73       this.propertyViewHost.ViewType = null;
     83      this.detailsViewHost.ViewType = null;
    7484      if (selectedObjects.Count == 1) {
    7585        IShape shape = selectedObjects[0] as IShape;
    7686        if (shape != null) {
    7787          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;
    7990          return;
    8091        }
    8192      }
    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;
    84113    }
    85114
Note: See TracChangeset for help on using the changeset viewer.