Ejemplo n.º 1
0
 private void DrawAnchorBox(RenderArg arg)
 {
     if (_anchorBoxes == null)
     {
         _anchorBoxes = new RectangleF[8];
         for (int i = 0; i < 8; i++)
         {
             _anchorBoxes[i].Size = new Size(cstBoxHalfHeight * 2, cstBoxHalfHeight * 2);
         }
     }
     //rect
     arg.Graphics.DrawRectangle(BorderEditingRect, _location.X, _location.Y, _size.Width, _size.Height);
     //anchor
     _anchorBoxes[0].Location = new PointF(_location.X - cstBoxHalfHeight, _location.Y - cstBoxHalfHeight);
     _anchorBoxes[1].Location = new PointF(_location.X + _size.Width / 2 - cstBoxHalfHeight, _location.Y - cstBoxHalfHeight);
     _anchorBoxes[2].Location = new PointF(_location.X + _size.Width - cstBoxHalfHeight, _location.Y - cstBoxHalfHeight);
     _anchorBoxes[6].Location = new PointF(_location.X - cstBoxHalfHeight, _location.Y + _size.Height - cstBoxHalfHeight);
     _anchorBoxes[5].Location = new PointF(_location.X + _size.Width / 2 - cstBoxHalfHeight, _location.Y + _size.Height - cstBoxHalfHeight);
     _anchorBoxes[4].Location = new PointF(_location.X + _size.Width - cstBoxHalfHeight, _location.Y + _size.Height - cstBoxHalfHeight);
     _anchorBoxes[3].Location = new PointF(_location.X + _size.Width - cstBoxHalfHeight, _location.Y + _size.Height / 2 - cstBoxHalfHeight);
     _anchorBoxes[7].Location = new PointF(_location.X - cstBoxHalfHeight, _location.Y + _size.Height / 2 - cstBoxHalfHeight);
     //
     for (int i = 0; i < 8; i++)
     {
         arg.Graphics.FillRectangle(BoxFillBrush, _anchorBoxes[i].X, _anchorBoxes[i].Y, _anchorBoxes[i].Width, _anchorBoxes[i].Height);
         arg.Graphics.DrawRectangle(BorderBoxPen, _anchorBoxes[i].X, _anchorBoxes[i].Y, _anchorBoxes[i].Width, _anchorBoxes[i].Height);
     }
 }
Ejemplo n.º 2
0
        public void Render(RenderArg arg)
        {
            PointF fPt = PointF.Empty, tPt = PointF.Empty;

            GeometryHelper.GetLinkLine(_preActionElement, _nextActionElement, out fPt, out tPt);
            arg.Graphics.DrawLine(PenLink, fPt, tPt);
            arg.Graphics.FillPolygon(FillArrow, GetArrowPoints(fPt, tPt));
        }
Ejemplo n.º 3
0
 public void Render(RenderArg arg)
 {
     if (_size.IsEmpty)
     {
         return;
     }
     arg.Graphics.FillEllipse(FillBrush, _location.X, _location.Y, _size.Width, _size.Height);
     arg.Graphics.DrawEllipse(BorderPen, _location.X, _location.Y, _size.Width, _size.Height);
     arg.Graphics.DrawString(_name,
                             Font,
                             Brushes.Black,
                             new RectangleF(_location, _size),
                             TextStringFormat);
     if (_isSelected)
     {
         DrawAnchorBox(arg);
     }
 }
Ejemplo n.º 4
0
 private void Render(RenderArg arg)
 {
     if (_bindingEnvironment == null || _bindingEnvironment.ActionElements == null || _bindingEnvironment.ActionElements.Length == 0)
     {
         return;
     }
     if (_bindingEnvironment.ActionElementLinks != null && _bindingEnvironment.ActionElementLinks.Length > 0)
     {
         foreach (IRenderable r in _bindingEnvironment.ActionElementLinks)
         {
             r.Render(arg);
         }
     }
     _bindingEnvironment.ActionElements[0].ToRectangleF(ref _fullExtent);
     foreach (IRenderable r in _bindingEnvironment.ActionElements)
     {
         (r as ActionElement).UnitTo(ref _fullExtent);
         r.Render(arg);
     }
 }
Ejemplo n.º 5
0
        public void Dispose()
        {
            if (_tramsform != null)
            {
                _tramsform.Dispose();
                _tramsform = null;
            }
            if (_identityTransform != null)
            {
                _identityTransform.Dispose();
                _identityTransform = null;
            }
            if (_invertTransform != null)
            {
                _invertTransform.Dispose();
                _invertTransform = null;
            }
            if (_arg != null)
            {
                _arg.Dispose();
                _arg = null;
            }
            if (ActionElement.BorderPen != null)
            {
                ActionElement.BorderPen.Dispose();
                ActionElement.BorderPen = null;
            }

            if (ActionElement.FillBrush != null)
            {
                ActionElement.FillBrush.Dispose();
                ActionElement.FillBrush = null;
            }
            if (ActionElement.TextStringFormat != null)
            {
                ActionElement.TextStringFormat.Dispose();
                ActionElement.TextStringFormat = null;
            }
            if (ActionElement.BorderEditingRect != null)
            {
                ActionElement.BorderEditingRect.Dispose();
                ActionElement.BorderEditingRect = null;
            }
            if (ActionElement.BoxFillBrush != null)
            {
                ActionElement.BoxFillBrush.Dispose();
                ActionElement.BoxFillBrush = null;
            }
            if (ActionElement.BorderBoxPen != null)
            {
                ActionElement.BorderBoxPen.Dispose();
                ActionElement.BorderBoxPen = null;
            }
            if (ActionElementLink.PenLink != null)
            {
                ActionElementLink.PenLink.Dispose();
                ActionElementLink.PenLink = null;
            }
            if (ActionElementLink.FillArrow != null)
            {
                ActionElementLink.FillArrow.Dispose();
                ActionElementLink.FillArrow = null;
            }
        }
Ejemplo n.º 6
0
 private void InitRenderArg()
 {
     _arg = new RenderArg(this as IModelEditor);
 }