/** * Delete the actual node, without unlinking children or unlinking siblings, * which must be handled externally. */ private void deleteNode(Node<E> node) { // remove links to this node from siblings node.detachSiblings(); boolean visible = node.isVisible(); if(visible) { int viewIndex = data.indexOfNode(node.element, VISIBLE_NODES); updates.elementDeleted(viewIndex, node.getElement()); } data.remove(node.element); node.element = null; // null out the element }
/** * Delete the actual node, without unlinking children or unlinking siblings, * which must be handled externally. */ private void deleteNode(Node<E> node) { // remove links to this node from siblings node.detachSiblings(); boolean visible = node.isVisible(); if(visible) { int viewIndex = data.indexOfNode(node.element, VISIBLE_NODES); updates.elementDeleted(viewIndex, node.getElement()); } data.remove(node.element); node.element = null; // null out the element }
/** * Delete the actual node, without unlinking children or unlinking siblings, * which must be handled externally. */ private void deleteNode(Node<E> node) { // remove links to this node from siblings node.detachSiblings(); boolean visible = node.isVisible(); if(visible) { int viewIndex = data.indexOfNode(node.element, VISIBLE_NODES); updates.elementDeleted(viewIndex, node.getElement()); } data.remove(node.element); node.element = null; // null out the element }
/** * @return true if the visibility of this node is what it's parents prescribe. */ private boolean isVisibilityValid(Node<E> node) { boolean expectedVisible = true; for(Node<E> ancestor = node.parent; ancestor != null; ancestor = ancestor.parent) { if(!ancestor.expanded) { expectedVisible = false; break; } } return node.isVisible() == expectedVisible; }
/** * Set the virtualness of the specified node without firing events. */ private void setVirtual(Node<E> node, boolean virtual) { byte newColor; if(virtual) { newColor = node.isVisible() ? VISIBLE_VIRTUAL : HIDDEN_VIRTUAL; } else { newColor = node.isVisible() ? VISIBLE_REAL : HIDDEN_REAL; } data.setColor(node.element, newColor); }
/** * @return true if the visibility of this node is what it's parents prescribe. */ private boolean isVisibilityValid(Node<E> node) { boolean expectedVisible = true; for(Node<E> ancestor = node.parent; ancestor != null; ancestor = ancestor.parent) { if(!ancestor.expanded) { expectedVisible = false; break; } } return node.isVisible() == expectedVisible; }
/** * @return true if the visibility of this node is what it's parents prescribe. */ private boolean isVisibilityValid(Node<E> node) { boolean expectedVisible = true; for(Node<E> ancestor = node.parent; ancestor != null; ancestor = ancestor.parent) { if(!ancestor.expanded) { expectedVisible = false; break; } } return node.isVisible() == expectedVisible; }
/** * Set the virtualness of the specified node without firing events. */ private void setVirtual(Node<E> node, boolean virtual) { byte newColor; if(virtual) { newColor = node.isVisible() ? VISIBLE_VIRTUAL : HIDDEN_VIRTUAL; } else { newColor = node.isVisible() ? VISIBLE_REAL : HIDDEN_REAL; } data.setColor(node.element, newColor); }
/** * Set the virtualness of the specified node without firing events. */ private void setVirtual(Node<E> node, boolean virtual) { byte newColor; if(virtual) { newColor = node.isVisible() ? VISIBLE_VIRTUAL : HIDDEN_VIRTUAL; } else { newColor = node.isVisible() ? VISIBLE_REAL : HIDDEN_REAL; } data.setColor(node.element, newColor); }