Inheritance: SharpDox.UML.Sequence.Elements.SequenceDiagramElement
Example #1
0
        public SequenceDiagramElement AddNode(string typeIdentifier)
        {
            var node = new SequenceDiagramNode
            {
                TypeIdentifier = typeIdentifier,
                Text = _types.Single(t => t.Identifier == typeIdentifier).Fullname
            };
            Nodes.Add(node);

            return node;
        }
Example #2
0
        public SequenceDiagramElement AddNode(string typeIdentifier)
        {
            var node = new SequenceDiagramNode
            {
                TypeIdentifier = typeIdentifier,
                Text = _sdRepository.GetTypeByIdentifier(typeIdentifier).Fullname
            };
            Nodes.Add(node);

            return node;
        }
        private Size DrawNode(Size diagramSize, SequenceDiagramNode node)
        {
            var text = new FormattedText(node.Text, CultureInfo.CurrentCulture, FlowDirection.LeftToRight, Fonts.FontLight, 12, Brushes.Black);
            var position = new Point(diagramSize.Width, 10);
            var size = new Size(text.Width + 20, 35);

            diagramSize = new Size(diagramSize.Width + text.Width + 40, diagramSize.Height);

            var rect = new Rect(position.X, position.Y, size.Width, size.Height);
            _context.DrawRectangle(Brushes.White, new Pen(Brushes.Black, 1), rect);
            _context.DrawText(text, new Point(position.X + 10, position.Y + 10));

            _nodeMiddlePoints.Add(node.ID, size.Width / 2 + position.X);

            return diagramSize;
        }
        private void DrawNode(SequenceDiagramNode node)
        {
            var textWidth = node.Text.GetWidth(12, Fonts.FontLight);
            var textPosition = new Point(_diagramSize.Width, 10);
            var textSize = new Size(textWidth + 20, 35);

            _diagramSize = new Size(_diagramSize.Width + textWidth + 40, _diagramSize.Height);

            var rectangle = new SvgRectangle(_svgRoot, textPosition.X, textPosition.Y, textSize.Width, textSize.Height);
            rectangle.StrokeWidth = 1;
            rectangle.Stroke = "#979797";
            rectangle.Fill = "#FFFFFF";

            var link = new SvgLink(_svgRoot, node.Text, string.Format("{{{{type-link:{0}}}}}", node.TypeIdentifier), textPosition.X + 15, textPosition.Y + 22);
            link.Text.FontSize = 12;

            _svgGraphic.Add(rectangle);
            _svgGraphic.Add(link);

            _nodeMiddlePoints.Add(node.ID, textSize.Width / 2 + textPosition.X);
        }