Search in sources :

Example 96 with BioModel

use of cbit.vcell.biomodel.BioModel in project vcell by virtualcell.

the class TestingFrameworkWindowManager method getDataInfoProvider.

private DataInfoProvider getDataInfoProvider(VCDocument document, PDEDataContext pdeDataContext, String refSimName) throws ObjectNotFoundException {
    SimulationWorkspaceModelInfo simulationWorkspaceModelInfo = null;
    if (document instanceof MathModel) {
        MathModel mathModel = (MathModel) document;
        Simulation[] sims = mathModel.getSimulations();
        for (int i = 0; i < sims.length; i++) {
            if (refSimName.equals(sims[i].getName())) {
                simulationWorkspaceModelInfo = new SimulationWorkspaceModelInfo(mathModel, sims[i].getName());
                break;
            }
        }
    } else {
        BioModel bioModel = (BioModel) document;
        Simulation[] sims = bioModel.getSimulations();
        for (int i = 0; i < sims.length; i++) {
            if (refSimName.equals(sims[i].getName())) {
                simulationWorkspaceModelInfo = new SimulationWorkspaceModelInfo(bioModel.getSimulationContext(sims[i]), sims[i].getName());
                break;
            }
        }
    }
    DataInfoProvider dataInfoProvider = new DataInfoProvider(pdeDataContext, simulationWorkspaceModelInfo);
    return dataInfoProvider;
}
Also used : MathModel(cbit.vcell.mathmodel.MathModel) AddTestCasesOPMathModel(cbit.vcell.numericstest.AddTestCasesOPMathModel) TestCaseNewMathModel(cbit.vcell.numericstest.TestCaseNewMathModel) TestCriteriaNewMathModel(cbit.vcell.numericstest.TestCriteriaNewMathModel) EditTestCriteriaOPMathModel(cbit.vcell.numericstest.EditTestCriteriaOPMathModel) AddTestCriteriaOPMathModel(cbit.vcell.numericstest.AddTestCriteriaOPMathModel) Simulation(cbit.vcell.solver.Simulation) TestCaseNewBioModel(cbit.vcell.numericstest.TestCaseNewBioModel) TestCriteriaNewBioModel(cbit.vcell.numericstest.TestCriteriaNewBioModel) AddTestCasesOPBioModel(cbit.vcell.numericstest.AddTestCasesOPBioModel) BioModel(cbit.vcell.biomodel.BioModel) EditTestCriteriaOPBioModel(cbit.vcell.numericstest.EditTestCriteriaOPBioModel) AddTestCriteriaOPBioModel(cbit.vcell.numericstest.AddTestCriteriaOPBioModel) DataInfoProvider(cbit.vcell.simdata.DataInfoProvider) SimulationWorkspaceModelInfo(cbit.vcell.client.data.SimulationWorkspaceModelInfo)

Example 97 with BioModel

use of cbit.vcell.biomodel.BioModel in project vcell by virtualcell.

the class TopLevelWindowManager method prepareDocumentToLoad.

public void prepareDocumentToLoad(VCDocument doc, boolean bInNewWindow) throws Exception {
    if (doc instanceof BioModel) {
        Simulation[] simulations = ((BioModel) doc).getSimulations();
        ArrayList<VCSimulationIdentifier> simIDs = new ArrayList<VCSimulationIdentifier>();
        for (int i = 0; i < simulations.length; i++) {
            SimulationInfo simulationInfo = simulations[i].getSimulationInfo();
            if (simulationInfo != null) {
                simIDs.add(simulationInfo.getAuthoritativeVCSimulationIdentifier());
            }
        }
        RequestManager rm = getRequestManager();
        ConnectionStatus stat = rm.getConnectionStatus();
        if (stat.getStatus() == ConnectionStatus.CONNECTED) {
            rm.getDocumentManager().preloadSimulationStatus(simIDs.toArray(new VCSimulationIdentifier[0]));
        }
    } else if (doc instanceof MathModel) {
        Geometry geometry = ((MathModel) doc).getMathDescription().getGeometry();
        geometry.precomputeAll(new GeometryThumbnailImageFactoryAWT());
        Simulation[] simulations = ((MathModel) doc).getSimulations();
        // VCSimulationIdentifier simIDs[] = new VCSimulationIdentifier[simulations.length];
        ArrayList<VCSimulationIdentifier> simIDs = new ArrayList<>();
        for (int i = 0; i < simulations.length; i++) {
            if (simulations[i].getSimulationInfo() != null) {
                simIDs.add(simulations[i].getSimulationInfo().getAuthoritativeVCSimulationIdentifier());
            }
        }
        getRequestManager().getDocumentManager().preloadSimulationStatus(simIDs.toArray(new VCSimulationIdentifier[0]));
    } else if (doc instanceof Geometry) {
        ((Geometry) doc).precomputeAll(new GeometryThumbnailImageFactoryAWT());
    }
}
Also used : VCSimulationIdentifier(cbit.vcell.solver.VCSimulationIdentifier) MathModel(cbit.vcell.mathmodel.MathModel) ArrayList(java.util.ArrayList) Geometry(cbit.vcell.geometry.Geometry) GeometryThumbnailImageFactoryAWT(cbit.vcell.geometry.GeometryThumbnailImageFactoryAWT) Simulation(cbit.vcell.solver.Simulation) BioModel(cbit.vcell.biomodel.BioModel) ConnectionStatus(cbit.vcell.client.server.ConnectionStatus) SimulationInfo(cbit.vcell.solver.SimulationInfo)

Example 98 with BioModel

use of cbit.vcell.biomodel.BioModel in project vcell by virtualcell.

the class BioModelEditorReactionTableModel method bioModelChange.

@Override
protected void bioModelChange(PropertyChangeEvent evt) {
    super.bioModelChange(evt);
    // ownerTable.getColumnModel().getColumn(COLUMN_STRUCTURE).setCellEditor(getStructureComboBoxEditor());
    // updateStructureComboBox();
    BioModel oldValue = (BioModel) evt.getOldValue();
    if (oldValue != null) {
        for (ModelProcess p : oldValue.getModel().getModelProcesses()) {
            p.removePropertyChangeListener(this);
        }
    }
    BioModel newValue = (BioModel) evt.getNewValue();
    if (newValue != null) {
        for (ModelProcess p : newValue.getModel().getModelProcesses()) {
            p.addPropertyChangeListener(this);
        }
    }
}
Also used : BioModel(cbit.vcell.biomodel.BioModel) ModelProcess(cbit.vcell.model.ModelProcess)

Example 99 with BioModel

use of cbit.vcell.biomodel.BioModel in project vcell by virtualcell.

the class BioModelEditorRightSidePanel method setBioModel.

public void setBioModel(BioModel newValue) {
    BioModel oldValue = bioModel;
    bioModel = newValue;
    firePropertyChange(PROPERTY_NAME_BIO_MODEL, oldValue, newValue);
}
Also used : BioModel(cbit.vcell.biomodel.BioModel)

Example 100 with BioModel

use of cbit.vcell.biomodel.BioModel in project vcell by virtualcell.

the class BioModelEditorRightSideTableModel method setBioModel.

public void setBioModel(BioModel newValue) {
    BioModel oldValue = bioModel;
    bioModel = newValue;
    firePropertyChange(PROPERTY_NAME_BIO_MODEL, oldValue, newValue);
}
Also used : BioModel(cbit.vcell.biomodel.BioModel)

Aggregations

BioModel (cbit.vcell.biomodel.BioModel)158 SimulationContext (cbit.vcell.mapping.SimulationContext)72 Simulation (cbit.vcell.solver.Simulation)53 XMLSource (cbit.vcell.xml.XMLSource)37 KeyValue (org.vcell.util.document.KeyValue)36 MathModel (cbit.vcell.mathmodel.MathModel)33 DataAccessException (org.vcell.util.DataAccessException)29 XmlParseException (cbit.vcell.xml.XmlParseException)28 File (java.io.File)28 Model (cbit.vcell.model.Model)27 BioModelInfo (org.vcell.util.document.BioModelInfo)25 MathDescription (cbit.vcell.math.MathDescription)24 IOException (java.io.IOException)24 BigString (org.vcell.util.BigString)22 Geometry (cbit.vcell.geometry.Geometry)21 UserCancelException (org.vcell.util.UserCancelException)20 User (org.vcell.util.document.User)20 ObjectNotFoundException (org.vcell.util.ObjectNotFoundException)19 SpeciesContext (cbit.vcell.model.SpeciesContext)17 VCDocument (org.vcell.util.document.VCDocument)16