eclipsegrapheditorzest

Can't close editor part with big zest graph


I built an editor part in eclipse to visualize a Zest graph. My problem: if I try to close an editor part which contains a big graph (~6000 nodes, 9000 edges), eclipse can't handle the closing operation and hangs up.

Any ideas to solve the problem or debug it?

I think the problem is to dispose the graph object, but I have not idea to solve it.

Thanks in advance!


Solution

  • The problem was the method "org.eclipse.gef4.zest.layouts.algorithms.TreeLayoutObserver.TreeNode.isAncestorO‌​f(TreeNode descendant)". I fixed it for me and I will report a bug (for bug id show in the comments). If someone needs a quick bug fix:

    old version:

        public boolean isAncestorOf(TreeNode descendant) {
            while (descendant.depth > this.depth) {
                descendant = descendant.parent;
            }
            return descendant == this;
        }
    

    new version:

        public boolean isAncestorOf(TreeNode descendant) {
            while (descendant.depth > this.depth) {
                if (descendant == descendant.parent) {
                    return false;
                } else {
                    descendant = descendant.parent;
                }
            }
            return descendant == this;
        }