Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/24/10 17:58:03 (14 years ago)
Author:
mkommend
Message:

intermediate version of graph visualization (ticket #867)

File:
1 edited

Legend:

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

    r2853 r2861  
    2525using System.Text;
    2626using HeuristicLab.Core;
     27using Netron.Diagramming.Core;
     28using System.Drawing;
     29using System.Drawing.Drawing2D;
    2730
    2831namespace HeuristicLab.Operators.Views.GraphVisualization {
    29   public static class ShapeInfoFactory {
     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
    3040    public static IShapeInfo CreateShapeInfo(IOperator op) {
    31       OperatorShapeInfo operatorShapeInfo = new OperatorShapeInfo();
     41      IEnumerable<string> paramterNames = op.Parameters.Where(p => p is IValueParameter<IOperator> && p.Name != "Successor").Select(p => p.Name);
     42      OperatorShapeInfo operatorShapeInfo = new OperatorShapeInfo(paramterNames);
    3243      operatorShapeInfo.Title = op.Name;
    3344      operatorShapeInfo.Text = op.GetType().ToString();
     
    3546      return operatorShapeInfo;
    3647    }
     48
     49    public static IConnection CreateConnection(IConnector from, IConnector to) {
     50      Connection connection = new Connection(from.Point, to.Point);
     51      connection.AllowMove = false;
     52      from.AttachConnector(connection.From);
     53      to.AttachConnector(connection.To);
     54      connection.PenStyle = connectionPenStyle;
     55      return connection;
     56    }
    3757  }
    3858}
Note: See TracChangeset for help on using the changeset viewer.