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