Example #1
0
        public SvgText(SvgRoot rootSvg, string text, double x, double y) : base(rootSvg, "text")
        {
            CreateElement();

            X = x;
            Y = y;
            Text = text;
        }
Example #2
0
        private void CreateElement(SvgRoot svg)
        {
            XmlElement = svg.CreateElement("a");
            _href = svg.CreateAttribute("href", "xlink");

            XmlElement.Attributes.Append(_href);
            XmlElement.AppendChild(Text.XmlElement);
        }
Example #3
0
        public SvgText(SvgRoot rootSvg, string text, double x, double y) : base(rootSvg, "text")
        {
            CreateElement();

            X    = x;
            Y    = y;
            Text = text;
        }
Example #4
0
        public SvgText(SvgRoot svg, string text, double x, double y)
        {
            CreateElement(svg);

            X = x;
            Y = y;
            Text = text;
        }
Example #5
0
        public SvgRectangle(SvgRoot rootSvg, double x, double y, double width, double height) : base(rootSvg, "rect")
        {
            CreateElement();

            X = x;
            Y = y;
            Width = width;
            Height = height;
        }
Example #6
0
        public SvgRectangle(SvgRoot svg, double x, double y, double width, double height)
        {
            CreateElement(svg);

            X = x;
            Y = y;
            Width = width;
            Height = height;
        }
Example #7
0
        public SvgRectangle(SvgRoot svg, double x, double y, double width, double height)
        {
            CreateElement(svg);

            X      = x;
            Y      = y;
            Width  = width;
            Height = height;
        }
Example #8
0
        public SvgRectangle(SvgRoot rootSvg, double x, double y, double width, double height) : base(rootSvg, "rect")
        {
            CreateElement();

            X      = x;
            Y      = y;
            Width  = width;
            Height = height;
        }
Example #9
0
        public SvgImage(SvgRoot svg, double x, double y, double width, double height, string href)
        {
            CreateElement(svg);

            X = x;
            Y = y;
            Width = width;
            Height = height;
            Href = href;
        }
Example #10
0
        public SvgImage(SvgRoot rootSvg, double x, double y, double width, double height, string href) : base(rootSvg, "image")
        {
            CreateElement();

            X = x;
            Y = y;
            Width = width;
            Height = height;
            Href = href;
        }
Example #11
0
        public SvgImage(SvgRoot rootSvg, double x, double y, double width, double height, string href) : base(rootSvg, "image")
        {
            CreateElement();

            X      = x;
            Y      = y;
            Width  = width;
            Height = height;
            Href   = href;
        }
Example #12
0
        public SvgImage(SvgRoot svg, double x, double y, double width, double height, string href)
        {
            CreateElement(svg);

            X      = x;
            Y      = y;
            Width  = width;
            Height = height;
            Href   = href;
        }
Example #13
0
        public string ToSvg(double maxWidth)
        {
            _renderedSvgDiagram = _sequenceDiagramSvgRenderer.RenderDiagram(this);

            if (_renderedSvgDiagram.Width > maxWidth)
            {
                _renderedSvgDiagram.Scale = maxWidth / _renderedSvgDiagram.Width;
            }

            return _renderedSvgDiagram.ToString();
        }
Example #14
0
        private void CreateElement(SvgRoot svg)
        {
            XmlElement = svg.CreateElement("path");

            _d           = svg.CreateAttribute("d");
            _stroke      = svg.CreateAttribute("stroke");
            _strokeWidth = svg.CreateAttribute("stroke-width");

            XmlElement.Attributes.Append(_d);
            XmlElement.Attributes.Append(_stroke);
            XmlElement.Attributes.Append(_strokeWidth);
        }
Example #15
0
        private void CreateElement(SvgRoot svg)
        {
            XmlElement = svg.CreateElement("path");

            _d = svg.CreateAttribute("d");
            _stroke = svg.CreateAttribute("stroke");
            _strokeWidth = svg.CreateAttribute("stroke-width");

            XmlElement.Attributes.Append(_d);
            XmlElement.Attributes.Append(_stroke);
            XmlElement.Attributes.Append(_strokeWidth);
        }
Example #16
0
        public SvgLink(SvgRoot svg, string text, string href, double x, double y)
        {
            Text = new SvgText(svg, text, x, y);
            CreateElement(svg);

            Text.Fill        = "#1382CE";
            Text.OnMouseOut  = "this.setAttribute('fill', '#1382CE')";
            Text.OnMouseOver = "this.setAttribute('fill', '#F58026')";

            Href   = href;
            Text.X = x;
            Text.Y = y;
        }
Example #17
0
        public SvgLink(SvgRoot rootSvg, string text, string href, double x, double y) : base(rootSvg, "a")
        {
            Text = new SvgText(rootSvg, text, x, y);
            CreateElement();

            Text.Fill = "#1382CE";
            Text.OnMouseOut = "this.setAttribute('fill', '#1382CE')";
            Text.OnMouseOver = "this.setAttribute('fill', '#F58026')";

            Href = href;
            Text.X = x;
            Text.Y = y;
        }
        public SvgRoot RenderConnectedDiagram(ClassDiagram classDiagram)
        {
            _classDiagram = classDiagram;
            _mainDiagram = _classDiagramSvgRenderer.RenderDiagram(_classDiagram);

            CalculateMainMarginsAndSize();
            PositionMainDiagram();
            DrawBaseTypes();
            DrawImplementedInterfaces();
            DrawUsedBy();
            DrawUses();

            return _mainDiagram;
        }
Example #19
0
        private void CreateElement(SvgRoot svg)
        {
            XmlElement = svg.CreateElement("polygon");

            _points      = svg.CreateAttribute("points");
            _fill        = svg.CreateAttribute("fill");
            _stroke      = svg.CreateAttribute("stroke");
            _strokeWidth = svg.CreateAttribute("stroke-width");

            XmlElement.Attributes.Append(_points);
            XmlElement.Attributes.Append(_fill);
            XmlElement.Attributes.Append(_stroke);
            XmlElement.Attributes.Append(_strokeWidth);
        }
Example #20
0
        private void CreateElement(SvgRoot svg)
        {
            XmlElement = svg.CreateElement("polygon");

            _points = svg.CreateAttribute("points");
            _fill = svg.CreateAttribute("fill");
            _stroke = svg.CreateAttribute("stroke");
            _strokeWidth = svg.CreateAttribute("stroke-width");

            XmlElement.Attributes.Append(_points);
            XmlElement.Attributes.Append(_fill);
            XmlElement.Attributes.Append(_stroke);
            XmlElement.Attributes.Append(_strokeWidth);
        }
        public SvgRoot RenderDiagram(ClassDiagram classDiagram)
        {
            _classDiagram = classDiagram;
            _diagramSize = new Size(CalculateDiagramWidth(classDiagram), CalculateDiagramHeight(classDiagram));

            _svgRoot = new SvgRoot() { Width = _diagramSize.Width, Height = _diagramSize.Height };
            _svgGraphic = new SvgGraphic(_svgRoot);
            _svgRoot.Add(_svgGraphic);

            RenderFrame();
            RenderHeader();
            RenderAllRowSections();

            return _svgRoot;
        }
        public SvgRoot RenderDiagram(SequenceDiagram sequenceDiagram)
        {
            _nodeMiddlePoints = new Dictionary<Guid, double>();
            _diagramSize = new Size(0.5, 80.5);
            _svgRoot = new SvgRoot(0, 0);

            DrawAllNodes(sequenceDiagram);
            DrawAllDiagramElements(sequenceDiagram);
            DrawVerticalLines(sequenceDiagram);

            _svgRoot.Height = _diagramSize.Height;
            _svgRoot.Width = _diagramSize.Width;

            return _svgRoot;
        }
Example #23
0
        private void CreateElement(SvgRoot svg)
        {
            XmlElement = svg.CreateElement("image");

            _width = svg.CreateAttribute("width");
            _height = svg.CreateAttribute("height");
            _x = svg.CreateAttribute("x");
            _y = svg.CreateAttribute("y");
            _preserveAspectRatio = svg.CreateAttribute("preserveAspectRatio");
            _href = svg.CreateAttribute("href", "xlink");

            XmlElement.Attributes.Append(_width);
            XmlElement.Attributes.Append(_height);
            XmlElement.Attributes.Append(_x);
            XmlElement.Attributes.Append(_y);
            XmlElement.Attributes.Append(_preserveAspectRatio);
            XmlElement.Attributes.Append(_href);
        }
Example #24
0
        private void CreateElement(SvgRoot svg)
        {
            XmlElement = svg.CreateElement("image");

            _width  = svg.CreateAttribute("width");
            _height = svg.CreateAttribute("height");
            _x      = svg.CreateAttribute("x");
            _y      = svg.CreateAttribute("y");
            _preserveAspectRatio = svg.CreateAttribute("preserveAspectRatio");
            _href = svg.CreateAttribute("href", "xlink");

            XmlElement.Attributes.Append(_width);
            XmlElement.Attributes.Append(_height);
            XmlElement.Attributes.Append(_x);
            XmlElement.Attributes.Append(_y);
            XmlElement.Attributes.Append(_preserveAspectRatio);
            XmlElement.Attributes.Append(_href);
        }
        public SvgRoot RenderDiagram(ClassDiagram classDiagram)
        {
            _diagramWidth = CalculateDiagramWidth(classDiagram);
            _svgRoot = new SvgRoot(100, _diagramWidth);

            var rect = new SvgRectangle(_svgRoot, 0.5, 0.5, _diagramWidth - 1, 100);
            rect.StrokeWidth = 1;
            rect.Stroke = "#979797";
            rect.Fill = "#FFFFFF";
            _svgRoot.AppendChild(rect.XmlElement);

            double position = 20.5d;
            position = RenderHeader(classDiagram, position);
            position = RenderAllRowSections(classDiagram, position);

            rect.Height = position - 9.5;
            _svgRoot.Height = position - 5;            
            return _svgRoot;
        }
Example #26
0
        private void CreateElement(SvgRoot svg)
        {
            XmlElement = svg.CreateElement("rect");

            _height = svg.CreateAttribute("height");
            _width = svg.CreateAttribute("width");
            _x = svg.CreateAttribute("x");
            _y = svg.CreateAttribute("y");
            _fill = svg.CreateAttribute("fill");
            _stroke = svg.CreateAttribute("stroke");
            _strokeWidth = svg.CreateAttribute("stroke-width");

            XmlElement.Attributes.Append(_height);
            XmlElement.Attributes.Append(_width);
            XmlElement.Attributes.Append(_x);
            XmlElement.Attributes.Append(_y);
            XmlElement.Attributes.Append(_fill);
            XmlElement.Attributes.Append(_stroke);
            XmlElement.Attributes.Append(_strokeWidth);
        }
Example #27
0
        private void CreateElement(SvgRoot svg)
        {
            XmlElement = svg.CreateElement("rect");

            _height      = svg.CreateAttribute("height");
            _width       = svg.CreateAttribute("width");
            _x           = svg.CreateAttribute("x");
            _y           = svg.CreateAttribute("y");
            _fill        = svg.CreateAttribute("fill");
            _stroke      = svg.CreateAttribute("stroke");
            _strokeWidth = svg.CreateAttribute("stroke-width");

            XmlElement.Attributes.Append(_height);
            XmlElement.Attributes.Append(_width);
            XmlElement.Attributes.Append(_x);
            XmlElement.Attributes.Append(_y);
            XmlElement.Attributes.Append(_fill);
            XmlElement.Attributes.Append(_stroke);
            XmlElement.Attributes.Append(_strokeWidth);
        }
Example #28
0
        private void CreateElement(SvgRoot svg)
        {
            XmlElement = svg.CreateElement("text");

            _x           = svg.CreateAttribute("x");
            _y           = svg.CreateAttribute("y");
            _fill        = svg.CreateAttribute("fill");
            _style       = svg.CreateAttribute("style");
            _textAnchor  = svg.CreateAttribute("text-anchor");
            _fontFamily  = svg.CreateAttribute("font-family");
            _fontSize    = svg.CreateAttribute("font-size");
            _onMouseOver = svg.CreateAttribute("onmouseover");
            _onMouseOut  = svg.CreateAttribute("onmouseout");

            XmlElement.Attributes.Append(_x);
            XmlElement.Attributes.Append(_y);
            XmlElement.Attributes.Append(_fill);
            XmlElement.Attributes.Append(_style);
            XmlElement.Attributes.Append(_textAnchor);
            XmlElement.Attributes.Append(_fontFamily);
            XmlElement.Attributes.Append(_fontSize);
            XmlElement.Attributes.Append(_onMouseOver);
            XmlElement.Attributes.Append(_onMouseOut);
        }
Example #29
0
        private void CreateElement(SvgRoot svg)
        {
            XmlElement = svg.CreateElement("text");

            _x = svg.CreateAttribute("x");
            _y = svg.CreateAttribute("y");
            _fill = svg.CreateAttribute("fill");
            _style = svg.CreateAttribute("style");
            _textAnchor = svg.CreateAttribute("text-anchor");
            _fontFamily = svg.CreateAttribute("font-family");
            _fontSize = svg.CreateAttribute("font-size");
            _onMouseOver = svg.CreateAttribute("onmouseover");
            _onMouseOut = svg.CreateAttribute("onmouseout");

            XmlElement.Attributes.Append(_x);
            XmlElement.Attributes.Append(_y);
            XmlElement.Attributes.Append(_fill);
            XmlElement.Attributes.Append(_style);
            XmlElement.Attributes.Append(_textAnchor);
            XmlElement.Attributes.Append(_fontFamily);
            XmlElement.Attributes.Append(_fontSize);
            XmlElement.Attributes.Append(_onMouseOver);
            XmlElement.Attributes.Append(_onMouseOut);
        }
Example #30
0
 public SvgGraphic(SvgRoot rootSvg) : base(rootSvg, "g")
 {
 }
Example #31
0
 public Size GetSvgSize()
 {
     _renderedSvgDiagram = _classDiagramSvgRenderer.RenderConnectedDiagram(this);  
     return new Size((int)_renderedSvgDiagram.Width, (int)_renderedSvgDiagram.Height);
 }
Example #32
0
 public SvgElement(SvgRoot rootSvg, string elementName) : base(string.Empty, elementName, string.Empty, rootSvg) 
 {
     _rootSvg = rootSvg;
 }
Example #33
0
 public SvgGraphic(SvgRoot rootSvg) : base(rootSvg, "g") { }
Example #34
0
 public SDTemplate ToSvg()
 {
     _renderedSvgDiagram = _classDiagramSvgRenderer.RenderConnectedDiagram(this); 
     return new SDTemplate(_renderedSvgDiagram.ToString());
 }
Example #35
0
        public SvgPolygon(SvgRoot rootSvg, string points) : base(rootSvg, "polygon")
        {
            CreateElement();

            Points = points;
        }
Example #36
0
        public SvgPolygon(SvgRoot svg, string points)
        {
            CreateElement(svg);

            Points = points;
        }
Example #37
0
 public SvgPath(SvgRoot rootSvg, string d) : base(rootSvg, "path")
 {
     CreateElement();
     D = d;
 }
Example #38
0
        public SvgPolygon(SvgRoot svg, string points)
        {
            CreateElement(svg);

            Points = points;
        }
Example #39
0
 public SDTemplate ToSvg()
 {
     _renderedSvgDiagram = _sequenceDiagramSvgRenderer.RenderDiagram(this);
     return new SDTemplate(_renderedSvgDiagram.ToString());
 }
Example #40
0
        public SvgPolygon(SvgRoot rootSvg, string points) : base(rootSvg, "polygon")
        {
            CreateElement();

            Points = points;
        }
Example #41
0
 public Size GetSvgSize()
 {
     _renderedSvgDiagram = _sequenceDiagramSvgRenderer.RenderDiagram(this);
     return new Size((int)_renderedSvgDiagram.Width, (int)_renderedSvgDiagram.Height);
 }
Example #42
0
 public SvgPath(SvgRoot svg, string d)
 {
     CreateElement(svg);
     D = d;
 }
Example #43
0
 public SvgPath(SvgRoot rootSvg, string d) : base(rootSvg, "path")
 {
     CreateElement();
     D = d;
 }
Example #44
0
 public SvgElement(SvgRoot rootSvg, string elementName) : base(string.Empty, elementName, string.Empty, rootSvg)
 {
     _rootSvg = rootSvg;
 }
Example #45
0
 public SvgPath(SvgRoot svg, string d)
 {
     CreateElement(svg);
     D = d;
 }