use of cbit.vcell.client.task.ExportDocument in project vcell by virtualcell.
the class ClientRequestManager method exportDocument.
/**
* Comment
*/
public void exportDocument(TopLevelWindowManager manager, FileFilter forceFilefilter) {
/* block window */
JFrame currentWindow = getMdiManager().blockWindow(manager.getManagerID());
/* prepare hashtable for tasks */
Hashtable<String, Object> hash = new Hashtable<String, Object>();
hash.put("mdiManager", getMdiManager());
hash.put(DocumentManager.IDENT, getDocumentManager());
hash.put("topLevelWindowManager", manager);
hash.put("currentWindow", currentWindow);
hash.put("userPreferences", getUserPreferences());
if (forceFilefilter != null) {
hash.put(ChooseFile.FORCE_FILE_FILTER, forceFilefilter);
}
hash.put("CallAction", CallAction.EXPORT);
hash.put(CommonTask.DOCUMENT_WINDOW_MANAGER.name, manager);
hash.put("currentDocumentWindow", currentWindow);
/* create tasks */
AsynchClientTask documentValid = new DocumentValidTask();
AsynchClientTask setMathDescription = new SetMathDescription();
// get document to be exported
AsynchClientTask documentToExport = new DocumentToExport();
// get file
AsynchClientTask chooseFile = new ChooseFile();
// export it
AsynchClientTask exportDocument = new ExportDocument();
// clean-up
AsynchClientTask finishExport = new FinishExport();
// assemble array
AsynchClientTask[] tasks = null;
tasks = new AsynchClientTask[] { documentToExport, chooseFile, documentValid, setMathDescription, exportDocument, finishExport };
/* run tasks */
ClientTaskDispatcher.dispatch(currentWindow, hash, tasks, false);
}
use of cbit.vcell.client.task.ExportDocument in project vcell by virtualcell.
the class GeometryViewer method exportGeometry.
private void exportGeometry() /*String exportType*/
{
Objects.requireNonNull(documentWindowManager);
AsynchClientTask computeSurface = new AsynchClientTask("computing Surface...", AsynchClientTask.TASKTYPE_NONSWING_BLOCKING) {
@Override
public void run(Hashtable<String, Object> hashTable) throws Exception {
if (getGeometry().getGeometrySurfaceDescription() == null || getGeometry().getGeometrySurfaceDescription().getSurfaceCollection() == null) {
getGeometry().getGeometrySurfaceDescription().updateAll();
}
}
};
AsynchClientTask[] tasks = new AsynchClientTask[] { new ChooseFile(), computeSurface, new ExportDocument() };
Hashtable<String, Object> hash = new Hashtable<String, Object>();
hash.put("documentToExport", getGeometry());
hash.put("userPreferences", documentWindowManager.getUserPreferences());
hash.put(CommonTask.DOCUMENT_MANAGER.name, documentWindowManager.getRequestManager().getDocumentManager());
hash.put("component", this);
ClientTaskDispatcher.dispatch(this, hash, tasks, false);
}
Aggregations