I need to disable connection of actual vertex if edges of vertex >= 2
if(graph.getModel().getEdgeCount(cell)>=2){
graphComp.setConnectable(false); // but for actual cell, not for all vertexes
}
How can I do that?
I need to disable connection of actual vertex if edges of vertex >= 2
if(graph.getModel().getEdgeCount(cell)>=2){
graphComp.setConnectable(false); // but for actual cell, not for all vertexes
}
How can I do that?
Instead of mxGraphComponent.setConnectable(false)
you can disable the connection for one Cell by calling mxCell.setConnectable(false)
.
If you want it to be enabled again when the edgecount goes down again you can use:
int maxEdgeCount = 2;
cell.setConnectable(cell.getEdgeCount < maxEdgeCount);