示例#1
0
文件: Dot.cs 项目: takeisit/Monbetsu
 protected override void WriteAttributes(RootGraph root, StringBuilder builder, int indent)
 {
     if (Style.HasValue)
     {
         root.WriteIndent(builder, indent).AppendLine($"style = {Style}");
     }
 }
示例#2
0
文件: Dot.cs 项目: takeisit/Monbetsu
        public void WriteChildElements(RootGraph root, StringBuilder builder, int indent)
        {
            root.WriteIndent(builder, indent);

            builder.Append(Id);

            var attrList = new List <string>();

            if (Label != null)
            {
                attrList.Add($"label={Label}");
            }
            if (Style.HasValue)
            {
                attrList.Add($"style={Style}");
            }
            if (Color != null)
            {
                attrList.Add($"color={Color}");
            }
            if (FontColor != null)
            {
                attrList.Add($"fontcolor={FontColor}");
            }
            if (Shape != null)
            {
                attrList.Add($"shape={Shape}");
            }
            if (Width != null)
            {
                attrList.Add($"width={Width}");
            }
            if (Height != null)
            {
                attrList.Add($"width={Height}");
            }

            if (attrList.Count > 0)
            {
                builder.Append(" [");
                builder.AppendJoin(", ", attrList);
                builder.Append("]");
            }

            builder.AppendLine();
        }
示例#3
0
文件: Dot.cs 项目: takeisit/Monbetsu
        protected override void WriteChildElements(RootGraph root, StringBuilder builder, int indent)
        {
            root.WriteIndent(builder, indent);

            builder.Append("subgraph");
            if (SubgraphId.HasValue)
            {
                builder.Append($" {SubgraphId}");
            }
            builder.AppendLine(" {");

            base.WriteChildElements(root, builder, indent + 1);

            WriteAttributes(root, builder, indent + 1);

            root.WriteIndent(builder, indent);
            builder.AppendLine("}");
        }
示例#4
0
文件: Dot.cs 项目: takeisit/Monbetsu
        protected virtual void WriteChildElements(RootGraph root, StringBuilder builder, int indent)
        {
            foreach (var node in Nodes)
            {
                node.WriteChildElements(root, builder, indent);
            }

            foreach (var edge in Edges)
            {
                edge.WriteChildElements(root, builder, indent);
            }

            foreach (var subgraph in Subgraphs)
            {
                subgraph.WriteChildElements(root, builder, indent);
            }

            foreach (var rank in Ranks)
            {
                rank.WriteChildElements(root, builder, indent);
            }
        }
示例#5
0
文件: Dot.cs 项目: takeisit/Monbetsu
        protected override void WriteAttributes(RootGraph root, StringBuilder builder, int indent)
        {
            if (NewRank != null)
            {
                WriteIndent(builder, indent).AppendLine($"newrank = {NewRank}");
            }

            if (RankSep != null)
            {
                WriteIndent(builder, indent).AppendLine($"ranksep = {RankSep}");
            }

            if (Size != null)
            {
                WriteIndent(builder, indent).AppendLine($"size = {Size}");
            }

            if (Splines != null)
            {
                WriteIndent(builder, indent).AppendLine($"splines = {Splines}");
            }

            if (Viewport != null)
            {
                WriteIndent(builder, indent).AppendLine($"viewport = {Viewport}");
            }

            if (PageDir != null)
            {
                WriteIndent(builder, indent).AppendLine($"pagedir = {PageDir}");
            }

            if (RankDir != null)
            {
                WriteIndent(builder, indent).AppendLine($"rankdir = {RankDir}");
            }
        }
示例#6
0
文件: Dot.cs 项目: takeisit/Monbetsu
 void IStatement.WriteChildElements(RootGraph root, StringBuilder builder, int indent)
 => WriteChildElements(root, builder, indent);
示例#7
0
文件: Dot.cs 项目: takeisit/Monbetsu
 protected virtual void WriteAttributes(RootGraph root, StringBuilder builder, int indent)
 {
 }