我试图在用户点击它时折叠顶点的所有子节点。但问题是,每次我尝试这样做时,都会出现以下错误:
Tree must not contain edu.ics.jung.graph.DelegateForest@17510d96
代码如下:
public void graphClicked(MyNode v, MouseEvent me)
{
Collection<MyNode> childrens = graph.getChildren(v);
Collection picked = new Hashset(childrens);
if(picked.size>1)
{
Graph ingraph = this.radialLayout.getGraph();
Graph clusterGraph = collapser.getClusterGraph(graph,childrens);
Graph g = collapser.collapse(ingraph,clustergraph); //The error report points on this line
.
.
.
}
}
我正在Forest
使用RadialLayout
。
谁能帮我?我该如何解决这个问题呢?