use of cbit.vcell.microscopy.batchrun.gui.addFRAPdocWizard.CropDescriptor in project vcell by virtualcell.
the class BatchRunDetailsPanel method getAddFRAPDataWizard.
public Wizard getAddFRAPDataWizard() {
// summarypanel) to frapdatapanel.
if (batchRunAddDataWizard == null) {
batchRunAddDataWizard = new Wizard(JOptionPane.getFrameForComponent(this));
batchRunAddDataWizard.getDialog().setTitle("Load FRAP Data");
WizardPanelDescriptor fTypeDescriptor = new FileTypeDescriptor();
// goes next to single file input by default
fTypeDescriptor.setNextPanelDescriptorID(SingleFileDescriptor.IDENTIFIER);
batchRunAddDataWizard.registerWizardPanel(FileTypeDescriptor.IDENTIFIER, fTypeDescriptor);
WizardPanelDescriptor singleFileDescriptor = new SingleFileDescriptor();
batchRunAddDataWizard.registerWizardPanel(SingleFileDescriptor.IDENTIFIER, singleFileDescriptor);
((SingleFileDescriptor) singleFileDescriptor).setBatchRunWorkspace(getBatchRunWorkspace());
((SingleFileDescriptor) singleFileDescriptor).setLocalWorkspace(getLocalWorkspace());
WizardPanelDescriptor multiFileDescriptor = new MultiFileDescriptor();
batchRunAddDataWizard.registerWizardPanel(MultiFileDescriptor.IDENTIFIER, multiFileDescriptor);
((MultiFileDescriptor) multiFileDescriptor).setBatchRunWorkspace(getBatchRunWorkspace());
FileSummaryDescriptor fSummaryDescriptor = new FileSummaryDescriptor();
// goes back to single file input by default
fSummaryDescriptor.setBackPanelDescriptorID(SingleFileDescriptor.IDENTIFIER);
batchRunAddDataWizard.registerWizardPanel(FileSummaryDescriptor.IDENTIFIER, fSummaryDescriptor);
fSummaryDescriptor.setBatchRunWorkspace(getBatchRunWorkspace());
final WizardPanelDescriptor fileTypeDescriptor = fTypeDescriptor;
final WizardPanelDescriptor fileSummaryDescriptor = fSummaryDescriptor;
// actionListener to single file input radio button
// this radio button affects the wizard series. especially on the next of file type and the back of summary
((LoadFRAPData_FileTypePanel) fTypeDescriptor.getPanelComponent()).getSingleFileButton().addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
if (e.getSource() instanceof JRadioButton) {
if (((JRadioButton) e.getSource()).isSelected()) {
fileTypeDescriptor.setNextPanelDescriptorID(SingleFileDescriptor.IDENTIFIER);
fileSummaryDescriptor.setBackPanelDescriptorID(SingleFileDescriptor.IDENTIFIER);
} else {
fileTypeDescriptor.setNextPanelDescriptorID(MultiFileDescriptor.IDENTIFIER);
fileSummaryDescriptor.setBackPanelDescriptorID(MultiFileDescriptor.IDENTIFIER);
}
}
}
});
// actionListener to multiple file input radio button
// this radio button affects the wizard series. especially on the next of file type and the back of summary
((LoadFRAPData_FileTypePanel) fTypeDescriptor.getPanelComponent()).getMultipleFileButton().addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
if (e.getSource() instanceof JRadioButton) {
if (((JRadioButton) e.getSource()).isSelected()) {
fileTypeDescriptor.setNextPanelDescriptorID(MultiFileDescriptor.IDENTIFIER);
fileSummaryDescriptor.setBackPanelDescriptorID(MultiFileDescriptor.IDENTIFIER);
} else {
fileTypeDescriptor.setNextPanelDescriptorID(SingleFileDescriptor.IDENTIFIER);
fileSummaryDescriptor.setBackPanelDescriptorID(SingleFileDescriptor.IDENTIFIER);
}
}
}
});
}
// use one panel for all the steps through out defining ROIs.
imgPanel = new BatchRunROIImgPanel();
// batch run work space, no data yet.
imgPanel.setBatchRunWorkspace(getBatchRunWorkspace());
CropDescriptor cropDescriptor = new CropDescriptor(imgPanel);
batchRunAddDataWizard.registerWizardPanel(CropDescriptor.IDENTIFIER, cropDescriptor);
cropDescriptor.setBatchRunWorkspace(getBatchRunWorkspace());
CellROIDescriptor cellROIDescriptor = new CellROIDescriptor(imgPanel);
batchRunAddDataWizard.registerWizardPanel(CellROIDescriptor.IDENTIFIER, cellROIDescriptor);
cellROIDescriptor.setBatchRunWorkspace(getBatchRunWorkspace());
BleachedROIDescriptor bleachedROIDescriptor = new BleachedROIDescriptor(imgPanel);
batchRunAddDataWizard.registerWizardPanel(BleachedROIDescriptor.IDENTIFIER, bleachedROIDescriptor);
bleachedROIDescriptor.setBatchRunWorkspace(getBatchRunWorkspace());
BackgroundROIDescriptor backgroundROIDescriptor = new BackgroundROIDescriptor(imgPanel);
batchRunAddDataWizard.registerWizardPanel(BackgroundROIDescriptor.IDENTIFIER, backgroundROIDescriptor);
backgroundROIDescriptor.setBatchRunWorkspace(getBatchRunWorkspace());
ROISummaryDescriptor roiSummaryDescriptor = new ROISummaryDescriptor(imgPanel);
batchRunAddDataWizard.registerWizardPanel(ROISummaryDescriptor.IDENTIFIER, roiSummaryDescriptor);
roiSummaryDescriptor.setBatchRunWorkspace(getBatchRunWorkspace());
WizardPanelDescriptor roiForErrorDescriptor = new RoiForErrorDescriptor();
batchRunAddDataWizard.registerWizardPanel(RoiForErrorDescriptor.IDENTIFIER, roiForErrorDescriptor);
((RoiForErrorDescriptor) roiForErrorDescriptor).setBatchRunWorkspace(batchRunWorkspace);
FileSaveDescriptor fileSaveDescriptor = new FileSaveDescriptor();
batchRunAddDataWizard.registerWizardPanel(FileSaveDescriptor.IDENTIFIER, fileSaveDescriptor);
fileSaveDescriptor.setBatchRunWorkspace(getBatchRunWorkspace());
fileSaveDescriptor.setLocalWorkspace(localWorkspace);
imgPanel.refreshUI();
// always start from the first page
batchRunAddDataWizard.setCurrentPanel(FileTypeDescriptor.IDENTIFIER);
return batchRunAddDataWizard;
}
Aggregations