Search in sources :

Example 36 with MathModelInfo

use of org.vcell.util.document.MathModelInfo in project vcell by virtualcell.

the class EditTestCriteriaPanel method selectRefMathModel.

/**
 * Comment
 */
private void selectRefMathModel(java.awt.event.ActionEvent actionEvent) {
    MathModelInfo mmInfo = getTestingFrameworkWindowManager().selectMathModelInfo();
    if (mmInfo != null) {
        getRefMathModelLabel().setText("<html>" + mmInfo.getVersion().getName() + "<br>(MathModelKey=" + mmInfo.getVersion().getVersionKey() + ")<br>" + mmInfo.getVersion().getDate() + "</html>");
        setReferenceSimInfo(null);
        getRefSimLabel().setText(null);
        setReferenceMathModelInfo(mmInfo);
    } else {
        PopupGenerator.showErrorDialog(this, "Selected MathModel is null!");
    }
}
Also used : MathModelInfo(org.vcell.util.document.MathModelInfo)

Example 37 with MathModelInfo

use of org.vcell.util.document.MathModelInfo in project vcell by virtualcell.

the class TestCaseAddPanel method setMathModelInfo.

/**
 * Sets the mathModelInfo property (cbit.vcell.mathmodel.MathModelInfo) value.
 * @param mathModelInfo The new value for the property.
 * @see #getMathModelInfo
 */
private void setMathModelInfo(org.vcell.util.document.MathModelInfo mathModelInfo) {
    org.vcell.util.document.MathModelInfo oldValue = fieldMathModelInfo;
    fieldMathModelInfo = mathModelInfo;
    firePropertyChange("mathModelInfo", oldValue, mathModelInfo);
    refreshMathModelAppLabel();
}
Also used : MathModelInfo(org.vcell.util.document.MathModelInfo)

Example 38 with MathModelInfo

use of org.vcell.util.document.MathModelInfo in project vcell by virtualcell.

the class ClientDocumentManager method reloadMathModelInfos.

/**
 * Insert the method's description here.
 * Creation date: (11/14/00 5:33:21 PM)
 * @return cbit.vcell.biomodel.BioModelInfo[]
 */
private void reloadMathModelInfos() throws DataAccessException {
    try {
        System.out.println("ClientDocumentManager.reloadMathModelInfos()");
        MathModelInfo[] mathModelInfos = sessionManager.getUserMetaDbServer().getMathModelInfos(true);
        if (mathModelInfos != null) {
            mathModelInfoHash.clear();
            for (int i = 0; i < mathModelInfos.length; i++) {
                mathModelInfoHash.put(mathModelInfos[i].getVersion().getVersionKey(), mathModelInfos[i]);
            }
        }
    } catch (RemoteProxyException e) {
        handleRemoteProxyException(e);
        throw new DataAccessException("RemoteProxyException: " + e.getMessage());
    }
}
Also used : MathModelInfo(org.vcell.util.document.MathModelInfo) DataAccessException(org.vcell.util.DataAccessException) RemoteProxyException(cbit.vcell.message.server.bootstrap.client.RemoteProxyVCellConnectionFactory.RemoteProxyException)

Example 39 with MathModelInfo

use of org.vcell.util.document.MathModelInfo in project vcell by virtualcell.

the class ClientDocumentManager method isChanged.

/**
 * Insert the method's description here.
 * Creation date: (10/28/00 12:08:30 AM)
 */
public boolean isChanged(MathModel mathModel, String mathModelXML) throws DataAccessException {
    if (mathModel.getVersion() == null) {
        // 
        return true;
    } else {
        // 
        if (!mathModel.getVersion().getName().equals(mathModel.getName())) {
            return true;
        }
        // 
        if (!mathModel.getVersion().getAnnot().equals(mathModel.getDescription())) {
            return true;
        }
        // 
        // check for same number of simulations as saved version
        // 
        MathModelInfo savedMathModelInfo = getMathModelInfo(mathModel.getVersion().getVersionKey());
        if (savedMathModelInfo == null) {
            // 
            // if savedMathModelInfo is null, then the record was deleted
            // while it was loaded in client (changed is true)
            // 
            System.out.println("MathModel(" + mathModel.getVersion().getVersionKey() + ") must have been deleted, therefore isChanged() is true");
            return true;
        }
        // MathModelMetaData savedMathModelMetaData = getMathModelMetaData(savedMathModelInfo);
        // if (savedMathModelMetaData.getNumSimulations() != mathModel.getNumSimulations()){
        // return true;
        // }
        // 
        // compare saved and this bioModel
        // 
        XMLHolder<MathModel> savedMathModelXML = getMathModelXML(mathModel.getVersion().getVersionKey());
        if (savedMathModelXML == null) {
            // must have been deleted
            return true;
        }
        try {
            if (mathModelXML == null) {
                mathModelXML = XmlHelper.mathModelToXML(mathModel);
            }
            return !VCMLComparator.compareEquals(savedMathModelXML.getXmlString(), mathModelXML, true);
        } catch (XmlParseException e) {
            e.printStackTrace(System.out);
            throw new DataAccessException(e.getMessage());
        }
    }
}
Also used : MathModel(cbit.vcell.mathmodel.MathModel) MathModelInfo(org.vcell.util.document.MathModelInfo) XmlParseException(cbit.vcell.xml.XmlParseException) DataAccessException(org.vcell.util.DataAccessException)

Example 40 with MathModelInfo

use of org.vcell.util.document.MathModelInfo in project vcell by virtualcell.

the class ClientDocumentManager method addUserToGroup.

/**
 * Insert the method's description here.
 * Creation date: (11/28/00 5:43:44 PM)
 * @param bioModelInfo cbit.vcell.biomodel.BioModelInfo
 */
public MathModelInfo addUserToGroup(MathModelInfo mathModelInfo, String userToAdd) throws DataAccessException {
    try {
        // 
        // publish from database
        // 
        MathModelInfo newMathModelInfo = (MathModelInfo) addUserToGroup0(mathModelInfo, VersionableType.MathModelMetaData, mathModelInfoHash, userToAdd);
        // 
        // delete MathModelMetaData from cache
        // 
        xmlHash.remove(mathModelInfo.getVersion().getVersionKey());
        fireDatabaseUpdate(new DatabaseEvent(this, DatabaseEvent.UPDATE, mathModelInfo, newMathModelInfo));
        return newMathModelInfo;
    } catch (RemoteProxyException e) {
        handleRemoteProxyException(e);
        throw new DataAccessException(e.getMessage());
    }
}
Also used : MathModelInfo(org.vcell.util.document.MathModelInfo) DataAccessException(org.vcell.util.DataAccessException) RemoteProxyException(cbit.vcell.message.server.bootstrap.client.RemoteProxyVCellConnectionFactory.RemoteProxyException)

Aggregations

MathModelInfo (org.vcell.util.document.MathModelInfo)67 BioModelInfo (org.vcell.util.document.BioModelInfo)37 DataAccessException (org.vcell.util.DataAccessException)32 GeometryInfo (cbit.vcell.geometry.GeometryInfo)22 VCDocumentInfo (org.vcell.util.document.VCDocumentInfo)14 MathModel (cbit.vcell.mathmodel.MathModel)12 Vector (java.util.Vector)11 BioModel (cbit.vcell.biomodel.BioModel)10 KeyValue (org.vcell.util.document.KeyValue)10 RemoteProxyException (cbit.vcell.message.server.bootstrap.client.RemoteProxyVCellConnectionFactory.RemoteProxyException)8 Hashtable (java.util.Hashtable)8 ObjectNotFoundException (org.vcell.util.ObjectNotFoundException)8 User (org.vcell.util.document.User)8 Simulation (cbit.vcell.solver.Simulation)7 UserCancelException (org.vcell.util.UserCancelException)7 Geometry (cbit.vcell.geometry.Geometry)6 SimulationContext (cbit.vcell.mapping.SimulationContext)6 TestCriteriaNewBioModel (cbit.vcell.numericstest.TestCriteriaNewBioModel)6 TestCriteriaNewMathModel (cbit.vcell.numericstest.TestCriteriaNewMathModel)6 SimulationInfo (cbit.vcell.solver.SimulationInfo)6