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;
}
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;
}
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");
}
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;
}
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;
}
Aggregations