Search in sources :

Example 76 with AsynchClientTask

use of cbit.vcell.client.task.AsynchClientTask in project vcell by virtualcell.

the class DefineROI_CellROIDescriptor method preNextProcess.

public ArrayList<AsynchClientTask> preNextProcess() {
    // create AsynchClientTask arraylist
    ArrayList<AsynchClientTask> taskArrayList = new ArrayList<AsynchClientTask>();
    final String nextROIStr = FRAPData.VFRAP_ROI_ENUM.ROI_BLEACHED.name();
    AsynchClientTask setCurrentROITask = new AsynchClientTask("", AsynchClientTask.TASKTYPE_SWING_BLOCKING) {

        public void run(Hashtable<String, Object> hashTable) throws Exception {
            // save current ROI and load ROI in the panel it goes next to
            ((DefineROI_Panel) imgPanel).setCurrentROI(nextROIStr, true);
        }
    };
    taskArrayList.add(setCurrentROITask);
    return taskArrayList;
}
Also used : AsynchClientTask(cbit.vcell.client.task.AsynchClientTask) Hashtable(java.util.Hashtable) ArrayList(java.util.ArrayList)

Example 77 with AsynchClientTask

use of cbit.vcell.client.task.AsynchClientTask in project vcell by virtualcell.

the class DefineROI_CellROIDescriptor method preBackProcess.

public ArrayList<AsynchClientTask> preBackProcess() {
    // create AsynchClientTask arraylist
    ArrayList<AsynchClientTask> taskArrayList = new ArrayList<AsynchClientTask>();
    final String backROIStr = FRAPData.VFRAP_ROI_ENUM.ROI_CELL.name();
    AsynchClientTask setCurrentROITask = new AsynchClientTask("", AsynchClientTask.TASKTYPE_SWING_BLOCKING) {

        public void run(Hashtable<String, Object> hashTable) throws Exception {
            // save current ROI and load ROI in the panel it backs to
            ((DefineROI_Panel) imgPanel).setCurrentROI(backROIStr, true);
        }
    };
    taskArrayList.add(setCurrentROITask);
    return taskArrayList;
}
Also used : AsynchClientTask(cbit.vcell.client.task.AsynchClientTask) Hashtable(java.util.Hashtable) ArrayList(java.util.ArrayList)

Example 78 with AsynchClientTask

use of cbit.vcell.client.task.AsynchClientTask in project vcell by virtualcell.

the class WizardController method backButtonPressed.

private void backButtonPressed() {
    ArrayList<AsynchClientTask> totalTasks = new ArrayList<AsynchClientTask>();
    // add pre tasks
    WizardModel model = wizard.getModel();
    WizardPanelDescriptor descriptor = model.getCurrentPanelDescriptor();
    totalTasks.addAll(descriptor.preBackProcess());
    // add display panel task(if next descriptor is not null)
    final String backPanelDescriptorID = descriptor.getBackPanelDescriptorID();
    AsynchClientTask aTask1 = new AsynchClientTask("", AsynchClientTask.TASKTYPE_SWING_BLOCKING) {

        public void run(Hashtable<String, Object> hashTable) throws Exception {
            try {
                if (backPanelDescriptorID != null) {
                    wizard.setCurrentPanel(backPanelDescriptorID);
                }
            } catch (Exception e) {
                e.printStackTrace(System.out);
            }
        }
    };
    totalTasks.add(aTask1);
    // add post tasks
    totalTasks.addAll(descriptor.postBackProcess());
    // dispatch tasks
    dispatchTasks(totalTasks, descriptor);
}
Also used : AsynchClientTask(cbit.vcell.client.task.AsynchClientTask) Hashtable(java.util.Hashtable) ArrayList(java.util.ArrayList)

Example 79 with AsynchClientTask

use of cbit.vcell.client.task.AsynchClientTask in project vcell by virtualcell.

the class WizardController method cancelButtonPressed.

private void cancelButtonPressed() {
    ArrayList<AsynchClientTask> totalTasks = new ArrayList<AsynchClientTask>();
    // add pre tasks
    WizardPanelDescriptor descriptor = wizard.getModel().getCurrentPanelDescriptor();
    totalTasks.addAll(descriptor.preCancelProcess());
    // add close panel task
    AsynchClientTask aTask1 = new AsynchClientTask("", AsynchClientTask.TASKTYPE_SWING_BLOCKING) {

        public void run(Hashtable<String, Object> hashTable) throws Exception {
            try {
                wizard.close(Wizard.CANCEL_RETURN_CODE);
            } catch (Exception e) {
                e.printStackTrace(System.out);
            }
        }
    };
    totalTasks.add(aTask1);
    // add post tasks
    totalTasks.addAll(descriptor.postCancelProcess());
    // dispatch tasks
    dispatchTasks(totalTasks, descriptor);
}
Also used : AsynchClientTask(cbit.vcell.client.task.AsynchClientTask) Hashtable(java.util.Hashtable) ArrayList(java.util.ArrayList)

Example 80 with AsynchClientTask

use of cbit.vcell.client.task.AsynchClientTask in project vcell by virtualcell.

the class WizardController method nextButtonPressed.

private void nextButtonPressed() {
    ArrayList<AsynchClientTask> totalTasks = new ArrayList<AsynchClientTask>();
    // add pre tasks
    WizardModel model = wizard.getModel();
    WizardPanelDescriptor descriptor = model.getCurrentPanelDescriptor();
    totalTasks.addAll(descriptor.preNextProcess());
    // add display panel task(if next button pressed) or close task(if finish button pressed)
    final String nextPanelDescriptorID = descriptor.getNextPanelDescriptorID();
    AsynchClientTask aTask1 = new AsynchClientTask("", AsynchClientTask.TASKTYPE_SWING_BLOCKING) {

        public void run(Hashtable<String, Object> hashTable) throws Exception {
            try {
                if (nextPanelDescriptorID.equals(Wizard.FINISH.getPanelDescriptorIdentifier())) {
                    wizard.close(Wizard.FINISH_RETURN_CODE);
                } else {
                    wizard.setCurrentPanel(nextPanelDescriptorID);
                }
            } catch (Exception e) {
                e.printStackTrace(System.out);
            }
        }
    };
    totalTasks.add(aTask1);
    // add post tasks
    totalTasks.addAll(descriptor.postNextProcess());
    // dispatch tasks
    dispatchTasks(totalTasks, descriptor);
}
Also used : AsynchClientTask(cbit.vcell.client.task.AsynchClientTask) Hashtable(java.util.Hashtable) ArrayList(java.util.ArrayList)

Aggregations

AsynchClientTask (cbit.vcell.client.task.AsynchClientTask)229 Hashtable (java.util.Hashtable)219 ArrayList (java.util.ArrayList)68 UserCancelException (org.vcell.util.UserCancelException)52 File (java.io.File)35 CSGObject (cbit.vcell.geometry.CSGObject)30 Point (java.awt.Point)23 DataAccessException (org.vcell.util.DataAccessException)22 SimulationContext (cbit.vcell.mapping.SimulationContext)21 FRAPStudy (cbit.vcell.microscopy.FRAPStudy)18 PropertyVetoException (java.beans.PropertyVetoException)18 ImageException (cbit.image.ImageException)17 IOException (java.io.IOException)17 GeometryThumbnailImageFactoryAWT (cbit.vcell.geometry.GeometryThumbnailImageFactoryAWT)14 Vector (java.util.Vector)14 DataFormatException (java.util.zip.DataFormatException)14 UtilCancelException (org.vcell.util.UtilCancelException)14 Geometry (cbit.vcell.geometry.Geometry)12 ActionEvent (java.awt.event.ActionEvent)12 BioModel (cbit.vcell.biomodel.BioModel)11