Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.Operators.Views.GraphVisualization/3.3/Model/ConnectionInfo.cs @ 2853

Last change on this file since 2853 was 2853, checked in by mkommend, 14 years ago

added first version of mapping for the graph visualization (ticket #867)

File size: 1.2 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using HeuristicLab.Core;
6using Netron.Diagramming.Core;
7using System.Drawing;
8
9namespace HeuristicLab.Operators.Views.GraphVisualization {
10  internal class ConnectionInfo : Item, IConnectionInfo {
11    #region static fields
12    private static LinePenStyle penStyle;
13    static ConnectionInfo() {
14      ConnectionInfo.penStyle = new LinePenStyle();
15      ConnectionInfo.penStyle.EndCap = System.Drawing.Drawing2D.LineCap.ArrowAnchor;
16    }
17    #endregion
18
19    public ConnectionInfo()
20      : base() {
21    }
22
23    private Point from;
24    public Point From {
25      get { return this.from; }
26      set {
27        if (this.from != value) {
28          this.from = value;
29          this.OnChanged();
30        }
31      }
32    }
33
34    private Point to;
35    public Point To {
36      get { return this.to; }
37      set {
38        if (this.to != value) {
39          this.to = value;
40          this.OnChanged();
41        }
42      }
43    }
44
45    public IConnection CreateConnection() {
46      IConnection connection = new Connection(this.From, this.To);
47      connection.PenStyle = ConnectionInfo.penStyle;
48      return connection;
49    }
50  }
51}
Note: See TracBrowser for help on using the repository browser.