Exemple #1
0
        void populator_NodeAdded(object sender, GleeVertexEventArgs <GcType> args)
        {
            args.Node.Attr.Shape = Microsoft.Glee.Drawing.Shape.Box;
            double gen = args.Vertex.Gen;

            if (gen > 2)
            {
                args.Node.Attr.Fillcolor = Microsoft.Glee.Drawing.Color.LightBlue;
            }
            else if (gen > 1)
            {
                args.Node.Attr.Fillcolor = Microsoft.Glee.Drawing.Color.LightGoldenrodYellow;
            }
            else if (gen >= 0)
            {
                args.Node.Attr.Fillcolor = Microsoft.Glee.Drawing.Color.LightPink;
            }
            else
            {
                args.Node.Attr.Fillcolor = Microsoft.Glee.Drawing.Color.LightSalmon;
            }

            // root -> other color
            if (args.Vertex.Root)
            {
                args.Node.Attr.AddStyle(Microsoft.Glee.Drawing.Style.Dashed);
            }

            // label
            args.Node.Attr.Label =
                String.Format("{0}\nc:{1} g:{2:0.0} s:{3}",
                              args.Vertex.Name,
                              args.Vertex.Count,
                              args.Vertex.Gen,
                              FormatHelper.ToSize(args.Vertex.Size)
                              );
        }