Пример #1
0
 public AddLineController(Diagram d)
     : base(d)
 {
     line = null;
     from = null;
     to   = null;;
 }
Пример #2
0
 public LineBase(ILineEndable From, ILineEndable To)
 {
     if (From == null || To == null)
     {
         throw new System.ArgumentNullException();
     }
     this.From = From;
     this.To   = To;
 }
Пример #3
0
 public PolyLine(ILineEndable From, ILineEndable To, params Location[] points) : base(From, To)
 {
     _points = new List <Location>();
     if (points != null)
     {
         foreach (var p in points)
         {
             _points.Add(p);
         }
     }
 }
Пример #4
0
 public ArrowedLine(ILineEndable from, ILineEndable to) : base(from, to)
 {
     if (from is IMoveable)
     {
         (from as IMoveable).FigureMoved += RecalcLine;
     }
     if (to is IMoveable)
     {
         (to as IMoveable).FigureMoved += RecalcLine;
     }
     RecalcLine(null, new LocationEventsArgs(0, 0));
 }
Пример #5
0
 public override void MouseDownAction(System.Windows.Forms.MouseEventArgs e)
 {
     SharpDX.Point p = new SharpDX.Point(e.X, e.Y);
     if (from == null)
     {
         from = Diagram.Get(p) as ILineEndable;
         if (from == null)
         {
             from = new EndLineMarker(Diagram.Get, 0);
             (from as EndLineMarker).Location = new Location(p.X, p.Y);
         }
         to = new EndLineMarker(Diagram.Get, 1);
         (to as EndLineMarker).Location = new Location(p.X, p.Y);
     }
 }
Пример #6
0
        public override void MouseUpAction(System.Windows.Forms.MouseEventArgs e)
        {
            var p      = new SharpDX.Point(e.X, e.Y);
            var figure = Diagram.Get(p) as ILineEndable;

            if (figure != null)
            {
                line = new Line(from, figure);
            }
            else
            {
                line = new Line(from, to);
            }
            Diagram.Add(line);
            from = null;
            to   = null;
            line = null;
        }
Пример #7
0
 public CurveLine(ILineEndable From, ILineEndable To, params Location[] points) : base(From, To)
 {
     _controlPoints = new List <Location>();
     _points        = new LinkedList <Location>();
     _controlPoints.Add(From.LineEnd);
     if (points != null)
     {
         foreach (var p in points)
         {
             _controlPoints.Add(p);
         }
     }
     _controlPoints.Add(To.LineEnd);
     if (To is IMoveable)
     {
         (To as IMoveable).FigureMoved += OnLastPointChanged;
     }
     if (From is IMoveable)
     {
         (From as IMoveable).FigureMoved += this.OnFirstPointChanged;
     }
     RecalcLine();
 }
Пример #8
0
 public Line(ILineEndable From, ILineEndable To) : base(From, To)
 {
 }