Saturday, 15 May 2010

Color the outgoing edges from a given node - Jung2 Java Graph Library -



Color the outgoing edges from a given node - Jung2 Java Graph Library -

good evening, did other questions library jung2 java, in absence of specific documentation , time in particular, inquire help.

in case, since code, know if there way color edges outgoing specific node of graph, because reply specific question.

thank in advance.

undirectedgraph<string, string> graphstruct = new undirectedsparsemultigraph<string, string>(); hashtable<string, nodedata> nodecollection = new hashtable<string, nodedata>(); hashtable<string, edgedata> edgecollection = new hashtable<string, edgedata>(); ... ... ... edgecollection.put(""+edge, new edgeclass(edge, "id+"+edge)); ... ... ... visualizationviewer<string, string> vv = new visualizationviewer<string, string>(new frlayout<string, string>(graphstruct)); vv.getrendercontext().setvertexfillpainttransformer(new vertexcolor(nodecollection)); vv.getrendercontext().setedgelabeltransformer(new tostringlabeller<string>()); vv.getrendercontext().setvertexlabeltransformer(new nodeid(nodecollection)); jlabel label = new jlabel(); label.setopaque(true); label.settext("graph"); vv.add(label); pluggablegraphmouse inter = new pluggablegraphmouse(); inter.add(new translatinggraphmouseplugin(mouseevent.button3_mask)); inter.add(new pickinggraphmouseplugin()); inter.add(new scalinggraphmouseplugin(new crossoverscalingcontrol(), 0, 2 / 1.2f, 1.2f)); vv.setgraphmouse(inter); vv.setpreferredsize(new dimension(1600,1000)); vv.setlocation(500, 500); vv.setgraphlayout(new circlelayout(graphstruct)); final jframe frame = new jframe(); frame.settitle("graph rappresentation"); frame.setdefaultcloseoperation(jframe.exit_on_close); frame.getcontentpane().add(vv); frame.pack(); frame.setvisible(true);

java graph edge jung

No comments:

Post a Comment