Search in sources :

Example 1 with FileSummaryDescriptor

use of cbit.vcell.microscopy.batchrun.gui.addFRAPdocWizard.FileSummaryDescriptor 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;
}
Also used : BatchRunROIImgPanel(cbit.vcell.microscopy.batchrun.gui.addFRAPdocWizard.BatchRunROIImgPanel) CellROIDescriptor(cbit.vcell.microscopy.batchrun.gui.addFRAPdocWizard.CellROIDescriptor) BleachedROIDescriptor(cbit.vcell.microscopy.batchrun.gui.addFRAPdocWizard.BleachedROIDescriptor) JRadioButton(javax.swing.JRadioButton) FileSaveDescriptor(cbit.vcell.microscopy.batchrun.gui.addFRAPdocWizard.FileSaveDescriptor) ROISummaryDescriptor(cbit.vcell.microscopy.batchrun.gui.addFRAPdocWizard.ROISummaryDescriptor) ActionEvent(java.awt.event.ActionEvent) WizardPanelDescriptor(org.vcell.wizard.WizardPanelDescriptor) FileTypeDescriptor(cbit.vcell.microscopy.batchrun.gui.addFRAPdocWizard.FileTypeDescriptor) CropDescriptor(cbit.vcell.microscopy.batchrun.gui.addFRAPdocWizard.CropDescriptor) SingleFileDescriptor(cbit.vcell.microscopy.batchrun.gui.addFRAPdocWizard.SingleFileDescriptor) ActionListener(java.awt.event.ActionListener) FileSummaryDescriptor(cbit.vcell.microscopy.batchrun.gui.addFRAPdocWizard.FileSummaryDescriptor) BackgroundROIDescriptor(cbit.vcell.microscopy.batchrun.gui.addFRAPdocWizard.BackgroundROIDescriptor) MultiFileDescriptor(cbit.vcell.microscopy.batchrun.gui.addFRAPdocWizard.MultiFileDescriptor) RoiForErrorDescriptor(cbit.vcell.microscopy.batchrun.gui.addFRAPdocWizard.RoiForErrorDescriptor) Wizard(org.vcell.wizard.Wizard)

Aggregations

BackgroundROIDescriptor (cbit.vcell.microscopy.batchrun.gui.addFRAPdocWizard.BackgroundROIDescriptor)1 BatchRunROIImgPanel (cbit.vcell.microscopy.batchrun.gui.addFRAPdocWizard.BatchRunROIImgPanel)1 BleachedROIDescriptor (cbit.vcell.microscopy.batchrun.gui.addFRAPdocWizard.BleachedROIDescriptor)1 CellROIDescriptor (cbit.vcell.microscopy.batchrun.gui.addFRAPdocWizard.CellROIDescriptor)1 CropDescriptor (cbit.vcell.microscopy.batchrun.gui.addFRAPdocWizard.CropDescriptor)1 FileSaveDescriptor (cbit.vcell.microscopy.batchrun.gui.addFRAPdocWizard.FileSaveDescriptor)1 FileSummaryDescriptor (cbit.vcell.microscopy.batchrun.gui.addFRAPdocWizard.FileSummaryDescriptor)1 FileTypeDescriptor (cbit.vcell.microscopy.batchrun.gui.addFRAPdocWizard.FileTypeDescriptor)1 MultiFileDescriptor (cbit.vcell.microscopy.batchrun.gui.addFRAPdocWizard.MultiFileDescriptor)1 ROISummaryDescriptor (cbit.vcell.microscopy.batchrun.gui.addFRAPdocWizard.ROISummaryDescriptor)1 RoiForErrorDescriptor (cbit.vcell.microscopy.batchrun.gui.addFRAPdocWizard.RoiForErrorDescriptor)1 SingleFileDescriptor (cbit.vcell.microscopy.batchrun.gui.addFRAPdocWizard.SingleFileDescriptor)1 ActionEvent (java.awt.event.ActionEvent)1 ActionListener (java.awt.event.ActionListener)1 JRadioButton (javax.swing.JRadioButton)1 Wizard (org.vcell.wizard.Wizard)1 WizardPanelDescriptor (org.vcell.wizard.WizardPanelDescriptor)1