software/test/performance/src/org/LexGrid/LexBIG/example/remote2/BuildTreeForCode2.java
/**
     * Prints the given tree item, recursing through all branches.
     * @param ti
     */
Prints the given tree item, recursing through all branches.
@param ti
Prints the given tree item recursing through all branches . @param ti
protected void printTree(TreeItem ti, String focusCode, int depth) {
        StringBuffer indent = new StringBuffer();
        for (int i = 0; i < depth * 2; i++)
            indent.append("| ");
        StringBuffer codeAndText = new StringBuffer(indent)
            .append(focusCode.equals(ti.code) ? ">>>>" : "")
            .append(ti.code).append(':')
            .append(ti.text.length() > 64 ? ti.text.substring(0, 62) + "..." : ti.text)
            .append(ti.expandable ? " [+]" : "");
        Util_displayMessage(codeAndText.toString());
        indent.append("| ");
        for (String association : ti.assocToChildMap.keySet()) {
            Util_displayMessage(indent.toString() + association);
            List<TreeItem> children = ti.assocToChildMap.get(association);
            Collections.sort(children);
            for (TreeItem childItem : children)
                printTree(childItem, focusCode, depth + 1);
        }
    }
protected void printTree ( TreeItem ti , String focusCode , int depth ) { StringBuffer indent = new StringBuffer ( ) ; for ( int i = 0 ; i < depth * 2 ; i ++ ) indent . append ( "| " ) ; StringBuffer codeAndText = new StringBuffer ( indent ) . append ( focusCode . equals ( ti . code ) ? ">>>>" : "" ) . append ( ti . code ) . append ( ':' ) . append ( ti . text . length ( ) > 64 ? ti . text . substring ( 0 , 62 ) + "..." : ti . text ) . append ( ti . expandable ? " [+]" : "" ) ; Util_displayMessage ( codeAndText . toString ( ) ) ; indent . append ( "| " ) ; for ( String association : ti . assocToChildMap . keySet ( ) ) { Util_displayMessage ( indent . toString ( ) + association ) ; List < TreeItem > children = ti . assocToChildMap . get ( association ) ; Collections . sort ( children ) ; for ( TreeItem childItem : children ) printTree ( childItem , focusCode , depth + 1 ) ; } }
Prints the given tree item, recursing through all branches.
Prints the given tree item recursing through all branches .