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;
}
}
Aggregations