Here is an example:
mxGraph graph = new mxGraph()
{
public boolean isCellMovable(Object cell)
{
return !getModel().isEdge(cell);
}
public boolean isCellResizable(Object cell)
{
return !getModel().isVertex(cell);
}
};
graph.setCellsEditable(false);
graph.setCellsBendable(false);
System.out.println(graph.getSelectionCell());
Object v1 = graph.insertVertex(parent, null, "Hello",
20, 20, 80, 30, "fillColor=#FF0000;");
graph.setCellStyles(mxConstants.STYLE_FILLCOLOR, "#00FF00", new Object[]{v1});
user509428
source
share