/// <summary>
 /// Initializes a new instance of the <see cref="T:ConnectionBase"/> class.
 /// </summary>
 /// <param name="from">From.</param>
 /// <param name="to">To.</param>
 protected ConnectionBase(Point from, Point to) : base()
 {
     this.mFrom        = new Connector(from);
     this.mFrom.Parent = this;
     this.mTo          = new Connector(to);
     this.mTo.Parent   = this;
     PenStyle          = ArtPalette.GetDefaultPenStyle();
 }
        // ------------------------------------------------------------------
        /// <summary>
        /// Called when a new DiagramEntityBase is instantiated.
        /// </summary>
        // ------------------------------------------------------------------
        protected virtual void Initialize()
        {
            PaintStyle = ArtPalette.GetDefaultPaintStyle();
            PenStyle   = ArtPalette.GetDefaultPenStyle();

            mServices = new Dictionary <Type, IInteraction>();
            mServices[typeof(IMouseListener)] = this;
            mServices[typeof(IHoverListener)] = this;
        }
Example #3
0
 /// <summary>
 /// Constructs a connection between the two given points
 /// </summary>
 /// <param name="mFrom">the starting point of the connection</param>
 /// <param name="mTo">the end-point of the connection</param>
 /// <param name="model">The model.</param>
 public Connection(Point mFrom, Point mTo, IModel model)
     : base(model)
 {
     this.From        = new Connector(mFrom, model);
     this.From.Name   = "From";
     this.From.Parent = this;
     this.To          = new Connector(mTo, model);
     this.To.Name     = "To";
     this.To.Parent   = this;
     PenStyle         = ArtPalette.GetDefaultPenStyle();
 }
 /// <summary>
 /// Default constructor
 /// </summary>
 /// <param name="site"></param>
 protected ConnectionBase(IModel site) : base(site)
 {
     PenStyle = ArtPalette.GetDefaultPenStyle();
 }