// 移除一个叶节点 public void removeNode(DTreeNode node) { if (node.getChildList().Count > 0) { logError("can not remove a node which has child! use clearNode instead!"); return; } // 从父节点中移除 if (node.getParent() != null) { node.mParent.removeChild(node); } // 清除节点的父节点 node.setParent(null); // 将节点从列表中移除 mNodeList.Remove(node.getID()); if (node == mRootNode) { mRootNode = null; } }