public TestGraphvizVertex(VertexStringDictionary names)
        {
            m_Names = names;

            m_Vertex = new GraphvizVertex();
            m_Vertex.Shape = GraphvizVertexShape.Hexagon;
            m_Vertex.Style = GraphvizVertexStyle.Filled;
            m_Vertex.ToolTip="This is a tooltip";
            m_Vertex.Url="http://www.dotnetwiki.org";
            m_Vertex.StrokeColor = Color.Red;
            m_Vertex.FillColor = Color.LightGray;
            m_Vertex.FontColor = Color.Blue;
            m_Vertex.Orientation = 45;
            m_Vertex.Regular = true;
            m_Vertex.Sides = 2;

            m_Edge = new GraphvizEdge();
            m_Edge.HeadArrow = new GraphvizArrow(GraphvizArrowShape.Box);
            m_Edge.HeadArrow.Clipping=GraphvizArrowClipping.Left;
            m_Edge.HeadArrow.Filling = GraphvizArrowFilling.Open;

            m_Edge.TailArrow = new GraphvizArrow(GraphvizArrowShape.Dot);

            m_Edge.Label.Value = "This is an edge";
        }
示例#2
0
        /// <summary>
        /// Builds a new Graphviz writer of the graph g using the Stream s.
        /// </summary>
        /// <param name="g">Graph to visit.</param>
        /// <param name="path">Path where files are to be created</param>
        /// <param name="imageType">output image type</param>
        /// <exception cref="ArgumentNullException">g is a null reference</exception>
        /// <exception cref="ArgumentNullException">path is a null reference</exception>
        public GraphvizAlgorithm(
            IVertexAndEdgeListGraph g,
            String path,
            GraphvizImageType imageType
            )
        {
            if (g == null)
            {
                throw new ArgumentNullException("g");
            }
            if (path == null)
            {
                throw new ArgumentNullException("path");
            }
            m_VisitedGraph = g;
            m_StringWriter = null;
            m_Dot          = new Dot(path);
            m_ImageType    = imageType;

            clusterCount  = 0;
            m_GraphFormat = new GraphvizGraph();

            m_CommonVertexFormat = new GraphvizVertex();
            m_CommonEdgeFormat   = new GraphvizEdge();

            m_VertexFormat = new GraphvizVertex();
            m_EdgeFormat   = new GraphvizEdge();
        }
示例#3
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="vertexFormatter"></param>
 /// <param name="v"></param>
 public FormatVertexEventArgs(GraphvizVertex vertexFormatter, IVertex v)
     : base(v)
 {
     if (vertexFormatter == null)
     {
         throw new ArgumentNullException("vertexFormatter");
     }
     m_VertexFormatter = vertexFormatter;
 }
示例#4
0
        /// <summary>
        /// Triggers the FormatVertex event
        /// </summary>
        /// <param name="v"></param>
        protected virtual void OnFormatVertex(IVertex v)
        {
            Output.Write("{0} ", v.ID);
            if (FormatVertex != null)
            {
                GraphvizVertex gv = new GraphvizVertex();
                FormatVertex(this, new FormatVertexEventArgs(gv, v));

                string s = gv.ToDot();
                if (s.Length != 0)
                {
                    Output.Write("[{0}]", s);
                }
            }
            Output.WriteLine(";");
        }
        /// <summary>
        /// Emptry constructor
        /// </summary>
        public EdgeDfsTest()
        {
            m_Vertex = new GraphvizVertex();
            m_Edge = new GraphvizEdge();

            Vertex.Style = GraphvizVertexStyle.Filled;
            Vertex.FillColor = Color.LightSkyBlue;

            GraphvizRecordCell cell = new GraphvizRecordCell();
            Vertex.Record.Cells.Add(cell);

            GraphvizRecordCell child = new GraphvizRecordCell();
            child.Text = "State";
            cell.Cells.Add(child);

            m_Cell = new GraphvizRecordCell();
            cell.Cells.Add(m_Cell);
        }
示例#6
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="g"></param>
        public GraphvizAlgorithm(IVertexAndEdgeListGraph g)
        {
            if (g == null)
            {
                throw new ArgumentNullException("g");
            }
            m_VisitedGraph = g;
            m_StringWriter = null;
            m_Dot          = new Dot();
            m_ImageType    = GraphvizImageType.Png;

            m_GraphFormat = new GraphvizGraph();

            m_CommonVertexFormat = new GraphvizVertex();
            m_CommonEdgeFormat   = new GraphvizEdge();

            m_VertexFormat = new GraphvizVertex();
            m_EdgeFormat   = new GraphvizEdge();
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="g"></param>
        /// <param name="prefix"></param>
        /// <param name="path"></param>
        /// <param name="imageType"></param>
        public AlgorithmTracerVisitor(
            IVertexAndEdgeListGraph g,
            String prefix,
            String path,
            GraphvizImageType imageType
            )
        {
            m_Vertex = new GraphvizVertex();
            m_Vertex.Shape = GraphvizVertexShape.Circle;
            m_Vertex.Style = GraphvizVertexStyle.Filled;
            m_VertexLabels =null;

            m_Edge = new GraphvizEdge();
            m_EdgeLabels = null;

            m_Colors = null;
            m_EdgeColors = new EdgeColorDictionary();

            m_Algo = new GraphvizAlgorithm(g,prefix,path,imageType);
            m_Algo.RegisterVisitor(this);
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="g"></param>
        /// <param name="prefix"></param>
        /// <param name="path"></param>
        /// <param name="imageType"></param>
        public AlgorithmTracerVisitor(
            IVertexAndEdgeListGraph g,
            String prefix,
            String path,
            GraphvizImageType imageType
            )
        {
            m_Vertex       = new GraphvizVertex();
            m_Vertex.Shape = GraphvizVertexShape.Circle;
            m_Vertex.Style = GraphvizVertexStyle.Filled;
            m_VertexLabels = null;

            m_Edge       = new GraphvizEdge();
            m_EdgeLabels = null;

            m_Colors     = null;
            m_EdgeColors = new EdgeColorDictionary();

            m_Algo = new GraphvizAlgorithm(g, prefix, path, imageType);
            m_Algo.RegisterVisitor(this);
        }
示例#9
0
 public FileDependencyTest()
 {
     m_Vertex = new GraphvizVertex();
     m_Names = new VertexStringDictionary();
 }
        /// <summary>
        /// Triggers the FormatVertex event
        /// </summary>
        /// <param name="v"></param>
        protected virtual void OnFormatVertex(IVertex v)
        {
            Output.Write("{0} ",v.ID);
            if (FormatVertex != null)
            {
                GraphvizVertex gv = new GraphvizVertex();
                FormatVertex(this, new FormatVertexEventArgs(gv,v));

                string s = gv.ToDot();
                if (s.Length!=0)
                    Output.Write("[{0}]",s);
            }
            Output.WriteLine(";");
        }
        /// <summary>
        /// Builds a new Graphviz writer of the graph g using the Stream s.
        /// </summary>
        /// <param name="g">Graph to visit.</param>
        /// <param name="path">Path where files are to be created</param>
        /// <param name="imageType">output image type</param>
        /// <exception cref="ArgumentNullException">g is a null reference</exception>
        /// <exception cref="ArgumentNullException">path is a null reference</exception>
        public GraphvizAlgorithm(
            IVertexAndEdgeListGraph g,
            String path,
            GraphvizImageType imageType
            )
        {
            if (g == null)
                throw new ArgumentNullException("g");
            if (path==null)
                throw new ArgumentNullException("path");
            m_VisitedGraph = g;
            m_StringWriter = null;
            m_Dot = new Dot(path);
            m_ImageType = imageType;

            clusterCount = 0;
            m_GraphFormat = new GraphvizGraph();

            m_CommonVertexFormat = new GraphvizVertex();
            m_CommonEdgeFormat = new GraphvizEdge();

            m_VertexFormat = new GraphvizVertex();
            m_EdgeFormat = new GraphvizEdge();
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="g"></param>
        public GraphvizAlgorithm(IVertexAndEdgeListGraph g)
        {
            if (g == null)
                throw new ArgumentNullException("g");
            m_VisitedGraph = g;
            m_StringWriter = null;
            m_Dot = new Dot();
            m_ImageType = GraphvizImageType.Png;

            m_GraphFormat = new GraphvizGraph();

            m_CommonVertexFormat = new GraphvizVertex();
            m_CommonEdgeFormat = new GraphvizEdge();

            m_VertexFormat = new GraphvizVertex();
            m_EdgeFormat = new GraphvizEdge();
        }