/// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="args"></param>
        public void WriteVertex(Object sender, VertexEventArgs args)
        {
            if (m_Colors.Contains(args.Vertex))
            {
                GraphColor c = (GraphColor)m_Colors[args.Vertex];
                m_Vertex.FillColor = GraphColorConverter.Convert(c);
                if (c == GraphColor.Black)
                {
                    m_Vertex.FontColor = Color.White;
                }
                else
                {
                    m_Vertex.FontColor = Color.Black;
                }
            }
            else
            {
                m_Vertex.StrokeColor = Color.White;
            }

            if (m_VertexLabels != null)
            {
                m_Vertex.Label = m_VertexLabels[args.Vertex].ToString();
            }

            ((GraphvizAlgorithm)sender).Output.Write(m_Vertex.ToDot());
        }
Beispiel #2
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>
        /// 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(";");
        }