Search in sources :

Example 1 with LoadFRAPData_MultiFileDescriptor

use of cbit.vcell.microscopy.gui.loaddatawizard.LoadFRAPData_MultiFileDescriptor in project vcell by virtualcell.

the class FRAPStudyPanel method getLoadFRAPDataWizard.

public Wizard getLoadFRAPDataWizard() {
    // summarypanel) to frapdatapanel.
    if (loadFRAPDataWizard == null) {
        loadFRAPDataWizard = new Wizard(JOptionPane.getFrameForComponent(this));
        loadFRAPDataWizard.getDialog().setTitle("Load FRAP Data");
        LoadFRAPData_FileTypeDescriptor fTypeDescriptor = new LoadFRAPData_FileTypeDescriptor();
        // goes next to single file input by default
        fTypeDescriptor.setNextPanelDescriptorID(LoadFRAPData_SingleFileDescriptor.IDENTIFIER);
        loadFRAPDataWizard.registerWizardPanel(LoadFRAPData_FileTypeDescriptor.IDENTIFIER, fTypeDescriptor);
        LoadFRAPData_SingleFileDescriptor singleFileDescriptor = new LoadFRAPData_SingleFileDescriptor();
        loadFRAPDataWizard.registerWizardPanel(LoadFRAPData_SingleFileDescriptor.IDENTIFIER, singleFileDescriptor);
        (singleFileDescriptor).setFrapWorkspace(getFrapWorkspace());
        LoadFRAPData_MultiFileDescriptor multiFileDescriptor = new LoadFRAPData_MultiFileDescriptor();
        loadFRAPDataWizard.registerWizardPanel(LoadFRAPData_MultiFileDescriptor.IDENTIFIER, multiFileDescriptor);
        (multiFileDescriptor).setFrapWorkspace(getFrapWorkspace());
        LoadFRAPData_SummaryDescriptor fSummaryDescriptor = new LoadFRAPData_SummaryDescriptor();
        // goes back to single file input by default
        fSummaryDescriptor.setBackPanelDescriptorID(LoadFRAPData_SingleFileDescriptor.IDENTIFIER);
        loadFRAPDataWizard.registerWizardPanel(LoadFRAPData_SummaryDescriptor.IDENTIFIER, fSummaryDescriptor);
        fSummaryDescriptor.setFrapWorkspace(getFrapWorkspace());
        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 (((JRadioButton) e.getSource()).isSelected()) {
                    fileTypeDescriptor.setNextPanelDescriptorID(LoadFRAPData_SingleFileDescriptor.IDENTIFIER);
                    fileSummaryDescriptor.setBackPanelDescriptorID(LoadFRAPData_SingleFileDescriptor.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 (((JRadioButton) e.getSource()).isSelected()) {
                    fileTypeDescriptor.setNextPanelDescriptorID(LoadFRAPData_MultiFileDescriptor.IDENTIFIER);
                    fileSummaryDescriptor.setBackPanelDescriptorID(LoadFRAPData_MultiFileDescriptor.IDENTIFIER);
                }
            }
        });
        if (getDocumentWindowManager() != null) {
            LoadFRAPData_PostProcessingDataDescriptor postProcessingDataDescriptor = new LoadFRAPData_PostProcessingDataDescriptor();
            loadFRAPDataWizard.registerWizardPanel(LoadFRAPData_PostProcessingDataDescriptor.IDENTIFIER, postProcessingDataDescriptor);
            postProcessingDataDescriptor.setFrapWorkspace(getFrapWorkspace());
            postProcessingDataDescriptor.setDocumentWindowManager(getDocumentWindowManager());
            // 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()).getPostProcessDataButton().setVisible(true);
            ((LoadFRAPData_FileTypePanel) fTypeDescriptor.getPanelComponent()).getPostProcessDataButton().addActionListener(new ActionListener() {

                public void actionPerformed(ActionEvent e) {
                    if (((JRadioButton) e.getSource()).isSelected()) {
                        fileTypeDescriptor.setNextPanelDescriptorID(LoadFRAPData_PostProcessingDataDescriptor.IDENTIFIER);
                        fileSummaryDescriptor.setBackPanelDescriptorID(LoadFRAPData_PostProcessingDataDescriptor.IDENTIFIER);
                    }
                }
            });
        }
    }
    // always start from the first page
    loadFRAPDataWizard.setCurrentPanel(LoadFRAPData_FileTypeDescriptor.IDENTIFIER);
    return loadFRAPDataWizard;
}
Also used : LoadFRAPData_FileTypeDescriptor(cbit.vcell.microscopy.gui.loaddatawizard.LoadFRAPData_FileTypeDescriptor) LoadFRAPData_PostProcessingDataDescriptor(cbit.vcell.microscopy.gui.loaddatawizard.LoadFRAPData_PostProcessingDataDescriptor) ActionListener(java.awt.event.ActionListener) ActionEvent(java.awt.event.ActionEvent) LoadFRAPData_SingleFileDescriptor(cbit.vcell.microscopy.gui.loaddatawizard.LoadFRAPData_SingleFileDescriptor) LoadFRAPData_SummaryDescriptor(cbit.vcell.microscopy.gui.loaddatawizard.LoadFRAPData_SummaryDescriptor) WizardPanelDescriptor(org.vcell.wizard.WizardPanelDescriptor) Wizard(org.vcell.wizard.Wizard) LoadFRAPData_MultiFileDescriptor(cbit.vcell.microscopy.gui.loaddatawizard.LoadFRAPData_MultiFileDescriptor)

Aggregations

LoadFRAPData_FileTypeDescriptor (cbit.vcell.microscopy.gui.loaddatawizard.LoadFRAPData_FileTypeDescriptor)1 LoadFRAPData_MultiFileDescriptor (cbit.vcell.microscopy.gui.loaddatawizard.LoadFRAPData_MultiFileDescriptor)1 LoadFRAPData_PostProcessingDataDescriptor (cbit.vcell.microscopy.gui.loaddatawizard.LoadFRAPData_PostProcessingDataDescriptor)1 LoadFRAPData_SingleFileDescriptor (cbit.vcell.microscopy.gui.loaddatawizard.LoadFRAPData_SingleFileDescriptor)1 LoadFRAPData_SummaryDescriptor (cbit.vcell.microscopy.gui.loaddatawizard.LoadFRAPData_SummaryDescriptor)1 ActionEvent (java.awt.event.ActionEvent)1 ActionListener (java.awt.event.ActionListener)1 Wizard (org.vcell.wizard.Wizard)1 WizardPanelDescriptor (org.vcell.wizard.WizardPanelDescriptor)1