java - Jgraph display a graph with the same disposition -


with code i'm visualizing current graph:

public void showmap(map m) {       setdefaultcloseoperation(jframe.exit_on_close);      jgraphxadapter<node, defaultedge> graphadapter =             new jgraphxadapter<node, defaultedge>(m.structure);      mxgraphcomponent gracom = new mxgraphcomponent(graphadapter);     mxgraphview gravie = graphadapter.getview();      hashtable<string, object> style = new hashtable<string, object>();      style.put(mxconstants.style_rounded, true);     style.put(mxconstants.style_orthogonal, false);     style.put(mxconstants.style_edge, "elbowedgestyle");     style.put(mxconstants.style_shape, mxconstants.shape_connector);     style.put(mxconstants.style_vertical_align, mxconstants.align_middle);     style.put(mxconstants.style_align, mxconstants.align_center);     style.put(mxconstants.style_strokecolor, "#6482b9"); // default #6482b9     style.put(mxconstants.style_fontcolor, "#446299");     style.put(mxconstants.style_nolabel, "1");      mxstylesheet edgestyle = new mxstylesheet();     edgestyle.setdefaultedgestyle(style);     graphadapter.setstylesheet(edgestyle);       gravie.setscale(1);     //adding panel padding     jpanel p =new jpanel();      mxigraphlayout layout = new mxfastorganiclayout(graphadapter);     layout.execute(graphadapter.getdefaultparent());      p.add(gracom);      add(p);     setsize(600, 400);      setvisible(true); } 

the map object m created using singleton pattern, , each node has same edges.

the problem each client displays graph in different way, need change layout or there way ?


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -