void () { TreeElement next = getTreeNext(); CompositeElement parent = getTreeParent(); TreeElement prev = getTreePrev(); if(prev != null){ prev.setTreeNext(next); } else if(parent != null) { parent.setFirstChildNode(next); } if(next != null){ next.setTreePrev(prev); } else if(parent != null) { parent.setLastChildNode(prev); } DebugUtil.checkTreeStructure(parent); DebugUtil.checkTreeStructure(prev); DebugUtil.checkTreeStructure(next); invalidate(); }