Exemplo n.º 1
0
        protected override void OnInitialize()
        {
            base.OnInitialize();

            Canvas.CoordinateSystem = new CartesianCoordinateSystem(Canvas.Width / 2, Canvas.Height / 2);

            var line1 = new Line(0, 0, 100, 100);

            line1.StrokeThickness = 1;
            line1.InstallEditPolicy(new SelectionFeedbackPolicy());
            line1.InstallLineHandle(0);
            line1.InstallLineHandle(1);
            line1.InstallEditPolicy(new RegionDragDropEditPolicy(new Draw2D.Core.Geo.Rectangle(0, 0, Canvas.Width, Canvas.Height)));
            Canvas.AddFigure(line1);

            //line1.InstallEditPolicy(new DirectionDragDropPolicy(DragDropDirections.Vertical));

            //var line2 = new Line(50, 150, 150, 150);
            //line2.StrokeThickness = 2;
            //line2.InstallEditPolicy(new SelectionFeedbackPolicy());
            //line2.InstallEditPolicy(new DirectionDragDropPolicy(DragDropDirections.Horizontal));
            //Canvas.AddFigure(line2);

            //var line3 = new Line(50, 150, 150, 300);
            //line3.StrokeThickness = 5;
            //line3.InstallEditPolicy(new SelectionFeedbackPolicy());
            //line3.InstallEditPolicy(new RegionDragDropEditPolicy(new Draw2D.Core.Geo.Rectangle(0,0,Canvas.Width,Canvas.Height)));
            //Canvas.AddFigure(line3);

            //var router = new PolylineTool(r => RouterDone((PolylineTool)r) );
            //Canvas.ActiveTool = router;
        }
Exemplo n.º 2
0
        protected override void OnInitialize()
        {
            base.OnInitialize();


            var visiblePolicyRect = new Rectangle(0, 0, 500, 500);

            visiblePolicyRect.FillColor    = Colors.CornflowerBlue;
            visiblePolicyRect.IsDragable   = true;
            visiblePolicyRect.IsSelectable = true;
            var regionPolicy = new FigureRegionDragDropEditPolicy(visiblePolicyRect);

            Canvas.AddFigure(visiblePolicyRect);

            var rect1 = new Rectangle(10, 10, 100, 100)
            {
                FillColor = Colors.LightCoral
            };

            rect1.AddHandlesCornerDirections(Canvas, HandleSizes.Small, HandleShapeType.Round);
            rect1.InstallEditPolicy(regionPolicy);
            rect1.InstallEditPolicy(SelectionFeedbackPolicy);
            visiblePolicyRect.InstallEditPolicy(new MasterSlaveDragDropPolicy(rect1));
            Canvas.AddFigure(rect1);

            //var rect2 = new Rectangle(100, 100, 100, 100)
            //{
            //    FillColor = Colors.LightSeaGreen
            //};
            //rect2.AddHandlesCornerDirections(Canvas, HandleSizes.Small, HandleShapeType.Round);
            //rect2.InstallEditPolicy(SelectionFeedbackPolicy);
            //Canvas.AddFigure(rect2);
        }
        public override void OnSelectionChanged(Canvas canvas, Figure figure)
        {
            if (canvas.Selection.All.Count() > 1)
            {
                var bb = CalculateSelectionBox(canvas);

                if (_selectionBox == null)
                {
                    _selectionBox = new Selectionbox(bb)
                    {
                        DashStyle       = DashStyles.Dash,
                        StrokeThickness = 1
                    };
                    canvas.AddFigure(_selectionBox);
                    _selectionBox.FillColor    = Colors.Black.AdjustOpacity(0);
                    _selectionBox.IsSelectable = false;
                }

                _selectionBox.ForceSetDimensions(bb);

                canvas.Selection.All.ToList().ForEach(f => f.SendToBack());

                _selectionBox.BringToFront();
            }
            else
            {
                canvas.RemoveFigure(_selectionBox);
                _selectionBox = null;
            }
        }
        protected override void OnInitialize()
        {
            base.OnInitialize();

            var rect1 = new Rectangle(100, 100, 100, 100)
            {
                FillColor = Colors.Chocolate
            };

            rect1.InstallEditPolicy(SelectionFeedbackPolicy);
            rect1.AddHandlesCornerDirections(Canvas, HandleSizes.Medium, HandleShapeType.Round);
            Canvas.AddFigure(rect1);

            var rect2 = new Rectangle(400, 100, 100, 100)
            {
                FillColor = Colors.DarkGreen
            };

            rect2.InstallEditPolicy(SelectionFeedbackPolicy);
            rect2.AddHandlesCornerDirections(Canvas, HandleSizes.Medium, HandleShapeType.Round);
            Canvas.AddFigure(rect2);

            var rect3 = new Rectangle(200, 300, 100, 100)
            {
                FillColor = Colors.DarkRed
            };

            rect3.InstallEditPolicy(SelectionFeedbackPolicy);
            rect3.AddHandlesCornerDirections(Canvas, HandleSizes.Medium, HandleShapeType.Round);

            Canvas.AddFigure(rect3);
        }
Exemplo n.º 5
0
        public void InitSnap(Canvas canvas, IEnumerable <Point> snapPointsOfFigure, IEnumerable <Figure> blackList)
        {
            _startSnapPoints = new List <Point>();
            _ghostSnapPoints = new List <Point>();

            foreach (var point in snapPointsOfFigure)
            {
                //We need the the fixed snap-points,
                //because we are oprating with dxSum and dySum,
                //which make only sense with the original starting positions.
                _startSnapPoints.Add(point.Clone());

                //We move ghost snap points around to the new position.
                _ghostSnapPoints.Add(point.Clone());
            }

            _snapPointCross = new Cross(0, 0, 10, 10)
            {
                IsSelectable    = false,
                IsDragable      = false,
                IsVisible       = false,
                CanBeSnapTarget = false,
                StrokeColor     = Colors.Red,
            };

            canvas.AddFigure(_snapPointCross);
        }
Exemplo n.º 6
0
        protected override void OnInitialize()
        {
            base.OnInitialize();

            var regionPolicy = new RegionDragDropEditPolicy(new Draw2D.Core.Geo.Rectangle(0, 0, Canvas.Width, Canvas.Height));

            var rect1 = new Rectangle(100, 100, 100, 100);

            rect1.InstallEditPolicy(new DirectionDragDropPolicy(DragDropDirections.Horizontal));
            rect1.AddHandlesCornerDirections(Canvas, HandleSizes.Small, HandleShapeType.Round);
            rect1.InstallEditPolicy(regionPolicy);
            rect1.InstallEditPolicy(SelectionFeedbackPolicy);
            Canvas.AddFigure(rect1);

            var text1 = new BoxedText("I have a 'HorizontalDragBehavior' attached.", 225, 150, 300, 30);

            text1.IsDragable = false;
            rect1.InstallEditPolicy(new MasterSlaveDragDropPolicy(text1));
            Canvas.AddFigure(text1);


            var rect2 = new Rectangle(100, 300, 100, 100);

            rect2.InstallEditPolicy(new DirectionDragDropPolicy(DragDropDirections.Vertical));
            rect2.AddHandlesCornerDirections(Canvas, HandleSizes.Small, HandleShapeType.Round);
            rect2.InstallEditPolicy(SelectionFeedbackPolicy);
            Canvas.AddFigure(rect2);

            var text2 = new BoxedText("I have a 'VerticalDragBehavior' attached.", 230, 330, 300, 30);

            text2.IsDragable = false;
            rect2.InstallEditPolicy(new MasterSlaveDragDropPolicy(text2));
            Canvas.AddFigure(text2);
        }
Exemplo n.º 7
0
        public override void OnMouseLeftDown(Canvas canvas, float mouseX, float mouseY, bool isShiftKey, bool isCtrlKey)
        {
            _clickCount++;

            if (_clickCount == 1)
            {
                Point snapPoint = new Point(mouseX, mouseY);
                var   isSnapped = false;
                foreach (var snapPolicy in canvas.GetSnapPolicies())
                {
                    Point delta;
                    isSnapped = snapPolicy.Snap(canvas, new Point(mouseX, mouseY), 0, 0, mouseX, mouseY, out snapPoint, out delta, new[] { _lineHandle });

                    if (isSnapped)
                    {
                        break;
                    }
                }

                if (isSnapped)
                {
                    mouseX = snapPoint.X;
                    mouseY = snapPoint.Y;
                }

                _polyline[0] = new Point(mouseX, mouseY);
            }


            if (!_isLineAdded)
            {
                canvas.AddFigure(_polyline);
                _isLineAdded = true;
            }
        }
Exemplo n.º 8
0
        public override void OnMouseMove(Canvas canvas, float mouseX, float mouseY, bool isShiftKey, bool isCtrlKey)
        {
            if (!_isInitialized)
            {
                _isInitialized = true;

                _line = new Line(0, 0, 0, 0);
                _line.SetSnapTargets(SnapTargets.Vertices);
                _lineHandle = new LineHandle(new Ellipse(mouseX, mouseY, 10, 10), 0, _line)
                {
                    CanBeSnapTarget = false,
                    FillColor       = Colors.Transparent
                };

                foreach (var snapPolicy in canvas.GetSnapPolicies())
                {
                    snapPolicy.InitSnap(canvas, _lineHandle.GetSnapPoints(), new [] { _lineHandle });
                }

                canvas.Selection.Clear();

                canvas.AddFigure(_lineHandle);
            }

            var snapPoint = new Point(mouseX, mouseY);
            var isSnapped = false;

            foreach (var snapPolicy in canvas.GetSnapPolicies())
            {
                Point delta;
                isSnapped = snapPolicy.Snap(canvas, snapPoint, 0, 0, mouseX, mouseY, out snapPoint, out delta,
                                            new[] { _lineHandle });

                if (isSnapped)
                {
                    break;
                }
            }

            if (isSnapped)
            {
                mouseX = snapPoint.X;
                mouseY = snapPoint.Y;
            }

            _lineHandle.ForceSetPositionCenter(mouseX, mouseY);

            if (_clickCount == 0)
            {
                _line[0] = new Point(mouseX, mouseY);
                _line[1] = new Point(mouseX, mouseY);
            }
            else
            {
                _line[1] = new Point(mouseX, mouseY);
            }
        }
Exemplo n.º 9
0
 private void canvasPB_MouseDown(object sender, MouseEventArgs e)
 {
     if (selectedPB != null && canvasPB.Tag != null)
     {
         mouseDownLocation = e.Location;
         Figure figure = (Figure)canvasPB.Tag;
         figure.Location = e.Location;
         figure.Size     = new Size(0, 0);
         canvas.AddFigure(figure);
     }
 }
Exemplo n.º 10
0
        protected override void OnInitialize()
        {
            base.OnInitialize();
            var regionPolicy = new RegionDragDropEditPolicy(new Draw2D.Core.Geo.Rectangle(0, 0, Canvas.Width, Canvas.Height));

            var message =
                "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.";

            var text1 = new BoxedText(message, 100, 100, 100, 100);

            text1.FillColor = Colors.LightSkyBlue;

            text1.AddHandlesCornerDirections(Canvas, HandleSizes.Small, HandleShapeType.Round);
            text1.InstallEditPolicy(SelectionFeedbackPolicy);
            text1.InstallEditPolicy(regionPolicy);
            Canvas.AddFigure(text1);

            var text2 = new BoxedText("I'm a text with transparent background and big font size.", 250, 100, 400, 150)
            {
                FillColor = Colors.Transparent,
                FontSize  = 24
            };

            text2.AddHandlesCornerDirections(Canvas, HandleSizes.Small, HandleShapeType.Round);
            text2.InstallEditPolicy(regionPolicy);
            text2.InstallEditPolicy(SelectionFeedbackPolicy);
            Canvas.AddFigure(text2);

            var text3 = new BoxedText("I'm a dark blue text.", 100, 300, 150, 30)
            {
                FillColor   = Colors.White,
                FontSize    = 16,
                StrokeColor = Colors.DarkBlue
            };

            text3.AddHandlesCornerDirections(Canvas, HandleSizes.Small, HandleShapeType.Round);
            text3.InstallEditPolicy(regionPolicy);
            text3.InstallEditPolicy(SelectionFeedbackPolicy);
            Canvas.AddFigure(text3);


            var text4 = new BoxedText("I'm text with fully transparent box.", 400, 300, 150, 30)
            {
                FillColor   = Colors.Transparent,
                FontSize    = 16,
                StrokeColor = Colors.Transparent,
            };

            text4.AddHandlesCornerDirections(Canvas, HandleSizes.Small, HandleShapeType.Round);
            text4.InstallEditPolicy(regionPolicy);
            text4.InstallEditPolicy(SelectionFeedbackPolicy);
            Canvas.AddFigure(text4);
        }
Exemplo n.º 11
0
        protected override void OnInitialize()
        {
            base.OnInitialize();

            var rect1           = new Rectangle(100, 100, 100, 100);
            var resizeHandleTop = new ResizeHandle(rect1, new Ellipse(0, 0, 30, 30)
            {
                FillColor = Colors.Red.AdjustOpacity(0.5)
            }, 0, 0, ResizeDirections.Top);

            resizeHandleTop.InstallEditPolicy(new SnapGridPolicy());
            rect1.AddHandle(resizeHandleTop);
            rect1.InstallEditPolicy(SelectionFeedbackPolicy);
            rect1.InstallEditPolicy(new DragFeedbackPolicy());

            Canvas.AddFigure(rect1);

            var rect2 = new Rectangle(250, 100, 100, 100);

            rect2.AddHandle(new ResizeHandle(rect2, new Ellipse(0, 0, 30, 30), 0, 0, ResizeDirections.Top));
            rect2.AddHandle(new ResizeHandle(rect2, new Ellipse(0, 0, 30, 30), 0, 0, ResizeDirections.Left));
            rect2.InstallEditPolicy(SelectionFeedbackPolicy);
            Canvas.AddFigure(rect2);

            var rect3 = new Rectangle(400, 100, 100, 100);

            rect3.AddHandlesCornerDirections(Canvas, HandleSizes.Big, HandleShapeType.Round);
            rect3.InstallEditPolicy(SelectionFeedbackPolicy);
            Canvas.AddFigure(rect3);

            var rect4 = new Rectangle(100, 300, 100, 100);

            rect4.AddHandlesLeftRightDirections(Canvas, HandleSizes.Medium, HandleShapeType.Square);
            rect4.InstallEditPolicy(SelectionFeedbackPolicy);
            Canvas.AddFigure(rect4);

            var rect5 = new Rectangle(250, 300, 100, 100);

            rect5.AddHandlesAllDirections(Canvas, HandleSizes.Medium, HandleShapeType.Square);
            rect5.InstallEditPolicy(SelectionFeedbackPolicy);
            Canvas.AddFigure(rect5);

            var rect6 = new Rectangle(400, 300, 100, 100);

            rect6.AddHandlesLeftRightDirections(Canvas, HandleSizes.Medium, HandleShapeType.Square);
            rect6.AddHandlesTopBottomDirections(Canvas, HandleSizes.Medium, HandleShapeType.Round);
            rect6.InstallEditPolicy(SelectionFeedbackPolicy);
            Canvas.AddFigure(rect6);
        }
Exemplo n.º 12
0
        protected override void OnInitialize()
        {
            base.OnInitialize();

            //var rect1 = new Rectangle(30, 30, 100, 100) { FillColor = Colors.Chocolate };
            //rect1.InstallEditPolicy(SelectionFeedbackPolicy);
            //rect1.AddHandlesCornerDirections(Canvas, HandleSizes.Medium, HandleShapeType.Round);
            //Canvas.AddFigure(rect1);

            var message =
                "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.";

            var glyphedText = new GlyphedText(message, 100, 100, 100, 30);

            Canvas.AddFigure(glyphedText);
        }
Exemplo n.º 13
0
        protected override void OnInitialize()
        {
            base.OnInitialize();
            //var rect1 = new Rectangle(110, 110, 90, 110);
            //Canvas.AddFigure(rect1);

            var graph   = new Graph();
            var vertex1 = new Point(100, 100);
            var vertex2 = new Point(300, 100);
            var vertex3 = new Point(300, 300);
            var vertex4 = new Point(200, 200);

            graph.AddVerticesAndEdge(vertex1, vertex2);
            graph.AddVerticesAndEdge(vertex2, vertex3);
            graph.AddVerticesAndEdge(vertex2, vertex4);

            Canvas.AddFigure(graph);
        }
Exemplo n.º 14
0
        public override void OnMouseMove(Canvas canvas, float mouseX, float mouseY, bool isShiftKey, bool isCtrlKey)
        {
            if (_clickCount == 0)
            {
                return;
            }

            var endPoint = new Point(mouseX, mouseY);

            _connection[1] = new Point(_connection[0].X + (mouseX - _connection[0].X) / 2, _connection[0].Y);
            _connection[2] = new Point(_connection[1].X, endPoint.Y);
            _connection[3] = endPoint;

            if (!_isLineAdded)
            {
                canvas.AddFigure(_connection);
                _isLineAdded = true;
            }
        }
Exemplo n.º 15
0
        protected override void OnInitialize()
        {
            base.OnInitialize();
            Canvas.CoordinateSystem = new CartesianCoordinateSystem(Canvas.Width / 2, Canvas.Height / 2);

            var rect1 = new Rectangle(0, 0, 100, 100)
            {
                FillColor       = Colors.CornflowerBlue,
                StrokeColor     = Colors.Coral,
                StrokeThickness = 8
            };

            rect1.AddHandlesCornerDirections(Canvas, HandleSizes.Small, HandleShapeType.Round);
            rect1.InstallEditPolicy(SelectionFeedbackPolicy);

            Canvas.AddFigure(rect1);

            var rect2 = new Rectangle(250, 100, 100, 100)
            {
                FillColor = Color.FromArgb(100, 100, 170, 80)
            };

            rect2.AddHandlesCornerDirections(Canvas, HandleSizes.Small, HandleShapeType.Round);
            rect2.InstallEditPolicy(SelectionFeedbackPolicy);
            Canvas.AddFigure(rect2);

            var ellipse2 = new Ellipse(100, 300, 100, 100)
            {
                FillColor = Colors.Transparent
            };

            ellipse2.AddHandlesCornerDirections(Canvas, HandleSizes.Small, HandleShapeType.Round);
            ellipse2.InstallEditPolicy(SelectionFeedbackPolicy);
            Canvas.AddFigure(ellipse2);

            var ellipse3 = new Ellipse(250, 300, 100, 100);

            ellipse3.FillColor = Colors.Brown;
            ellipse3.AddHandlesCornerDirections(Canvas, HandleSizes.Small, HandleShapeType.Round);
            ellipse3.InstallEditPolicy(SelectionFeedbackPolicy);
            Canvas.AddFigure(ellipse3);
        }
Exemplo n.º 16
0
        public override bool OnDragStart(Canvas canvas, float x, float y)
        {
            base.OnDragStart(canvas, x, y);

            if (_centerHandle == null)
            {
                _centerHandle = new Cross(BoundingBox.Center.X, BoundingBox.Center.Y, 10, 10)
                {
                    IsSelectable    = false,
                    IsDragable      = false,
                    FillColor       = Colors.Transparent,
                    CanBeSnapTarget = false
                };
                canvas.AddFigure(_centerHandle);
            }
            _centerHandle.BringToFront();


            return(true);
        }
Exemplo n.º 17
0
        private void AddAxes()
        {
            var xLine = new Line(-Canvas.Width / 2, 0, Canvas.Width / 2, 0)
            {
                IsDragable      = false,
                IsSelectable    = false,
                CanBeSnapTarget = false
            };

            Canvas.AddFigure(xLine);
            xLine.SendToBack();

            var yLine = new Line(0, -Canvas.Height / 2, 0, Canvas.Height / 2)
            {
                IsDragable      = false,
                IsSelectable    = false,
                CanBeSnapTarget = false
            };

            Canvas.AddFigure(yLine);
            yLine.SendToBack();
        }
Exemplo n.º 18
0
        protected override void OnInitialize()
        {
            base.OnInitialize();
            var regionPolicy = new RegionDragDropEditPolicy(new Draw2D.Core.Geo.Rectangle(0, 0, Canvas.Width, Canvas.Height));

            var rect1 = new Rectangle(100, 100, 100, 100);

            rect1.AddHandlesCornerDirections(Canvas, HandleSizes.Small, HandleShapeType.Round);
            rect1.InstallEditPolicy(SelectionFeedbackPolicy);
            rect1.InstallEditPolicy(regionPolicy);
            Canvas.AddFigure(rect1);

            var text1 = new BoxedText("I'm a slave of the rect.\nNo selection feedback policy installed.", rect1.X + 10f, rect1.Y + 10f, 150, 30);

            rect1.InstallEditPolicy(new MasterSlaveDragDropPolicy(text1));
            Canvas.AddFigure(text1);

            var text2 = new BoxedText("I'm a slave of the rect.\nSelection feedback policy installed.", rect1.X + 10, rect1.Y + 110, 150, 30);

            text2.InstallEditPolicy(SelectionFeedbackPolicy);
            rect1.InstallEditPolicy(new MasterSlaveDragDropPolicy(text2));
            Canvas.AddFigure(text2);
        }
Exemplo n.º 19
0
        protected override void OnInitialize()
        {
            base.OnInitialize();
            var router      = new OrthogonalConnectionRouter((r) => { });
            var connection1 = new Connection(router, 0, 0, 100, 100)
            {
                StrokeThickness = 3
            };

            Canvas.AddFigure(connection1);

            //var polyLine = new PolyLine(0, 0, 100, 100)
            //{
            //    StrokeThickness = 3
            //};

            //polyLine.AddToEnd(350, 200);

            //Canvas.AddFigure(polyLine);

            //var router = new OrthogonalConnectionRouter((r) => {});
            //router.Reroute(connection1);
        }
Exemplo n.º 20
0
        protected override void OnInitialize()
        {
            base.OnInitialize();

            var message =
                "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.";

            var xCount = 300;
            var yCount = 300;

            Canvas.Width  = xCount * 150 + 100;
            Canvas.Height = yCount * 150 + 100;

            Canvas.StartBulkEdit();
            for (int i = 0; i < xCount; i++)
            {
                for (int j = 0; j < yCount; j++)
                {
                    var rect1 = new Rectangle(i * 150, j * 150, 100, 100)
                    {
                        FillColor = Colors.Chocolate
                    };
                    rect1.InstallEditPolicy(SelectionFeedbackPolicy);
                    rect1.AddHandlesCornerDirections(Canvas, HandleSizes.Medium, HandleShapeType.Round);
                    Canvas.AddFigure(rect1);

                    //var text1 = new BoxedText(message, i * 150, j * 150, 100, 100);
                    //text1.FillColor = Colors.LightSkyBlue;

                    //text1.AddHandlesCornerDirections(Canvas, HandleSizes.Small, HandleShapeType.Round);
                    //text1.InstallEditPolicy(SelectionFeedbackPolicy);
                    //Canvas.AddFigure(text1);
                }
            }
            Canvas.EndBulkEdit();
        }
 public override void OnSelect(Canvas canvas, Figure figure)
 {
     _line = new Line(figure.BoundingBox.Center, _master.BoundingBox.Center);
     canvas.AddFigure(_line);
 }