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;
}
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;
}
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);
}
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);
}
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);
}
Aggregations