Search in sources :

Example 1 with WizardPanelDescriptor

use of org.vcell.wizard.WizardPanelDescriptor in project vcell by virtualcell.

the class VirtualFrapBatchRunFrame method getChooseModelTypeWizard.

public Wizard getChooseModelTypeWizard() {
    if (modelTypeWizard == null) {
        modelTypeWizard = new Wizard(JOptionPane.getFrameForComponent(this));
        modelTypeWizard.getDialog().setTitle("Choose Model Type");
        WizardPanelDescriptor modelTypesDescriptor = new ModelTypesDescriptor();
        modelTypeWizard.registerWizardPanel(ModelTypesDescriptor.IDENTIFIER, modelTypesDescriptor);
        ((ModelTypesDescriptor) modelTypesDescriptor).setBatchRunWorkspace(batchRunWorkspace);
    }
    // always start from the first page
    modelTypeWizard.setCurrentPanel(ModelTypesDescriptor.IDENTIFIER);
    return modelTypeWizard;
}
Also used : ModelTypesDescriptor(cbit.vcell.microscopy.batchrun.gui.chooseModelWizard.ModelTypesDescriptor) WizardPanelDescriptor(org.vcell.wizard.WizardPanelDescriptor) Wizard(org.vcell.wizard.Wizard)

Example 2 with WizardPanelDescriptor

use of org.vcell.wizard.WizardPanelDescriptor in project vcell by virtualcell.

the class FRAPStudyPanel method getEstimateParametersWizard.

public Wizard getEstimateParametersWizard() {
    FRAPStudy fStudy = getFrapWorkspace().getWorkingFrapStudy();
    if (fStudy == null || fStudy.getSelectedModels().size() == 0) {
        return null;
    } else {
        if (estimateParamWizard == null) {
            estimateParamWizard = new Wizard(JOptionPane.getFrameForComponent(this));
            estimateParamWizard.getDialog().setTitle("Estimate Parameters");
            // initialize the wizard panels
            diffOneDescriptor = new EstParams_OneDiffComponentDescriptor();
            diffOneDescriptor.setFrapWorkspace(getFrapWorkspace());
            diffTwoDescriptor = new EstParams_TwoDiffComponentDescriptor();
            diffTwoDescriptor.setFrapWorkspace(getFrapWorkspace());
            offRateDescriptor = new EstParams_ReactionOffRateDescriptor();
            offRateDescriptor.setFrapWorkspace(getFrapWorkspace());
            compareResultsDescriptor = new EstParams_CompareResultsDescriptor();
            compareResultsDescriptor.setFrapWorkspace(getFrapWorkspace());
        }
        // Dynamicly link the wizard pages according to the selected models.
        // clear all first
        estimateParamWizard.clearAllPanels();
        WizardPanelDescriptor lastDescriptor = null;
        for (int i = 0; i < fStudy.getSelectedModels().size(); i++) {
            int modelType = fStudy.getSelectedModels().get(i).intValue();
            if (modelType == FRAPModel.IDX_MODEL_DIFF_ONE_COMPONENT) {
                estimateParamWizard.registerWizardPanel(EstParams_OneDiffComponentDescriptor.IDENTIFIER, diffOneDescriptor);
                diffOneDescriptor.setBackPanelDescriptorID((lastDescriptor == null) ? null : lastDescriptor.getPanelDescriptorIdentifier());
                if (// not the first wizard page
                lastDescriptor != null) {
                    lastDescriptor.setNextPanelDescriptorID(EstParams_OneDiffComponentDescriptor.IDENTIFIER);
                }
                lastDescriptor = diffOneDescriptor;
            } else if (modelType == FRAPModel.IDX_MODEL_DIFF_TWO_COMPONENTS) {
                estimateParamWizard.registerWizardPanel(EstParams_TwoDiffComponentDescriptor.IDENTIFIER, diffTwoDescriptor);
                diffTwoDescriptor.setBackPanelDescriptorID((lastDescriptor == null) ? null : lastDescriptor.getPanelDescriptorIdentifier());
                if (lastDescriptor != null) {
                    lastDescriptor.setNextPanelDescriptorID(EstParams_TwoDiffComponentDescriptor.IDENTIFIER);
                }
                lastDescriptor = diffTwoDescriptor;
            } else if (modelType == FRAPModel.IDX_MODEL_REACTION_OFF_RATE) {
                estimateParamWizard.registerWizardPanel(EstParams_ReactionOffRateDescriptor.IDENTIFIER, offRateDescriptor);
                offRateDescriptor.setBackPanelDescriptorID((lastDescriptor == null) ? null : lastDescriptor.getPanelDescriptorIdentifier());
                if (lastDescriptor != null) {
                    lastDescriptor.setNextPanelDescriptorID(EstParams_ReactionOffRateDescriptor.IDENTIFIER);
                }
                lastDescriptor = offRateDescriptor;
            }
        }
        // the last one should always be the compare page
        estimateParamWizard.registerWizardPanel(EstParams_CompareResultsDescriptor.IDENTIFIER, compareResultsDescriptor);
        lastDescriptor.setNextPanelDescriptorID(EstParams_CompareResultsDescriptor.IDENTIFIER);
        compareResultsDescriptor.setBackPanelDescriptorID(lastDescriptor.getPanelDescriptorIdentifier());
        // each time when load the wizard, it should start from the first possible page.
        if (fStudy.getModels()[FRAPModel.IDX_MODEL_DIFF_ONE_COMPONENT] != null) {
            estimateParamWizard.setCurrentPanel(EstParams_OneDiffComponentDescriptor.IDENTIFIER);
        } else if (fStudy.getModels()[FRAPModel.IDX_MODEL_DIFF_TWO_COMPONENTS] != null) {
            estimateParamWizard.setCurrentPanel(EstParams_TwoDiffComponentDescriptor.IDENTIFIER);
        } else if (fStudy.getModels()[FRAPModel.IDX_MODEL_REACTION_OFF_RATE] != null) {
            estimateParamWizard.setCurrentPanel(EstParams_ReactionOffRateDescriptor.IDENTIFIER);
        }
        return estimateParamWizard;
    }
}
Also used : EstParams_OneDiffComponentDescriptor(cbit.vcell.microscopy.gui.estparamwizard.EstParams_OneDiffComponentDescriptor) EstParams_ReactionOffRateDescriptor(cbit.vcell.microscopy.gui.estparamwizard.EstParams_ReactionOffRateDescriptor) FRAPStudy(cbit.vcell.microscopy.FRAPStudy) EstParams_TwoDiffComponentDescriptor(cbit.vcell.microscopy.gui.estparamwizard.EstParams_TwoDiffComponentDescriptor) WizardPanelDescriptor(org.vcell.wizard.WizardPanelDescriptor) Wizard(org.vcell.wizard.Wizard) Point(java.awt.Point) EstParams_CompareResultsDescriptor(cbit.vcell.microscopy.gui.estparamwizard.EstParams_CompareResultsDescriptor)

Example 3 with WizardPanelDescriptor

use of org.vcell.wizard.WizardPanelDescriptor 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)

Example 4 with WizardPanelDescriptor

use of org.vcell.wizard.WizardPanelDescriptor 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

Wizard (org.vcell.wizard.Wizard)4 WizardPanelDescriptor (org.vcell.wizard.WizardPanelDescriptor)4 ActionEvent (java.awt.event.ActionEvent)2 ActionListener (java.awt.event.ActionListener)2 FRAPStudy (cbit.vcell.microscopy.FRAPStudy)1 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 ModelTypesDescriptor (cbit.vcell.microscopy.batchrun.gui.chooseModelWizard.ModelTypesDescriptor)1 EstParams_CompareResultsDescriptor (cbit.vcell.microscopy.gui.estparamwizard.EstParams_CompareResultsDescriptor)1 EstParams_OneDiffComponentDescriptor (cbit.vcell.microscopy.gui.estparamwizard.EstParams_OneDiffComponentDescriptor)1