use of javax.swing.tree.TreeSelectionModel in project vcell by virtualcell.
the class ImageDbTreePanel method treeSelection.
/**
* Comment
*/
private void treeSelection() {
TreeSelectionModel treeSelectionModel = getselectionModel1();
TreePath treePath = treeSelectionModel.getSelectionPath();
if (treePath == null) {
setSelectedVersionInfo(null);
return;
}
BioModelNode bioModelNode = (BioModelNode) treePath.getLastPathComponent();
Object object = bioModelNode.getUserObject();
if (object instanceof VersionInfo) {
setSelectedVersionInfo((VersionInfo) object);
//
// if selected parent of VCImageInfo, setSelection as it's SimulationInfo
//
} else if (object instanceof String && bioModelNode.getChildCount() > 0 && ((BioModelNode) bioModelNode.getChildAt(0)).getUserObject() instanceof VCImageInfo) {
VCImageInfo imgInfo = (VCImageInfo) ((BioModelNode) bioModelNode.getChildAt(0)).getUserObject();
setSelectedVersionInfo(imgInfo);
} else {
setSelectedVersionInfo(null);
}
}
use of javax.swing.tree.TreeSelectionModel 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;
}
use of javax.swing.tree.TreeSelectionModel in project vcell by virtualcell.
the class TestingFrameworkPanel method getTestSuiteInfoOfSelectedTestCase.
public TestSuiteInfoNew getTestSuiteInfoOfSelectedTestCase() {
TreeSelectionModel treeSelectionModel = getselectionModel();
TreePath treePath = treeSelectionModel.getSelectionPath();
return getTestSuiteInfoOfTreePath(treePath);
}
Aggregations