我正在按如下方式进行顶点插入:
String id = "1";
String value = "One";
Object v = graph.insertVertex(parent, id, value, 30, 30, 0, 0);
所以我需要通过 id 来获取这个顶点......
Object[] cells = graph.getChildVertices(graph.getDefaultParent());
for (Object c : cells)
{
mxCell cell = (mxCell) c;
System.out.println("id: " + cell.getId() + ", value: " + cell.getValue());
}
//result:
//id: 2, value: One
为什么id变了?我怎样才能正确获得顶点?