我的图表中有多个包含顶点的组。我要求顶点不应移出组或父级。尽管给出了增量坐标,我的所有组都会叠加在一个地方。可以做任何事情来解决这些问题吗?
mxGraph graph = new mxGraph();
Object parent = graph.getDefaultParent()
graph.beginModel().beginUpdate();
for(Object Card: CardList.size())
{
int x=300;
int y =300;
Object vtx=graph.insertVertex(parent,null,"Side",x,y,20,10);//group Object
graph.createGroupCell(new Object[] {vtx});
// A recursive function callwhich creates vertices
y= y+400;
x=x+300;
}
mxGraphComponent graphComponent= new mxGraphComponent(graph);
graph.isRemoveCellsFromParent(false);
contentPane.add(graphComponent);
graph.endModel().endUpdate();
}