Vertex Numbering, Gradient Fills

Topics: glee, graph
Sep 13, 2007 at 11:35 AM
As mentioned in another thread i generate the graph out of an AdjacencyGraph like this

GleeGraphPopulator<string, Edge<string>> populator = GleeGraphUtility.Create<string, Edge<string>>(graph);
Graph gleeGraph = populator.GleeGraph;

But all the vertices are suddenly numbered when displaying the graph using GLEE. E.g. there is a vertex called "MyState" and when displaying the graph it is called "0: MyState" and so on. Is there some way to suppress this?

One more short question:
- How do i produce such gradient fills in my graph as they are shown on the GLEE Homepage?
Sep 14, 2007 at 7:23 AM
First question: use the 'Create' overload that takes a formatprovider and format string.

Second question: use on VertexAdded and EdgeAdded to get notified about Glee vertex and edges being created. At this point, you can modify all the attributes of the glee nodes (including the label)
Sep 14, 2007 at 8:40 AM
can you give an example of the formatprovider overload? i have found it but haven't got a clue how to create such a formatprovider or even how to specyfy the format string for the third argument.
Sep 29, 2007 at 2:05 PM
just a reminder if you could please post an example how the formatprovider can be used
Oct 3, 2007 at 5:58 AM
Edited Oct 3, 2007 at 6:00 AM
Attach to the NodeAdded, EdgeAdded events of the GleePopulator objects

    GleeGraphPopulator<V, E> populator = GleeGraphUtility.Create(g);
        populator.NodeAdded += new GleeVertexNodeEventHandler<V>(populator_NodeAdded);
        populator.EdgeAdded += new GleeEdgeEventHandler<V, E>(populator_EdgeAdded);
       populator.NodeAdded -= new GleeVertexNodeEventHandler<V>(populator_NodeAdded);
       populator.EdgeAdded -= new GleeEdgeEventHandler<V, E>(populator_EdgeAdded);
    return this;
    void populator_EdgeAdded(object sender, GleeEdgeEventArgs<V, E> e)
            // change the edge apperance here 
        void populator_NodeAdded(object sender, GleeVertexEventArgs<V> args)
          // change the vertex appeance here
Oct 3, 2007 at 7:17 PM
i appreciate your examples for the formatting, it works fine now for me, but what i am still dont't get right is the IFormatprovider . The create method takes, as you mentioned before, this additonal argument with the iformatprovider. but how do i create such a formatprovider? what are the arguments for a formatstring? i know that for example for datetime you can provide a formatsting like "dd.MM.YYYY" but which arguments can be used here? is there some example you can provide?
Oct 4, 2007 at 3:27 AM
You don't need that. If you vertex supports a ToString(IFormatProvider fp) method, then it will be used. For example, DateTime supports this overload.