Ejemplo n.º 1
0
        public SvgText(SvgRoot rootSvg, string text, double x, double y) : base(rootSvg, "text")
        {
            CreateElement();

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

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

            X    = x;
            Y    = y;
            Text = text;
        }
Ejemplo n.º 4
0
        public SvgText(SvgRoot svg, string text, double x, double y)
        {
            CreateElement(svg);

            X = x;
            Y = y;
            Text = text;
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 6
0
        public SvgRectangle(SvgRoot svg, double x, double y, double width, double height)
        {
            CreateElement(svg);

            X = x;
            Y = y;
            Width = width;
            Height = height;
        }
Ejemplo n.º 7
0
        public SvgRectangle(SvgRoot svg, double x, double y, double width, double height)
        {
            CreateElement(svg);

            X      = x;
            Y      = y;
            Width  = width;
            Height = height;
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 13
0
        public string ToSvg(double maxWidth)
        {
            _renderedSvgDiagram = _sequenceDiagramSvgRenderer.RenderDiagram(this);

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

            return _renderedSvgDiagram.ToString();
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 21
0
        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;
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 25
0
        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;
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 30
0
 public SvgGraphic(SvgRoot rootSvg) : base(rootSvg, "g")
 {
 }
Ejemplo n.º 31
0
 public Size GetSvgSize()
 {
     _renderedSvgDiagram = _classDiagramSvgRenderer.RenderConnectedDiagram(this);  
     return new Size((int)_renderedSvgDiagram.Width, (int)_renderedSvgDiagram.Height);
 }
Ejemplo n.º 32
0
 public SvgElement(SvgRoot rootSvg, string elementName) : base(string.Empty, elementName, string.Empty, rootSvg) 
 {
     _rootSvg = rootSvg;
 }
Ejemplo n.º 33
0
 public SvgGraphic(SvgRoot rootSvg) : base(rootSvg, "g") { }
Ejemplo n.º 34
0
 public SDTemplate ToSvg()
 {
     _renderedSvgDiagram = _classDiagramSvgRenderer.RenderConnectedDiagram(this); 
     return new SDTemplate(_renderedSvgDiagram.ToString());
 }
Ejemplo n.º 35
0
        public SvgPolygon(SvgRoot rootSvg, string points) : base(rootSvg, "polygon")
        {
            CreateElement();

            Points = points;
        }
Ejemplo n.º 36
0
        public SvgPolygon(SvgRoot svg, string points)
        {
            CreateElement(svg);

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

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

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