if (toMoveAncestor != destinationAncestor) {
if (toMoveAncestor != null) {
//The node has an enabled ancestor
//We delete edges from potential meta edges
if (node.size > 0) {
for (DescendantAndSelfIterator itr = new DescendantAndSelfIterator(treeStructure, node, Tautology.instance); itr.hasNext();) {
AbstractNode descendant = itr.next();
edgeProcessor.clearEdgesWithoutRemove(descendant);
}
} else {
edgeProcessor.clearEdgesWithoutRemove(node);
}
} else if (node.isEnabled()) {
//The node is enabled
if (destinationAncestor != null) {
//The destination is enabled or has enabled ancestor
//Node is thus disabled
edgeProcessor.clearMetaEdges(node);
node.setEnabled(false);
view.decNodesEnabled(1);
edgeProcessor.decrementEdgesCouting(node, null);
//DO
} else {
//The node is kept enabled
//Meta edges are still valid only if their target is out of the dest cluster
edgeProcessor.clearMetaEdgesOutOfRange(node, nodeGroup);
}
} else if (node.size > 0) {
if (destinationAncestor != null) {
//The node may have some enabled descendants and we set them disabled
for (DescendantIterator itr = new DescendantIterator(treeStructure, node, Tautology.instance); itr.hasNext();) {
AbstractNode descendant = itr.next();
if (descendant.isEnabled()) {
edgeProcessor.clearMetaEdges(descendant);
descendant.setEnabled(false);
view.decNodesEnabled(1);
edgeProcessor.decrementEdgesCouting(descendant, null);
//TODO
}
}
//DO
} else {
//The node may have some enabled descendants and we keep them enabled
for (DescendantIterator itr = new DescendantIterator(treeStructure, node, Tautology.instance); itr.hasNext();) {
AbstractNode descendant = itr.next();
if (descendant.isEnabled()) {
//Enabled descendants meta edges are still valid only if their target is out of
//the destination cluster
edgeProcessor.clearMetaEdgesOutOfRange(node, nodeGroup);
}