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