根据节点选择折叠一个荣格节点

| 当用户单击某个顶点时,我试图折叠该顶点的所有子代。但是问题是,每次尝试这样做时,都会出现以下错误:
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
。 谁能帮我?我该如何解决这个问题?     
已邀请:
在此处查看树节点折叠和顶点折叠演示: http://jung.sourceforge.net/applet/index.html 这些文件的源都包含在分发文件中。     

要回复问题请先登录注册