public LineConnection (IFigure fig1, IFigure fig2): this ()	{
			if (fig1 != null) {
				ConnectStart (fig1.ConnectorAt (0.0, 0.0));
			}

			if (fig2 != null) {
				ConnectEnd (fig2.ConnectorAt (0.0, 0.0));
			}
		}
示例#2
0
        public LineConnection(IFigure fig1, IFigure fig2) : this()
        {
            if (fig1 != null)
            {
                ConnectStart(fig1.ConnectorAt(0.0, 0.0));
            }

            if (fig2 != null)
            {
                ConnectEnd(fig2.ConnectorAt(0.0, 0.0));
            }
        }
示例#3
0
        public override void MouseDown(MouseEvent ev)
        {
            IDrawingView view   = ev.View;
            IFigure      figure = view.Drawing.FindFigure(ev.X, ev.Y);

            if (figure != null)
            {
                _connection.EndPoint   = new PointD(ev.X, ev.Y);
                _connection.StartPoint = new PointD(ev.X, ev.Y);
                _connection.ConnectStart(figure.ConnectorAt(ev.X, ev.Y));
                _connection.UpdateConnection();
                view.Drawing.Add(_connection);
                view.ClearSelection();
                view.AddToSelection(_connection);
                _handle = _connection.EndHandle;
                CreateUndoActivity();
            }
            else
            {
                Editor.Tool = new SelectionTool(Editor);
            }
        }
示例#4
0
        private IConnector FindConnectionTarget(double x, double y, IDrawing drawing)
        {
            IFigure target = FindConnectableFigure(x, y, drawing);

            return(target != null?target.ConnectorAt(x, y) : null);
        }