public NodeModel getVisibleAncestorOrSelf() { NodeModel node = this; while (!node.isVisible()) { node = node.getParentNode(); } return node; }
public int getNodeLevel(final boolean countHidden) { int level = 0; NodeModel parent; for (parent = getParentNode(); parent != null; parent = parent.getParentNode()) { if (countHidden || parent.isVisible()) { level++; } } return level; }