use of cbit.vcell.client.data.PDEDataViewerPostProcess.PostProcessDataPDEDataContext in project vcell by virtualcell.
the class PDEDataViewer method setPdeDataContext.
public void setPdeDataContext(ClientPDEDataContext pdeDataContext) {
if (pdeDataContext != null && pdeDataContext.getVCDataIdentifier() instanceof ExternalDataIdentifier) {
// getJTabbedPane1().removeTabAt(getJTabbedPane1().indexOfTab(POST_PROCESS_IMAGE_TABNAME));
// getJTabbedPane1().removeTabAt(getJTabbedPane1().indexOfTab(POST_PROCESS_STATS_TABNAME));
getJTabbedPane1().setEnabledAt(getJTabbedPane1().indexOfTab(POST_PROCESS_IMAGE_TABNAME), false);
getJTabbedPane1().setEnabledAt(getJTabbedPane1().indexOfTab(POST_PROCESS_STATS_TABNAME), false);
}
getPDEDataContextPanel1().getdisplayAdapterServicePanel1().enableAutoAllTimes(true && !(pdeDataContext instanceof PostProcessDataPDEDataContext));
PDEDataContext oldValue = fieldPdeDataContext;
String setVarName = null;
Integer setTimePoint = null;
if (oldValue != null) {
setVarName = oldValue.getVariableName();
setTimePoint = getPDEPlotControlPanel1().getTimeSliderValue();
try {
if (pdeDataContext != null) {
pdeDataContext.setVariableNameAndTime(setVarName, pdeDataContext.getTimePoints()[setTimePoint]);
}
} catch (Exception e) {
e.printStackTrace();
setVarName = null;
setTimePoint = null;
}
oldValue.removePropertyChangeListener(ivjEventHandler);
}
fieldPdeDataContext = pdeDataContext;
if (getPdeDataContext() != null && (setVarName == null || setTimePoint == null)) {
setVarName = getPdeDataContext().getVariableNames()[0];
setTimePoint = 0;
try {
pdeDataContext.setVariableNameAndTime(setVarName, pdeDataContext.getTimePoints()[setTimePoint]);
} catch (Exception e2) {
e2.printStackTrace();
DialogUtils.showErrorDialog(this, "Couldn't set time and variable on pdeDataContext");
return;
}
}
if (getPdeDataContext() != null) {
getPdeDataContext().removePropertyChangeListener(ivjEventHandler);
getPdeDataContext().addPropertyChangeListener(ivjEventHandler);
try {
getPDEPlotControlPanel1().removePropertyChangeListener(ivjEventHandler);
try {
getPDEPlotControlPanel1().setup(((ClientPDEDataContext) getPdeDataContext()).getDataManager().getOutputContext().getOutputFunctions(), getPdeDataContext().getDataIdentifiers(), getPdeDataContext().getTimePoints(), setVarName, setTimePoint);
} catch (Exception e) {
e.printStackTrace();
DialogUtils.showErrorDialog(this, "Couldn't setup PDEPlotControlPanel, " + e.getMessage());
return;
}
} finally {
getPDEPlotControlPanel1().addPropertyChangeListener(ivjEventHandler);
}
}
bSkipSurfaceCalc = true;
firePropertyChange(PDEDataContext.PROP_PDE_DATA_CONTEXT, null, pdeDataContext);
bSkipSurfaceCalc = false;
if (ivjJTabbedPane1.getTitleAt(ivjJTabbedPane1.getSelectedIndex()).equals(POST_PROCESS_STATS_TABNAME)) {
dataProcessingResultsPanel.update(getPdeDataContext());
}
postProcessPdeDataViewerPanel.setParentPDEDataContext((ClientPDEDataContext) getPdeDataContext());
if (ivjJTabbedPane1.getTitleAt(ivjJTabbedPane1.getSelectedIndex()).equals(POST_PROCESS_IMAGE_TABNAME)) {
postProcessPdeDataViewerPanel.update();
}
// checkDataIdentifiersAndGeomDomains();
}
Aggregations