@Deprecated
public static int getNodeLevel (TreeItem<?> node)

Deprecated: This method does not correctly calculate the distance from the given TreeItem to the root of the TreeView. As of JavaFX 8.0_20, the proper way to do this is via TreeView.getTreeItemLevel(TreeItem)

Returns the number of levels of 'indentation' of the given TreeItem, based on how many times javafx.scene.control.TreeItem.getParent() can be recursively called. If the TreeItem does not have any parent set, the returned value will be zero. For each time getParent() is recursively called, the returned value is incremented by one.

Important note: This method is deprecated as it does not consider the root node. This means that this method will iterate past the root node of the TreeView control, if the root node has a parent. If this is important, call TreeView.getTreeItemLevel(TreeItem) instead.

Parameters:
node    The TreeItem for which the level is needed.

Returns:  An integer representing the number of parents above the given node, or -1 if the given TreeItem is null.