public boolean isLastNodeInParent() { if (parent != null) { List<TreeViewNode<T>> nodes = parent.getChildren(); return getPositionInParent() == nodes.size() - 1; } return true; }
public int getPositionInParent() { if (parent != null) { List<TreeViewNode<T>> nodes = parent.getChildren(); return nodes.indexOf(this); } return 0; }
public String getPositionInTree() { return parent != null ? parent.getPositionInTree() + "," + getPositionInParent() : "0"; }
public int getLevel() { return parent != null ? parent.getLevel() + 1 : 0; }