use of cbit.vcell.client.BioModelWindowManager in project vcell by virtualcell.
the class NetworkFreePanel method createModel.
private void createModel() {
DocumentWindow dw = (DocumentWindow) BeanUtils.findTypeParentOfComponent(this, DocumentWindow.class);
BioModelWindowManager bmwm = (BioModelWindowManager) (dw.getTopLevelWindowManager());
RequestManager rm = dw.getTopLevelWindowManager().getRequestManager();
rm.createBioModelFromApplication(bmwm, "Test", fieldSimulationContext);
}
use of cbit.vcell.client.BioModelWindowManager in project vcell by virtualcell.
the class ApplicationSimulationsPanel method setBioModelWindowManager.
@Override
public void setBioModelWindowManager(BioModelWindowManager newValue) {
super.setBioModelWindowManager(newValue);
BioModelWindowManager oldValue = bioModelWindowManager;
if (oldValue != null) {
mathematicsPanel.removeActionListener(bioModelWindowManager);
}
bioModelWindowManager = newValue;
if (newValue != null) {
mathematicsPanel.addActionListener(newValue);
}
}
use of cbit.vcell.client.BioModelWindowManager in project vcell by virtualcell.
the class NetworkConstraintsPanel method createModel.
private void createModel() {
if (!checkBnglRequirements()) {
return;
}
DocumentWindow dw = (DocumentWindow) BeanUtils.findTypeParentOfComponent(this, DocumentWindow.class);
BioModelWindowManager bmwm = (BioModelWindowManager) (dw.getTopLevelWindowManager());
RequestManager rm = dw.getTopLevelWindowManager().getRequestManager();
rm.createBioModelFromApplication(bmwm, "Test", fieldSimulationContext);
}
use of cbit.vcell.client.BioModelWindowManager in project vcell by virtualcell.
the class VCellClientDataServiceImpl method getSimsFromOpenModels.
@Override
public List<SimulationDataSetRef> getSimsFromOpenModels() {
ArrayList<SimulationDataSetRef> simulationDataSetRefs = new ArrayList<SimulationDataSetRef>();
for (TopLevelWindowManager windowManager : vcellClient.getMdiManager().getWindowManagers()) {
Simulation[] simulations = null;
VCDocument modelDocument = null;
if (windowManager instanceof BioModelWindowManager) {
BioModelWindowManager selectedBioWindowManager = (BioModelWindowManager) windowManager;
BioModel bioModel = selectedBioWindowManager.getBioModel();
simulations = bioModel.getSimulations();
modelDocument = bioModel;
// simOwnerCount = bioModel.getNumSimulationContexts();
} else if (windowManager instanceof MathModelWindowManager) {
MathModelWindowManager selectedMathWindowManager = (MathModelWindowManager) windowManager;
MathModel mathModel = selectedMathWindowManager.getMathModel();
simulations = mathModel.getSimulations();
modelDocument = mathModel;
// simOwnerCount = 1;
}
if (simulations != null) {
for (Simulation simulation : simulations) {
if (!isVtkSupported(simulation)) {
continue;
}
Origin origin = simulation.getMathDescription().getGeometry().getOrigin();
Extent extent = simulation.getMathDescription().getGeometry().getExtent();
SimulationInfo simInfo = simulation.getSimulationInfo();
SimulationStatus simStatus = vcellClient.getRequestManager().getServerSimulationStatus(simInfo);
for (int jobIndex = 0; jobIndex < simulation.getScanCount(); jobIndex++) {
if (simStatus != null && simStatus.getHasData()) {
SimulationDataSetRef simulationDataSetReference = VCellClientDataServiceImpl.createSimulationDataSetRef(simulation, modelDocument, jobIndex, false);
simulationDataSetRefs.add(simulationDataSetReference);
}
}
}
}
}
File localSimDir = ResourceUtil.getLocalSimDir(User.tempUser.getName());
String[] simtaskFilenames = localSimDir.list((dir, name) -> (name.endsWith(".simtask.xml")));
for (String simtaskFilename : simtaskFilenames) {
try {
SimulationTask simTask = XmlHelper.XMLToSimTask(org.apache.commons.io.FileUtils.readFileToString(new File(localSimDir, simtaskFilename)));
VCDocument modelDocument = null;
SimulationDataSetRef simulationDataSetReference = VCellClientDataServiceImpl.createSimulationDataSetRef(simTask.getSimulation(), modelDocument, simTask.getSimulationJob().getJobIndex(), true);
simulationDataSetRefs.add(simulationDataSetReference);
} catch (ExpressionException | XmlParseException | IOException e) {
e.printStackTrace();
}
}
return simulationDataSetRefs;
}
use of cbit.vcell.client.BioModelWindowManager in project vcell by virtualcell.
the class DocumentWindow method getJMenuItemMIRIAM.
/**
* This method initializes jMenuItemMIRIAM
*
* @return javax.swing.JMenuItem
*/
private JMenuItem getJMenuItemMIRIAM() {
if (jMenuItemMIRIAM == null) {
jMenuItemMIRIAM = new JMenuItem();
jMenuItemMIRIAM.setText("Model Annotation ...");
jMenuItemMIRIAM.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
if (getTopLevelWindowManager() instanceof BioModelWindowManager) {
((BioModelWindowManager) getTopLevelWindowManager()).showMIRIAMWindow();
} else {
PopupGenerator.showInfoDialog(DocumentWindow.this, "Sorry, Currently only BioModels have a MIRIAM editor.");
}
}
});
}
return jMenuItemMIRIAM;
}
Aggregations