Search in sources :

Example 71 with BioModelNode

use of cbit.vcell.desktop.BioModelNode in project vcell by virtualcell.

the class MolecularTypeTreeModel method findObjectPath.

public TreePath findObjectPath(BioModelNode startNode, Object object) {
    if (startNode == null) {
        startNode = rootNode;
    }
    Object userObject = startNode.getUserObject();
    if (userObject == object) {
        return new TreePath(startNode.getPath());
    }
    for (int i = 0; i < startNode.getChildCount(); i++) {
        BioModelNode childNode = (BioModelNode) startNode.getChildAt(i);
        TreePath path = findObjectPath(childNode, object);
        if (path != null) {
            return path;
        }
    }
    return null;
}
Also used : TreePath(javax.swing.tree.TreePath) BioModelNode(cbit.vcell.desktop.BioModelNode)

Example 72 with BioModelNode

use of cbit.vcell.desktop.BioModelNode in project vcell by virtualcell.

the class ObservableTreeModel method findObjectPath.

public TreePath findObjectPath(BioModelNode startNode, Object object) {
    if (startNode == null) {
        startNode = rootNode;
    }
    Object userObject = startNode.getUserObject();
    if (userObject == object) {
        return new TreePath(startNode.getPath());
    }
    for (int i = 0; i < startNode.getChildCount(); i++) {
        BioModelNode childNode = (BioModelNode) startNode.getChildAt(i);
        TreePath path = findObjectPath(childNode, object);
        if (path != null) {
            return path;
        }
    }
    return null;
}
Also used : TreePath(javax.swing.tree.TreePath) BioModelNode(cbit.vcell.desktop.BioModelNode)

Example 73 with BioModelNode

use of cbit.vcell.desktop.BioModelNode in project vcell by virtualcell.

the class ObservableTreeModel method populateTree.

public void populateTree() {
    if (observable == null || bioModel == null) {
        return;
    }
    rootNode.setUserObject(observable);
    rootNode.removeAllChildren();
    int count = 0;
    for (SpeciesPattern sp : observable.getSpeciesPatternList()) {
        BioModelNode spNode = new BioModelNode(new SpeciesPatternLocal(sp, ++count));
        for (MolecularTypePattern mtp : sp.getMolecularTypePatterns()) {
            BioModelNode node = createMolecularTypePatternNode(mtp);
            spNode.add(node);
        }
        rootNode.add(spNode);
    }
    nodeStructureChanged(rootNode);
    // GuiUtils.treeExpandAll(ownerTree, rootNode, true);
    GuiUtils.treeExpandAllRows(ownerTree);
    observable.firePropertyChange("entityChange", null, "bbb");
}
Also used : BioModelNode(cbit.vcell.desktop.BioModelNode) MolecularTypePattern(org.vcell.model.rbm.MolecularTypePattern) SpeciesPattern(org.vcell.model.rbm.SpeciesPattern)

Example 74 with BioModelNode

use of cbit.vcell.desktop.BioModelNode in project vcell by virtualcell.

the class ObservableTreeModel method createMolecularTypePatternNode.

private BioModelNode createMolecularTypePatternNode(MolecularTypePattern molecularTypePattern) {
    MolecularType molecularType = molecularTypePattern.getMolecularType();
    BioModelNode node = new BioModelNode(molecularTypePattern, true);
    for (MolecularComponent mc : molecularType.getComponentList()) {
        if (bShowDetails || molecularTypePattern.getMolecularComponentPattern(mc).isbVisible()) {
            BioModelNode n = createMolecularComponentPatternNode(molecularTypePattern.getMolecularComponentPattern(mc));
            if (n != null) {
                node.add(n);
            }
        }
    }
    return node;
}
Also used : MolecularType(org.vcell.model.rbm.MolecularType) MolecularComponent(org.vcell.model.rbm.MolecularComponent) BioModelNode(cbit.vcell.desktop.BioModelNode)

Example 75 with BioModelNode

use of cbit.vcell.desktop.BioModelNode in project vcell by virtualcell.

the class TestingFrameworkPanel method getTestCaseOfSelectedCriteria.

/**
 * Comment
 */
public TestCaseNew getTestCaseOfSelectedCriteria() {
    TreeSelectionModel treeSelectionModel = getselectionModel();
    TreePath treePath = treeSelectionModel.getSelectionPath();
    if (treePath == null) {
        return null;
    }
    BioModelNode selectedNode = (BioModelNode) treePath.getLastPathComponent();
    if (selectedNode.getUserObject() instanceof TestCriteriaNew) {
        TreePath parentPath = treePath.getParentPath();
        BioModelNode parentNode = (BioModelNode) parentPath.getLastPathComponent();
        if (parentNode.getUserObject() instanceof TestCaseNew) {
            return (TestCaseNew) parentNode.getUserObject();
        }
    }
    return null;
}
Also used : TreePath(javax.swing.tree.TreePath) TestCriteriaNew(cbit.vcell.numericstest.TestCriteriaNew) BioModelNode(cbit.vcell.desktop.BioModelNode) TestCaseNew(cbit.vcell.numericstest.TestCaseNew) TreeSelectionModel(javax.swing.tree.TreeSelectionModel)

Aggregations

BioModelNode (cbit.vcell.desktop.BioModelNode)82 TreePath (javax.swing.tree.TreePath)22 MolecularComponent (org.vcell.model.rbm.MolecularComponent)17 CSGObject (cbit.vcell.geometry.CSGObject)12 MolecularTypePattern (org.vcell.model.rbm.MolecularTypePattern)11 SimulationContext (cbit.vcell.mapping.SimulationContext)10 MolecularType (org.vcell.model.rbm.MolecularType)10 Point (java.awt.Point)9 Icon (javax.swing.Icon)8 ComponentStateDefinition (org.vcell.model.rbm.ComponentStateDefinition)8 TestSuiteInfoNew (cbit.vcell.numericstest.TestSuiteInfoNew)7 TreeNode (javax.swing.tree.TreeNode)7 DocumentEditorTreeFolderClass (cbit.vcell.client.desktop.biomodel.DocumentEditorTreeModel.DocumentEditorTreeFolderClass)6 DocumentEditorTreeFolderNode (cbit.vcell.client.desktop.biomodel.DocumentEditorTreeModel.DocumentEditorTreeFolderNode)6 TestCaseNew (cbit.vcell.numericstest.TestCaseNew)6 TestCriteriaNew (cbit.vcell.numericstest.TestCriteriaNew)6 MolecularComponentPattern (org.vcell.model.rbm.MolecularComponentPattern)6 BioPaxObject (org.vcell.pathway.BioPaxObject)6 AsynchClientTask (cbit.vcell.client.task.AsynchClientTask)5 Component (java.awt.Component)5