Search in sources :

Example 11 with VCDocumentInfoNode

use of cbit.vcell.desktop.VCellBasicCellRenderer.VCDocumentInfoNode in project vcell by virtualcell.

the class GeometryDbTreeModel method createOwnerSubTree.

/**
 * Insert the method's description here.
 * Creation date: (11/28/00 1:06:51 PM)
 * @return cbit.vcell.desktop.BioModelNode
 * @param docManager cbit.vcell.clientdb.DocumentManager
 */
public BioModelNode createOwnerSubTree(User owner, GeometryInfo[] geometryInfos) throws DataAccessException {
    // 
    // for each user
    // 
    BioModelNode rootNode = new BioModelNode(owner, true);
    for (int i = 0; i < geometryInfos.length; i++) {
        GeometryInfo geometryInfo = geometryInfos[i];
        if (geometryInfo.getVersion().getOwner().equals(owner) && geometryInfo.getDimension() > 0) {
            if (!meetSearchCriteria(geometryInfo)) {
                continue;
            }
            BioModelNode bioModelNode = new BioModelNode(new VCDocumentInfoNode(geometryInfo), true);
            rootNode.add(bioModelNode);
            // 
            // get list of geometries with the same branch
            // 
            Vector<GeometryInfo> geometryBranchList = new Vector<GeometryInfo>();
            geometryBranchList.addElement(geometryInfo);
            for (i = i + 1; i < geometryInfos.length; i++) {
                if (geometryInfos[i].getVersion().getBranchID().equals(geometryInfo.getVersion().getBranchID()) && geometryInfos[i].getDimension() > 0) {
                    if (!meetSearchCriteria(geometryInfos[i])) {
                        continue;
                    }
                    geometryBranchList.add(0, geometryInfos[i]);
                } else {
                    i--;
                    break;
                }
            }
            GeometryInfo[] geometryInfosInBranch = null;
            if (getLatestOnly()) {
                geometryInfosInBranch = new GeometryInfo[1];
                geometryInfosInBranch[0] = (GeometryInfo) geometryBranchList.elementAt(0);
            } else {
                geometryInfosInBranch = new GeometryInfo[geometryBranchList.size()];
                geometryBranchList.copyInto(geometryInfosInBranch);
            }
            for (int versionCount = 0; versionCount < geometryInfosInBranch.length; versionCount++) {
                bioModelNode.add(createVersionSubTree(geometryInfosInBranch[versionCount]));
            }
        }
    }
    return rootNode;
}
Also used : GeometryInfo(cbit.vcell.geometry.GeometryInfo) VCDocumentInfoNode(cbit.vcell.desktop.VCellBasicCellRenderer.VCDocumentInfoNode) Vector(java.util.Vector)

Aggregations

VCDocumentInfoNode (cbit.vcell.desktop.VCellBasicCellRenderer.VCDocumentInfoNode)11 TreePath (javax.swing.tree.TreePath)4 GeometryInfo (cbit.vcell.geometry.GeometryInfo)3 Vector (java.util.Vector)3 DataAccessException (org.vcell.util.DataAccessException)3 BioModelInfo (org.vcell.util.document.BioModelInfo)3 MathModelInfo (org.vcell.util.document.MathModelInfo)3 User (org.vcell.util.document.User)3 VersionInfo (org.vcell.util.document.VersionInfo)2 BioModelMetaData (cbit.vcell.biomodel.BioModelMetaData)1 BigDecimal (java.math.BigDecimal)1 Version (org.vcell.util.document.Version)1