I have implemented this Graph:
ListenableDirectedWeightedGraph<String, MyWeightedEdge> g =
new ListenableDirectedWeightedGraph<String, MyWeightedEdge>(MyWeightedEdge.class);
In order to show what the class name says; a simple listenable directed weighted graph. I want to change the label of the edges and instead of the format
return "(" + source + " : " + target + ")";
I want it to show the weight of the edge. I realise that all actions on the nodes, e.g. the getEdgesWeight()
method, are delegated from the graph and not the edge. How can I show the weight of the edge? Do I have to pass in the Graph to the edge somehow?
Any help is appreciated.