Search in sources :

Example 1 with DisplayBNGOutput

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();
            }
        }
    });
}
Also used : AsynchClientTask(cbit.vcell.client.task.AsynchClientTask) ProgressDialogListener(org.vcell.util.ProgressDialogListener) Hashtable(java.util.Hashtable) DisplayBNGOutput(cbit.vcell.client.task.DisplayBNGOutput) EventObject(java.util.EventObject) BNGExecutorService(cbit.vcell.server.bionetgen.BNGExecutorService) RunBioNetGen(cbit.vcell.client.task.RunBioNetGen) EventObject(java.util.EventObject) IOException(java.io.IOException) UserCancelException(org.vcell.util.UserCancelException)

Aggregations

AsynchClientTask (cbit.vcell.client.task.AsynchClientTask)1 DisplayBNGOutput (cbit.vcell.client.task.DisplayBNGOutput)1 RunBioNetGen (cbit.vcell.client.task.RunBioNetGen)1 BNGExecutorService (cbit.vcell.server.bionetgen.BNGExecutorService)1 IOException (java.io.IOException)1 EventObject (java.util.EventObject)1 Hashtable (java.util.Hashtable)1 ProgressDialogListener (org.vcell.util.ProgressDialogListener)1 UserCancelException (org.vcell.util.UserCancelException)1