Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/17/10 23:50:05 (14 years ago)
Author:
mkommend
Message:

completly refactored the graph visualization (ticket #867)

Location:
trunk/sources/HeuristicLab.Operators.Views.GraphVisualization/3.3/OperatorGraphVisualization
Files:
1 added
1 copied

Legend:

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

    r3374 r3386  
    3030
    3131namespace HeuristicLab.Operators.Views.GraphVisualization {
    32   public static class Factory {
    33     private static LinePenStyle connectionPenStyle;
    34 
    35     static Factory() {
    36       connectionPenStyle = new LinePenStyle();
    37       connectionPenStyle.EndCap = LineCap.ArrowAnchor;
    38     }
    39 
     32  internal static class OperatorShapeInfoFactory {
     33    public const string PredecessorConnector = "Predecessor";
    4034    public static IOperatorShapeInfo CreateOperatorShapeInfo(IOperator op) {
    41       IEnumerable<string> operatorParameterNames = op.Parameters.Where(p => p is IValueParameter<IOperator> && p.Name != "Successor").Select(p => p.Name);
     35      IEnumerable<string> operatorParameterNames = op.Parameters.Where(p => p is IValueParameter<IOperator>).Select(p => p.Name);
    4236      IEnumerable<string> paramaterNameValues = op.Parameters.Where(p => !(p is IValueParameter<IOperator>)).Select(p => p.ToString());
    4337
    44       OperatorShapeInfo operatorShapeInfo = new OperatorShapeInfo(operatorParameterNames,paramaterNameValues);
     38      OperatorShapeInfo operatorShapeInfo = new OperatorShapeInfo(operatorParameterNames, paramaterNameValues);
     39      operatorShapeInfo.AddConnector(PredecessorConnector);
    4540      operatorShapeInfo.Collapsed = true;
    4641      operatorShapeInfo.Title = op.Name;
     
    5247      return operatorShapeInfo;
    5348    }
    54 
    55     public static IConnection CreateConnection(IConnector from, IConnector to) {
    56       Connection connection = new Connection(from.Point, to.Point);
    57       connection.From.AllowMove = false;
    58       connection.To.AllowMove = false;
    59       from.AttachConnector(connection.From);
    60 
    61       to.AttachConnector(connection.To);
    62       connection.PenStyle = connectionPenStyle;
    63       return connection;
    64     }
    6549  }
    6650}
Note: See TracChangeset for help on using the changeset viewer.