Exemplo n.º 1
0
 public void MouseMove(Point e)
 {
     if (IsTapped)
     {
         CoreUML.SwitchToDrawInTmp();
         _newArrow.HookEndPointToFigure(e);
         _newArrow.Draw(CoreUML.Graphics);
         if (!(_newArrow.DataCommon[0].LastBox is null))
         {
             AbstractBox box = (AbstractBox)_newArrow.DataCommon[0].LastBox;
             AbstractBox.DrawConnectionPoint(CoreUML.Graphics, box.GetCordinatsOfConnectionPoint(_newArrow.DataCommon[0].LastPoint));
         }
         CoreUML.PictureBox.Image = CoreUML.BitmapTmp;
     }
     else if (_newArrow is null)
     {
         foreach (IFigure figure in CoreUML.Figures)
         {
             if (figure is AbstractBox box && figure.CheckSelection(e, e, 7))
             {
                 CoreUML.DrawSelectionOfFigures();
                 AbstractBox.DrawConnectionPoint(CoreUML.Graphics, box.GetCordinatsOfConnectionPoint(box.GetConnectionPoint(e, e)));
                 break;
             }
         }
         CoreUML.DrawSelectionOfFigures();
         CoreUML.PictureBox.Image = CoreUML.BitmapTmp;
     }
 }
Exemplo n.º 2
0
 private void PictureBox1_MouseMove(object sender, MouseEventArgs e)
 {
     if (_isTapped && (_act == Act.Aggregation || _act == Act.Composition || _act == Act.Inheritance))
     {
         _bitmapTmp = (Bitmap)_bitmap.Clone();
         _graphics  = Graphics.FromImage(_bitmapTmp);
         _currentArrow.StartDirectionAxis = _startAxis;
         _currentArrow.EndDirectionAxis   = _endAxis;
         _currentArrow.GetPoints(_point, e.Location);
         _currentArrow.Draw(_graphics);
         pictureBox1.Image = _bitmapTmp;
     }
 }