use of cbit.vcell.numericstest.TestCriteriaNew in project vcell by virtualcell.
the class TestingFrameworkPanel method selectInTreeView.
public void selectInTreeView(final BigDecimal testSuiteKey, final BigDecimal testCaseKey, final BigDecimal testCriteriaKey) {
new Thread(new Runnable() {
public void run() {
long WAIT_TIME_MILLISEC = 20000;
long startTime = System.currentTimeMillis();
boolean UPDATE_IN_PROGRESS = false;
do {
if ((System.currentTimeMillis() - startTime) >= WAIT_TIME_MILLISEC) {
return;
}
final BioModelNode testSuiteRootNode = TestingFrmwkTreeModel.getTestSuiteRoot((DefaultTreeModel) getJTree1().getModel());
for (int i = 0; i < testSuiteRootNode.getChildCount(); i++) {
final int finalI = i;
TestSuiteInfoNew tsInfo = (TestSuiteInfoNew) ((BioModelNode) testSuiteRootNode.getChildAt(i)).getUserObject();
if (tsInfo.getTSKey().equals(testSuiteKey)) {
if (testCaseKey != null) {
if (TestingFrameworkPanel.hasNullChild((BioModelNode) testSuiteRootNode.getChildAt(i))) {
if (UPDATE_IN_PROGRESS) {
break;
}
AsynchClientTask[] tasksArr = new AsynchClientTask[] { new TFUpdateRunningStatus(getTestingFrameworkWindowManager(), tsInfo), new TFRefresh(getTestingFrameworkWindowManager(), tsInfo) };
ClientTaskDispatcher.dispatch(TestingFrameworkPanel.this, new Hashtable<String, Object>(), tasksArr, true);
UPDATE_IN_PROGRESS = true;
break;
}
UPDATE_IN_PROGRESS = false;
for (int j = 0; j < testSuiteRootNode.getChildAt(i).getChildCount(); j++) {
final int finalJ = j;
TestCaseNew tcase = (TestCaseNew) ((BioModelNode) testSuiteRootNode.getChildAt(i).getChildAt(j)).getUserObject();
if (tcase.getTCKey().equals(testCaseKey)) {
if (testCriteriaKey != null) {
for (int k = 0; k < testSuiteRootNode.getChildAt(i).getChildAt(j).getChildCount(); k++) {
final int finalK = k;
TestCriteriaNew tcrit = (TestCriteriaNew) ((BioModelNode) testSuiteRootNode.getChildAt(i).getChildAt(j).getChildAt(k)).getUserObject();
if (tcrit.getTCritKey().equals(testCriteriaKey)) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
TreePath treePath = new TreePath(((DefaultTreeModel) getJTree1().getModel()).getPathToRoot(testSuiteRootNode.getChildAt(finalI).getChildAt(finalJ).getChildAt(finalK)));
getJTree1().setSelectionPath(treePath);
getJTree1().scrollPathToVisible(treePath);
}
});
break;
}
}
;
} else {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
TreePath treePath = new TreePath(((DefaultTreeModel) getJTree1().getModel()).getPathToRoot(testSuiteRootNode.getChildAt(finalI).getChildAt(finalJ)));
getJTree1().setSelectionPath(treePath);
getJTree1().scrollPathToVisible(treePath);
}
});
break;
}
}
}
} else {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
TreePath treePath = new TreePath(((DefaultTreeModel) getJTree1().getModel()).getPathToRoot(testSuiteRootNode.getChildAt(finalI)));
getJTree1().setSelectionPath(treePath);
getJTree1().scrollPathToVisible(treePath);
}
});
break;
}
}
}
} while (UPDATE_IN_PROGRESS);
}
}).start();
}
use of cbit.vcell.numericstest.TestCriteriaNew in project vcell by virtualcell.
the class TFRunSims method run.
/**
* Insert the method's description here.
* Creation date: (11/17/2004 2:08:09 PM)
* @param hashTable java.util.Hashtable
* @param clientWorker cbit.vcell.desktop.controls.ClientWorker
*/
public void run(Hashtable<String, Object> hashTable) {
ClientTaskStatusSupport pp = getClientTaskStatusSupport();
String errors = (String) hashTable.get(TFRefresh.TF_ERRORS);
if (errors == null) {
errors = "";
}
String error = "";
if (tcrit != null) {
error = tfwm.startSimulations(new TestCriteriaNew[] { tcrit }, pp);
} else if (tcn != null) {
error = tfwm.startSimulations(tcn.getTestCriterias(), pp);
} else if (tsin != null) {
error = tfwm.startTestSuiteSimulations(tsin, pp);
}
errors += (error == null ? "" : error);
if (errors != null && errors.length() > 0) {
hashTable.put(TFRefresh.TF_ERRORS, errors);
}
}
use of cbit.vcell.numericstest.TestCriteriaNew in project vcell by virtualcell.
the class EditTestCriteriaPanel method setExistingTestCriteria.
/**
* Sets the existingTestCriteria property (cbit.vcell.numericstest.TestCriteriaNew) value.
* @param existingTestCriteria The new value for the property.
* @see #getExistingTestCriteria
*/
public void setExistingTestCriteria(TestCriteriaNew existingTestCriteria) {
TestCriteriaNew oldValue = fieldExistingTestCriteria;
fieldExistingTestCriteria = existingTestCriteria;
firePropertyChange("existingTestCriteria", oldValue, existingTestCriteria);
}
use of cbit.vcell.numericstest.TestCriteriaNew in project vcell by virtualcell.
the class EditTestCriteriaPanel method setNewTestCriteria.
/**
* Sets the newTestCriteria property (cbit.vcell.numericstest.TestCriteriaNew) value.
* @param newTestCriteria The new value for the property.
* @see #getNewTestCriteria
*/
public void setNewTestCriteria(TestCriteriaNew newTestCriteria) {
TestCriteriaNew oldValue = fieldNewTestCriteria;
fieldNewTestCriteria = newTestCriteria;
firePropertyChange("newTestCriteria", oldValue, newTestCriteria);
}
use of cbit.vcell.numericstest.TestCriteriaNew in project vcell by virtualcell.
the class EditTestCriteriaPanel method applyTestCriteriaInfo.
/**
* Comment
*/
private void applyTestCriteriaInfo() {
TestCriteriaNew newTestCriteria = null;
Double relErr = Double.valueOf(getRelErrTextField().getText());
Double absErr = Double.valueOf(getAbsErrTextField().getText());
if (getSolutionType().equals(TestCaseNew.REGRESSION)) {
// newTestCriteria = new TestCriteriaNew(null, getExistingTestCriteria().getSimInfo(), getReferenceMathModelInfo(), getReferenceSimInfo(), relErr, absErr, null);
if (getExistingTestCriteria() instanceof TestCriteriaNewMathModel) {
newTestCriteria = new TestCriteriaNewMathModel(null, getExistingTestCriteria().getSimInfo(), getReferenceMathModelInfo(), getReferenceSimInfo(), relErr, absErr, null, TestCriteriaNew.TCRIT_STATUS_NEEDSREPORT, null);
} else if (getExistingTestCriteria() instanceof TestCriteriaNewBioModel) {
newTestCriteria = new TestCriteriaNewBioModel(null, getExistingTestCriteria().getSimInfo(), getbioModelInfo(), getappName(), getbmAppSimInfo(), relErr, absErr, null, TestCriteriaNew.TCRIT_STATUS_NEEDSREPORT, null);
}
} else {
// CONSTRUCTED SOLN OR EXACT SOLUTION
if (getExistingTestCriteria() instanceof TestCriteriaNewMathModel) {
newTestCriteria = new TestCriteriaNewMathModel(null, getExistingTestCriteria().getSimInfo(), null, null, relErr, absErr, null, TestCriteriaNew.TCRIT_STATUS_NEEDSREPORT, null);
} else if (getExistingTestCriteria() instanceof TestCriteriaNewBioModel) {
newTestCriteria = new TestCriteriaNewBioModel(null, getExistingTestCriteria().getSimInfo(), null, null, null, relErr, absErr, null, TestCriteriaNew.TCRIT_STATUS_NEEDSREPORT, null);
}
}
setNewTestCriteria(newTestCriteria);
}
Aggregations