public static TreeNode<PersonRenderer> buildTree(
            final PersonRenderer personRenderer, final int currentDepth,
            final int depthLimit, final int seedRow) {
        final Person person = personRenderer.getGedObject();
        final PersonNavigator navigator = new PersonNavigator(person);

        final TreeNode<PersonRenderer> treeNode = new TreeNode<PersonRenderer>(
                personRenderer, currentDepth, currentDepth);

        int row = seedRow;
        if (currentDepth < depthLimit) {
            final Person father = navigator.getFather();
            final PersonRenderer fatherRenderer =
                    (PersonRenderer) personRenderer.createGedRenderer(father);
            final TreeNode<PersonRenderer> fatherTreeNode = buildTree(
                    fatherRenderer, currentDepth + 1, depthLimit, row);
            treeNode.addLeft(fatherTreeNode);
            row = fatherTreeNode.getHighestRowInTree() + 1;
        }

        treeNode.setRow(row++);

        if (currentDepth < depthLimit) {
            final Person mother = navigator.getMother();
            final PersonRenderer motherRenderer =
                    (PersonRenderer) personRenderer.createGedRenderer(mother);
            final TreeNode<PersonRenderer> motherTreeNode = buildTree(
                    motherRenderer, currentDepth + 1, depthLimit, row);
            treeNode.addRight(motherTreeNode);
        }
        return treeNode;
    }
public static TreeNode < PersonRenderer > buildTree ( final PersonRenderer personRenderer , final int currentDepth , final int depthLimit , final int seedRow ) { final Person person = personRenderer . getGedObject ( ) ; final PersonNavigator navigator = new PersonNavigator ( person ) ; final TreeNode < PersonRenderer > treeNode = new TreeNode < PersonRenderer > ( personRenderer , currentDepth , currentDepth ) ; int row = seedRow ; if ( currentDepth < depthLimit ) { final Person father = navigator . getFather ( ) ; final PersonRenderer fatherRenderer = ( PersonRenderer ) personRenderer . createGedRenderer ( father ) ; final TreeNode < PersonRenderer > fatherTreeNode = buildTree ( fatherRenderer , currentDepth + 1 , depthLimit , row ) ; treeNode . addLeft ( fatherTreeNode ) ; row = fatherTreeNode . getHighestRowInTree ( ) + 1 ; } treeNode . setRow ( row ++ ) ; if ( currentDepth < depthLimit ) { final Person mother = navigator . getMother ( ) ; final PersonRenderer motherRenderer = ( PersonRenderer ) personRenderer . createGedRenderer ( mother ) ; final TreeNode < PersonRenderer > motherTreeNode = buildTree ( motherRenderer , currentDepth + 1 , depthLimit , row ) ; treeNode . addRight ( motherTreeNode ) ; } return treeNode ; }
@param personRenderer the person renderer associated with the top node.
@param currentDepth 0 based depth into the tree.
@param depthLimit highest depth allowed.
@param seedRow initial row.
@return list ordered from top to bottom of the entries in the tree.