private void DrawConnectionArrow(double calledNodeMiddlePoint)
        {
            var startX = (int)calledNodeMiddlePoint;
            var startY = (int)_diagramSize.Height;

            var points = string.Format("{0},{1} {2},{3} {2},{4}", startX, startY, startX - 5, startY - 5, startY + 5);
            var arrow = new SvgPolygon(_svgRoot, points);
            arrow.Stroke = arrow.Fill = "#979797";

            _svgGraphic.Add(arrow);

            _diagramSize.Height += ROWOFFSET;
        }
        private void DrawReturnConnection(SequenceDiagramConnection connection)
        {
            var callerNodeMiddlePoint = _nodeMiddlePoints[connection.CallerId];
            var calledNodeMiddlePoint = connection.CalledId == Guid.Empty ? 0 : _nodeMiddlePoints[connection.CalledId];

            var textWidth = ("return " + connection.Text).GetWidth(12, Fonts.FontLight);
            var text = new SvgText(_svgRoot, "return " + connection.Text, calledNodeMiddlePoint + 10, _diagramSize.Height + 10);
            text.FontSize = 12;
            _svgGraphic.Add(text);

            if ((textWidth + calledNodeMiddlePoint + 10) > _diagramSize.Width)
            {
                _diagramSize.Width = textWidth + calledNodeMiddlePoint + 20;
            }

            var path = new SvgPath(_svgRoot, string.Format("M{0},{1}L{2},{1}",
                    calledNodeMiddlePoint.ToString("0.00", CultureInfo.InvariantCulture),
                    (_diagramSize.Height + 20).ToString("0.00", CultureInfo.InvariantCulture),
                    callerNodeMiddlePoint.ToString("0.00", CultureInfo.InvariantCulture)));
            path.StrokeWidth = 1;
            path.Stroke = "#979797";
            _svgGraphic.Add(path);

            var startX = (int)calledNodeMiddlePoint;
            var startY = (int)_diagramSize.Height + 20;

            var points = string.Format("{0},{1} {2},{3} {2},{4}", startX, startY, startX + 5, startY + 5, startY - 5);
            var arrow = new SvgPolygon(_svgRoot, points);
            arrow.Stroke = arrow.Fill = "#979797";

            _svgGraphic.Add(arrow);

            _diagramSize.Height += 35;
        }
        private void DrawBaseTypes()
        {
            var offset = _leftMargin;
            for (int i = 0; i < _classDiagram.BaseTypes.Count; i++)
            {
                var diagram = _classDiagramSvgRenderer.RenderDiagram(_classDiagram.BaseTypes[i]);
                var diagramSize = new Size(
                    _classDiagramSvgRenderer.CalculateDiagramWidth(_classDiagram.BaseTypes[i]),
                    _classDiagramSvgRenderer.CalculateDiagramHeight(_classDiagram.BaseTypes[i]));

                var positionX = (i * 50) + offset;
                var positionY = 0;

                var translate = diagram.CreateAttribute("transform");
                translate.Value = string.Format("translate({0}, {1})", positionX.ToString("0.00", CultureInfo.InvariantCulture), positionY.ToString("0.00", CultureInfo.InvariantCulture));
                diagram["svg"]["g"].Attributes.Append(translate);

                _mainDiagram.ImportAdd((SvgElement)diagram["svg"]["g"]);

                offset += diagramSize.Width;

                var pathGraphic = new SvgGraphic(_mainDiagram);

                //line
                if (i == 0)
                {
                    var path = new SvgPath(_mainDiagram, string.Format("M{0},{1}L{0},{2}",
                        (positionX + 50).ToString("0.00", CultureInfo.InvariantCulture),
                        (positionY + diagramSize.Height).ToString("0.00", CultureInfo.InvariantCulture),
                        _topMargin.ToString("0.00", CultureInfo.InvariantCulture)));
                    path.StrokeWidth = 1;
                    path.Stroke = "#979797";
                    pathGraphic.Add(path);
                }

                //arrow
                var startX = positionX + 50;
                var startY = diagramSize.Height;

                var points = string.Format("{0},{1} {2},{3} {4},{3}",
                    startX.ToString("0.00", CultureInfo.InvariantCulture),
                    startY.ToString("0.00", CultureInfo.InvariantCulture),
                    (startX - 5).ToString("0.00", CultureInfo.InvariantCulture),
                    (startY + 10).ToString("0.00", CultureInfo.InvariantCulture),
                    (startX + 5).ToString("0.00", CultureInfo.InvariantCulture));
                var arrow = new SvgPolygon(_mainDiagram, points);
                arrow.Stroke = "#979797";
                arrow.Fill = "#FFFFFF";

                pathGraphic.Add(arrow);

                _mainDiagram.Add(pathGraphic);
            }
        }