1

How can I change the routing style of the edges using the mxCell class?

for (mxCell cell : cells) {
    mxGraph.setCellStyle("edgeStyle=" + edge style + ";", new Object[] { cell });
}

Can I have something like that?

roniko1994
  • 51
  • 8
  • If you want to change it for every edge you can use: `mxGraph.getStylesheet().getDefaultEdgeStyle().put(mxConstants.STYLE_EDGE, /*your desired style e.g. mxConstants.EDGESTYLE_ELBOW*/)` – F. Lumnitz Nov 24 '15 at 07:22
  • I wanted to change the style of certain edges. Actually, the code I have provided above worked perfectly. I got a style name from mxConstants which corresponds to a String instead of getting an edge style from mxEdgeStyle which returns a function. – roniko1994 Nov 24 '15 at 10:09
  • Then use `mxCell#setStyle(String style)`. The cell doesn't care whether it's an edge or vertex. Or you can use `if(mxCell.isEdge()){mxCell.setStyle("whatever");}` – F. Lumnitz Nov 26 '15 at 09:55

0 Answers0