Search in sources :

Example 6 with MathType

use of org.vcell.util.document.BioModelChildSummary.MathType in project vcell by virtualcell.

the class BioModelTreeModel method addBioModelContents.

/**
 * Insert the method's description here.
 * Creation date: (11/28/00 2:41:43 PM)
 * @param bioModelNode cbit.vcell.desktop.BioModelNode
 * @param bioModelInfo cbit.vcell.biomodel.BioModelInfo
 */
private void addBioModelContents(BioModelNode bioModelNode, BioModel bioModel) {
    // 
    if (bioModel == null) {
        return;
    }
    // bioModelNode.add(new BioModelNode(bioModel.getModel(),false));
    // if (bioModel.getDescription() != null && !bioModel.getDescription().equals("")){
    bioModelNode.add(new BioModelNode(new Annotation(bioModel.getVCMetaData().getFreeTextAnnotation(bioModel)), false));
    // }
    Set<MiriamRefGroup> isDescribedByAnnotation = bioModel.getVCMetaData().getMiriamManager().getMiriamRefGroups(bioModel, MIRIAMQualifier.MODEL_isDescribedBy);
    for (MiriamRefGroup refGroup : isDescribedByAnnotation) {
        for (MiriamResource miriamResources : refGroup.getMiriamRefs()) {
            bioModelNode.add(new MiriamTreeModel.LinkNode(MIRIAMQualifier.MODEL_isDescribedBy, miriamResources));
        }
    }
    Set<MiriamRefGroup> isAnnotation = bioModel.getVCMetaData().getMiriamManager().getMiriamRefGroups(bioModel, MIRIAMQualifier.MODEL_is);
    for (MiriamRefGroup refGroup : isAnnotation) {
        for (MiriamResource miriamResources : refGroup.getMiriamRefs()) {
            bioModelNode.add(new MiriamTreeModel.LinkNode(MIRIAMQualifier.MODEL_is, miriamResources));
        }
    }
    SimulationContext[] scArray = bioModel.getSimulationContexts();
    if (scArray != null) {
        for (int i = 0; i < scArray.length; i++) {
            BioModelNode scNode = new BioModelNode(scArray[i], true);
            bioModelNode.add(scNode);
            // scNode.add(new BioModelNode(scArray[i].getModel(),false));
            // add application type node
            MathType typeInfo = scArray[i].getMathType();
            BioModelNode appTypeNode = new BioModelNode(typeInfo, false);
            appTypeNode.setRenderHint("type", "AppType");
            scNode.add(appTypeNode);
            // 
            // Display Annotation on tree
            // 
            scNode.add(new BioModelNode(new Annotation(scArray[i].getDescription()), false));
            scNode.add(new BioModelNode(scArray[i].getGeometry(), false));
            if (scArray[i].getMathDescription() != null) {
                scNode.add(new BioModelNode(scArray[i].getMathDescription(), false));
            } else {
                scNode.add(new BioModelNode("math not generated", false));
            }
            // 
            // add simulations to simulationContext
            // 
            Simulation[] simArray = bioModel.getSimulations();
            if (simArray != null) {
                for (int j = 0; j < simArray.length; j++) {
                    if (simArray[j].getMathDescription() == scArray[i].getMathDescription()) {
                        BioModelNode simNode = new BioModelNode(simArray[j], true);
                        scNode.add(simNode);
                        // 
                        // add simulation children (simulation annotations)
                        // 
                        // if (simArray[j].getDescription() != null && simArray[j].getDescription().length() > 0){
                        simNode.add(new BioModelNode(new Annotation(simArray[j].getDescription()), false));
                    // }
                    // simNode.add(new BioModelNode(simArray[i].getMathDescription(),false));
                    // simNode.add(new BioModelNode(simArray[i].getMathOverrides(),false));
                    // simNode.add(new BioModelNode(simArray[i].getMeshSpecification(),false));
                    // simNode.add(new BioModelNode(simArray[i].getSolverTaskDescription(),false));
                    }
                }
            }
        }
    }
}
Also used : MathType(org.vcell.util.document.BioModelChildSummary.MathType) SimulationContext(cbit.vcell.mapping.SimulationContext) MiriamResource(cbit.vcell.biomodel.meta.MiriamManager.MiriamResource) Simulation(cbit.vcell.solver.Simulation) MiriamRefGroup(cbit.vcell.biomodel.meta.MiriamManager.MiriamRefGroup) MiriamTreeModel(cbit.vcell.xml.gui.MiriamTreeModel)

Aggregations

MathType (org.vcell.util.document.BioModelChildSummary.MathType)6 Simulation (cbit.vcell.solver.Simulation)4 SimulationContext (cbit.vcell.mapping.SimulationContext)2 MathModelChildSummary (org.vcell.util.document.MathModelChildSummary)2 BioModel (cbit.vcell.biomodel.BioModel)1 MiriamRefGroup (cbit.vcell.biomodel.meta.MiriamManager.MiriamRefGroup)1 MiriamResource (cbit.vcell.biomodel.meta.MiriamManager.MiriamResource)1 Annotation (cbit.vcell.desktop.Annotation)1 BioModelNode (cbit.vcell.desktop.BioModelNode)1 Geometry (cbit.vcell.geometry.Geometry)1 MathDescription (cbit.vcell.math.MathDescription)1 MiriamTreeModel (cbit.vcell.xml.gui.MiriamTreeModel)1 Point (java.awt.Point)1 ActionEvent (java.awt.event.ActionEvent)1 DefaultMutableTreeNode (javax.swing.tree.DefaultMutableTreeNode)1 BioModelChildSummary (org.vcell.util.document.BioModelChildSummary)1