Search in sources :

Example 1 with DocumentCreationInfo

use of org.vcell.util.document.VCDocument.DocumentCreationInfo in project vcell by virtualcell.

the class DatabaseWindowManager method createNewGeometry.

public void createNewGeometry() {
    AsynchClientTask editSelectTask = new AsynchClientTask("Edit/Apply Geometry", AsynchClientTask.TASKTYPE_SWING_BLOCKING) {

        @Override
        public void run(Hashtable<String, Object> hashTable) throws Exception {
            Geometry newGeom = (Geometry) hashTable.get("doc");
            if (newGeom == null) {
                throw new Exception("No Geometry found in edit task");
            }
            DocumentCreationInfo documentCreationInfo = new DocumentCreationInfo(VCDocumentType.GEOMETRY_DOC, -1);
            documentCreationInfo.setPreCreatedDocument(newGeom);
            AsynchClientTask[] newGeometryTaskArr = getRequestManager().newDocument(DatabaseWindowManager.this, documentCreationInfo);
            ClientTaskDispatcher.dispatch(DatabaseWindowManager.this.getComponent(), hashTable, newGeometryTaskArr);
        }
    };
    createGeometry(null, new AsynchClientTask[] { editSelectTask }, TopLevelWindowManager.DEFAULT_CREATEGEOM_SELECT_DIALOG_TITLE, "Create Geometry", null);
}
Also used : Geometry(cbit.vcell.geometry.Geometry) AsynchClientTask(cbit.vcell.client.task.AsynchClientTask) Hashtable(java.util.Hashtable) DocumentCreationInfo(org.vcell.util.document.VCDocument.DocumentCreationInfo) ObjectNotFoundException(org.vcell.util.ObjectNotFoundException) DataAccessException(org.vcell.util.DataAccessException) UserCancelException(org.vcell.util.UserCancelException)

Aggregations

AsynchClientTask (cbit.vcell.client.task.AsynchClientTask)1 Geometry (cbit.vcell.geometry.Geometry)1 Hashtable (java.util.Hashtable)1 DataAccessException (org.vcell.util.DataAccessException)1 ObjectNotFoundException (org.vcell.util.ObjectNotFoundException)1 UserCancelException (org.vcell.util.UserCancelException)1 DocumentCreationInfo (org.vcell.util.document.VCDocument.DocumentCreationInfo)1