コード例 #1
0
        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
ファイル: GraphvizAlgorithm.cs プロジェクト: tmauldin/mb-unit
        /// <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>
		/// Graphviz format edge parameter object
		/// </summary>
		/// <param name="edgeFormatter">edge formatter</param>
		/// <param name="e">edge</param>
		public FormatEdgeEventArgs(GraphvizEdge edgeFormatter, IEdge e)
			: base(e)
		{
			if (edgeFormatter==null)
				throw new ArgumentNullException("edgeFormatter");
			m_EdgeFormatter = edgeFormatter;
		}
コード例 #4
0
ファイル: GraphvizAlgorithm.cs プロジェクト: tmauldin/mb-unit
 /// <summary>
 /// Triggers the FormatEdge event
 /// </summary>
 /// <param name="ge"></param>
 /// <param name="e"></param>
 protected virtual void OnFormatEdge(GraphvizEdge ge, IEdge e)
 {
     if (FormatEdge != null)
     {
         FormatEdge(this, new FormatEdgeEventArgs(ge, e));
         Output.Write(" {0}", EdgeFormat.ToDot());
     }
 }
コード例 #5
0
 /// <summary>
 /// Graphviz format edge parameter object
 /// </summary>
 /// <param name="edgeFormatter">edge formatter</param>
 /// <param name="e">edge</param>
 public FormatEdgeEventArgs(GraphvizEdge edgeFormatter, IEdge e)
     : base(e)
 {
     if (edgeFormatter == null)
     {
         throw new ArgumentNullException("edgeFormatter");
     }
     m_EdgeFormatter = edgeFormatter;
 }
コード例 #6
0
        /// <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);
        }
コード例 #7
0
ファイル: GraphvizAlgorithm.cs プロジェクト: tmauldin/mb-unit
        /// <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();
        }
コード例 #8
0
        /// <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
        /// <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);
        }
コード例 #10
0
 /// <summary>
 /// Triggers the FormatEdge event
 /// </summary>
 /// <param name="ge"></param>
 /// <param name="e"></param>
 protected virtual void OnFormatEdge(GraphvizEdge ge, IEdge e)
 {
     if (FormatEdge != null)
     {
         FormatEdge(this, new FormatEdgeEventArgs(ge,e));
         Output.Write(" {0}",EdgeFormat.ToDot());
     }
 }
コード例 #11
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();
        }
コード例 #12
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();
        }