Search in sources :

Example 1 with ExecutableFinderDialog

use of org.vcell.util.gui.ExecutableFinderDialog in project vcell by virtualcell.

the class DocumentWindow method startVCellVisIt.

private void startVCellVisIt() {
    AsynchClientTask findVisitTask = new AsynchClientTask("Searching for VisIt...", AsynchClientTask.TASKTYPE_NONSWING_BLOCKING) {

        @Override
        public void run(Hashtable<String, Object> hashTable) throws Exception {
            try {
                VisitSupport.launchVisTool(VCellConfiguration.getFileProperty(PropertyLoader.visitExe));
            } catch (Exception e) {
                e.printStackTrace();
                OperatingSystemInfo osi = OperatingSystemInfo.getInstance();
                String executableName = ResourceUtil.getExecutableName(VisitSupport.VISIT_EXEC_NAME, false, osi);
                File executableLocation = new ExecutableFinderDialog(DocumentWindow.this, "If VisIt is installed (from " + "https://wci.llnl.gov/codes/visit/" + ") but not in the system path, then press press '" + ExecutableFinderDialog.FIND + "' and navigate to '" + executableName + "'.\nElse please install VisIt, restart VCell, and try again").find(executableName);
                VisitSupport.launchVisTool(executableLocation);
            }
        }
    };
    ProgressDialogListener progressDialogListener = new ProgressDialogListener() {

        @Override
        public void cancelButton_actionPerformed(EventObject newEvent) {
            System.out.println(newEvent);
        }
    };
    // ClientTaskDispatcher.dispatch(requester,           hash,              tasks,                                  customDialog, bShowProgressPopup, bKnowProgress, cancelable, progressDialogListener, bInputBlocking);
    ClientTaskDispatcher.dispatch(DocumentWindow.this, new Hashtable<>(), new AsynchClientTask[] { findVisitTask }, null, true, false, true, progressDialogListener, false);
}
Also used : AsynchClientTask(cbit.vcell.client.task.AsynchClientTask) ProgressDialogListener(org.vcell.util.ProgressDialogListener) ExecutableFinderDialog(org.vcell.util.gui.ExecutableFinderDialog) Hashtable(java.util.Hashtable) OperatingSystemInfo(cbit.vcell.resource.OperatingSystemInfo) File(java.io.File) UtilCancelException(org.vcell.util.UtilCancelException) EventObject(java.util.EventObject)

Aggregations

AsynchClientTask (cbit.vcell.client.task.AsynchClientTask)1 OperatingSystemInfo (cbit.vcell.resource.OperatingSystemInfo)1 File (java.io.File)1 EventObject (java.util.EventObject)1 Hashtable (java.util.Hashtable)1 ProgressDialogListener (org.vcell.util.ProgressDialogListener)1 UtilCancelException (org.vcell.util.UtilCancelException)1 ExecutableFinderDialog (org.vcell.util.gui.ExecutableFinderDialog)1