use of cbit.vcell.client.task.DisplayBNGOutput in project vcell by virtualcell.
the class BNGWindowManager method runBioNetGen.
/**
* Gets the bngOutputPanel property (cbit.vcell.client.bionetgen.BNGOutputPanel) value.
* @return The bngOutputPanel property value.
*/
public void runBioNetGen(BNGInput bngInput) {
// Create a hash and put in the details required to run the ClientTaskDispatcher
Hashtable<String, Object> hash = new Hashtable<String, Object>();
hash.put(BNG_OUTPUT_PANEL, getBngOutputPanel());
final BNGExecutorService bngService = BNGExecutorService.getInstance(bngInput, NetworkGenerationRequirements.NoTimeoutMS);
// Create the AsynchClientTasks : in this case, running the BioNetGen (non-swing) and then displaying the output (swing) tasks.
AsynchClientTask[] tasksArray = new AsynchClientTask[2];
tasksArray[0] = new RunBioNetGen(bngService);
tasksArray[1] = new DisplayBNGOutput();
// Dispatch the tasks using the ClientTaskDispatcher.
ClientTaskDispatcher.dispatch(getBngOutputPanel(), hash, tasksArray, false, true, new ProgressDialogListener() {
public void cancelButton_actionPerformed(EventObject newEvent) {
try {
bngService.stopBNG();
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
Aggregations