software/test/performance/src/gov/nih/nci/evs/browser/utils/TreeUtils.java
/**
     * The given path represents a multi-tier association with associated
     * concepts and targets.  This method expands the association content
     * and adds results to the given tree item, recursing as necessary to
     * process each level in the path.
     * <p>
     * Nodes in the association acts as the backbone for the display.
     * For each backbone node, additional children are resolved one level
     * deep along with an indication of further expandability.
     */
The given path represents a multi-tier association with associated
concepts and targets.  This method expands the association content
and adds results to the given tree item, recursing as necessary to
process each level in the path.

Nodes in the association acts as the backbone for the display.
For each backbone node, additional children are resolved one level
deep along with an indication of further expandability.
The given path represents a multi - tier association with associated concepts and targets . This method expands the association content and adds results to the given tree item recursing as necessary to process each level in the path . Nodes in the association acts as the backbone for the display . For each backbone node additional children are resolved one level deep along with an indication of further expandability .
protected void addPathFromRoot(TreeItem ti,
            LexBIGService lbsvc, LexBIGServiceConvenienceMethods lbscm,
            String scheme, CodingSchemeVersionOrTag csvt,
            Association path, String[] associationsToNavigate, boolean associationsNavigatedFwd,
            Map<String, EntityDescription> codesToDescriptions)
        throws LBException {
        ConceptReference branchRoot = path.getAssociationReference();
        String branchCode = branchRoot.getConceptCode();
        String branchCodeDescription = codesToDescriptions.containsKey(branchCode) ? codesToDescriptions
                .get(branchCode).getContent() : getCodeDescription(lbsvc, scheme, csvt, branchCode);
        TreeItem branchPoint = new TreeItem(branchCode, branchCodeDescription);
        String branchNavText = getDirectionalLabel(lbscm, scheme, csvt, path, associationsNavigatedFwd);
        AssociatedConceptList concepts = path.getAssociatedConcepts();
        for (int i = 0; i < concepts.getAssociatedConceptCount(); i++) {
            AssociatedConcept concept = concepts.getAssociatedConcept(i);
            String code = concept.getConceptCode();
            TreeItem branchItem = new TreeItem(code, getCodeDescription(concept));
            branchPoint.addChild(branchNavText, branchItem);
            addChildren(branchItem, lbsvc, lbscm, scheme, csvt, code, codesToDescriptions.keySet(),
                    associationsToNavigate, associationsNavigatedFwd);
            AssociationList nextLevel = concept.getSourceOf();
            if (nextLevel != null) {
                if (nextLevel.getAssociationCount() != 0) {
                    for (int j = 0; j < nextLevel.getAssociationCount(); j++)
                        addPathFromRoot(branchPoint, lbsvc, lbscm, scheme, csvt, nextLevel.getAssociation(j), associationsToNavigate,
                                associationsNavigatedFwd, codesToDescriptions);
                } else {
                    addChildren(branchItem, lbsvc, lbscm, scheme,
                        csvt, concept.getConceptCode(), Collections.EMPTY_SET,
                        associationsToNavigate, associationsNavigatedFwd);
                }
            }
        }
        ti.addChild(branchNavText, branchPoint);
    }
protected void addPathFromRoot ( TreeItem ti , LexBIGService lbsvc , LexBIGServiceConvenienceMethods lbscm , String scheme , CodingSchemeVersionOrTag csvt , Association path , String [ ] associationsToNavigate , boolean associationsNavigatedFwd , Map < String , EntityDescription > codesToDescriptions ) throws LBException { ConceptReference branchRoot = path . getAssociationReference ( ) ; String branchCode = branchRoot . getConceptCode ( ) ; String branchCodeDescription = codesToDescriptions . containsKey ( branchCode ) ? codesToDescriptions . get ( branchCode ) . getContent ( ) : getCodeDescription ( lbsvc , scheme , csvt , branchCode ) ; TreeItem branchPoint = new TreeItem ( branchCode , branchCodeDescription ) ; String branchNavText = getDirectionalLabel ( lbscm , scheme , csvt , path , associationsNavigatedFwd ) ; AssociatedConceptList concepts = path . getAssociatedConcepts ( ) ; for ( int i = 0 ; i < concepts . getAssociatedConceptCount ( ) ; i ++ ) { AssociatedConcept concept = concepts . getAssociatedConcept ( i ) ; String code = concept . getConceptCode ( ) ; TreeItem branchItem = new TreeItem ( code , getCodeDescription ( concept ) ) ; branchPoint . addChild ( branchNavText , branchItem ) ; addChildren ( branchItem , lbsvc , lbscm , scheme , csvt , code , codesToDescriptions . keySet ( ) , associationsToNavigate , associationsNavigatedFwd ) ; AssociationList nextLevel = concept . getSourceOf ( ) ; if ( nextLevel != null ) { if ( nextLevel . getAssociationCount ( ) != 0 ) { for ( int j = 0 ; j < nextLevel . getAssociationCount ( ) ; j ++ ) addPathFromRoot ( branchPoint , lbsvc , lbscm , scheme , csvt , nextLevel . getAssociation ( j ) , associationsToNavigate , associationsNavigatedFwd , codesToDescriptions ) ; } else { addChildren ( branchItem , lbsvc , lbscm , scheme , csvt , concept . getConceptCode ( ) , Collections . EMPTY_SET , associationsToNavigate , associationsNavigatedFwd ) ; } } } ti . addChild ( branchNavText , branchPoint ) ; }
The given path represents a multi-tier association with associated
 concepts and targets.
The given path represents a multi - tier association with associated concepts and targets .
// First, add the branch point from the path ...
 // Now process elements in the branch ...
 // Add all immediate leafs in the branch, and indication of
 // sub-nodes. Do not process codes already in the backbone here;
 // they will be printed in the recursive call ...
 // Recurse to process the remainder of the backbone ...
 // More levels left to process ...
 // End of the line ...
 // Always add immediate children ot the focus code.
 // Add the populated tree item to those tracked from root.
