Search in sources :

Example 1 with PostProcessDataPDEDataContext

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();
}
Also used : ClientPDEDataContext(cbit.vcell.simdata.ClientPDEDataContext) PDEDataContext(cbit.vcell.simdata.PDEDataContext) PostProcessDataPDEDataContext(cbit.vcell.client.data.PDEDataViewerPostProcess.PostProcessDataPDEDataContext) ExternalDataIdentifier(org.vcell.util.document.ExternalDataIdentifier) PostProcessDataPDEDataContext(cbit.vcell.client.data.PDEDataViewerPostProcess.PostProcessDataPDEDataContext) DataAccessException(org.vcell.util.DataAccessException) PropertyVetoException(java.beans.PropertyVetoException) ImageException(cbit.image.ImageException) UserCancelException(org.vcell.util.UserCancelException)

Aggregations

ImageException (cbit.image.ImageException)1 PostProcessDataPDEDataContext (cbit.vcell.client.data.PDEDataViewerPostProcess.PostProcessDataPDEDataContext)1 ClientPDEDataContext (cbit.vcell.simdata.ClientPDEDataContext)1 PDEDataContext (cbit.vcell.simdata.PDEDataContext)1 PropertyVetoException (java.beans.PropertyVetoException)1 DataAccessException (org.vcell.util.DataAccessException)1 UserCancelException (org.vcell.util.UserCancelException)1 ExternalDataIdentifier (org.vcell.util.document.ExternalDataIdentifier)1