Search in sources :

Example 1 with EstParams_OneDiffComponentDescriptor

use of cbit.vcell.microscopy.gui.estparamwizard.EstParams_OneDiffComponentDescriptor 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)

Aggregations

FRAPStudy (cbit.vcell.microscopy.FRAPStudy)1 EstParams_CompareResultsDescriptor (cbit.vcell.microscopy.gui.estparamwizard.EstParams_CompareResultsDescriptor)1 EstParams_OneDiffComponentDescriptor (cbit.vcell.microscopy.gui.estparamwizard.EstParams_OneDiffComponentDescriptor)1 EstParams_ReactionOffRateDescriptor (cbit.vcell.microscopy.gui.estparamwizard.EstParams_ReactionOffRateDescriptor)1 EstParams_TwoDiffComponentDescriptor (cbit.vcell.microscopy.gui.estparamwizard.EstParams_TwoDiffComponentDescriptor)1 Point (java.awt.Point)1 Wizard (org.vcell.wizard.Wizard)1 WizardPanelDescriptor (org.vcell.wizard.WizardPanelDescriptor)1