Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/01/10 11:45:00 (14 years ago)
Author:
mkommend
Message:

added context menu to OperatorGraphView (ticket #867)

File:
1 copied

Legend:

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

    r2882 r2893  
    3030
    3131namespace HeuristicLab.Operators.Views.GraphVisualization {
    32   public sealed class OperatorGraphVisualizationInfo : DeepCloneable {
     32  public sealed class GraphVisualizationInfo : DeepCloneable {
    3333    private BidirectionalLookup<IOperator, IShapeInfo> shapeInfoMapping;
    3434    private BidirectionalLookup<IOperator, IObservableKeyedCollection<string, IParameter>> operatorParameterCollectionMapping;
    3535    private Dictionary<IValueParameter<IOperator>, IOperator> parameterOperatorMapping;
    3636
    37     private OperatorGraphVisualizationInfo() {
     37    private GraphVisualizationInfo() {
    3838      this.shapeInfoMapping = new BidirectionalLookup<IOperator, IShapeInfo>();
    3939      this.operatorParameterCollectionMapping = new BidirectionalLookup<IOperator, IObservableKeyedCollection<string, IParameter>>();
     
    4444    }
    4545
    46     public OperatorGraphVisualizationInfo(OperatorGraph operatorGraph)
     46    public GraphVisualizationInfo(OperatorGraph operatorGraph)
    4747      : this() {
    4848      this.operatorGraph = operatorGraph;
     
    8989        return this.shapeInfoMapping.GetByFirst(op);
    9090      }
     91      set {
     92        if (value == null)
     93          this.OperatorGraph.InitialOperator = null;
     94        else
     95          this.OperatorGraph.InitialOperator = this.shapeInfoMapping.GetBySecond(value);
     96      }
    9197    }
    9298
     
    102108    public IEnumerable<IShapeInfo> ShapeInfos {
    103109      get { return this.shapeInfos; }
     110    }
     111    public IOperator GetOperatorForShapeInfo(IShapeInfo shapeInfo) {
     112      return this.shapeInfoMapping.GetBySecond(shapeInfo);
    104113    }
    105114
     
    182191        this.AddOperator(op);
    183192    }
    184 
    185193    private void Operators_ItemsRemoved(object sender, HeuristicLab.Collections.CollectionItemsChangedEventArgs<IOperator> e) {
    186194      foreach (IOperator op in e.Items)
    187195        this.RemoveOperator(op);
    188196    }
    189 
    190197    private void Operators_CollectionReset(object sender, HeuristicLab.Collections.CollectionItemsChangedEventArgs<IOperator> e) {
    191198      foreach (IOperator op in e.OldItems)
     
    284291    }
    285292
    286 
    287293    private void RegisterOperatorParameterEvents(IValueParameter<IOperator> opParam) {
    288294      opParam.ValueChanged += new EventHandler(opParam_ValueChanged);
Note: See TracChangeset for help on using the changeset viewer.