use of cbit.vcell.geometry.Geometry in project vcell by virtualcell.
the class ChomboMeshSpecificationPanel method updateMesh.
private void updateMesh(int selectedIndex) {
Geometry geometry = simulation.getMathDescription().getGeometry();
if (selectedIndex >= HComboBox.getItemCount() || selectedIndex >= NxComboBox.getItemCount() || geometry.getDimension() > 1 && selectedIndex >= NyComboBox.getItemCount() || geometry.getDimension() > 2 && selectedIndex >= NzComboBox.getItemCount()) {
return;
}
String error = null;
// remove ActionListener, here we only want to set values
removeComboBoxListener();
HComboBox.setSelectedIndex(selectedIndex);
NxComboBox.setSelectedIndex(selectedIndex);
if (geometry.getDimension() > 1) {
NyComboBox.setSelectedIndex(selectedIndex);
if (geometry.getDimension() > 2) {
NzComboBox.setSelectedIndex(selectedIndex);
}
}
addComboBoxListener();
Integer Nx = (Integer) NxComboBox.getSelectedItem();
Integer Ny = geometry.getDimension() > 1 ? (Integer) NyComboBox.getSelectedItem() : 1;
Integer Nz = geometry.getDimension() > 2 ? (Integer) NzComboBox.getSelectedItem() : 1;
try {
ISize iSize = new ISize(Nx, Ny, Nz);
simulation.getMeshSpecification().setSamplingSize(iSize);
} catch (NumberFormatException nexc) {
error = "NumberFormatException " + nexc.getMessage();
} catch (java.beans.PropertyVetoException pexc) {
error = pexc.getMessage();
}
if (error != null) {
DialogUtils.showErrorDialog(this, "Error setting mesh size : " + error);
}
}
use of cbit.vcell.geometry.Geometry in project vcell by virtualcell.
the class ElectrodePanel method setgeometry1.
/**
* Set the geometry1 to a new value.
* @param newValue cbit.vcell.geometry.Geometry
*/
private void setgeometry1(Geometry newValue) {
if (ivjgeometry1 != newValue) {
try {
Geometry oldValue = getgeometry1();
ivjgeometry1 = newValue;
connPtoP2SetSource();
connEtoC2(ivjgeometry1);
firePropertyChange("geometry", oldValue, newValue);
} catch (java.lang.Throwable ivjExc) {
handleException(ivjExc);
}
}
;
}
use of cbit.vcell.geometry.Geometry in project vcell by virtualcell.
the class ElectrodePanel method setGeometry.
/**
* Sets the geometry property (cbit.vcell.geometry.Geometry) value.
* @param geometry The new value for the property.
* @see #getGeometry
*/
public void setGeometry(Geometry geometry) {
Geometry oldValue = fieldGeometry;
fieldGeometry = geometry;
firePropertyChange("geometry", oldValue, geometry);
}
use of cbit.vcell.geometry.Geometry in project vcell by virtualcell.
the class BioModel method addNewSimulationContext.
/**
* Insert the method's description here.
* Creation date: (1/19/01 3:31:00 PM)
* @param simulationContext cbit.vcell.mapping.SimulationContext
* @exception java.beans.PropertyVetoException The exception description.
*/
public SimulationContext addNewSimulationContext(String newSimulationContextName, SimulationContext.Application app) throws java.beans.PropertyVetoException {
SimulationContext simContext = new SimulationContext(getModel(), new Geometry("non-spatial", 0), null, null, app);
simContext.setName(newSimulationContextName);
addSimulationContext(simContext);
return simContext;
}
use of cbit.vcell.geometry.Geometry in project vcell by virtualcell.
the class ClientDocumentManager method saveAsNew.
/**
* Insert the method's description here.
* Creation date: (1/19/01 11:27:52 AM)
*/
public Geometry saveAsNew(Geometry geometry, java.lang.String newName) throws DataAccessException {
try {
String geometryXML = null;
try {
geometryXML = XmlHelper.geometryToXML(geometry);
} catch (XmlParseException e) {
e.printStackTrace(System.out);
throw new DataAccessException(e.getMessage());
}
if (isChanged(geometry, geometryXML) == false) {
System.out.println("<<<<<WARNING>>>>>>>ClientDocumentManger.save(Geometry), called on unchanged geometry");
return geometry;
}
String savedGeometryXML = sessionManager.getUserMetaDbServer().saveGeometryAs(new BigString(geometryXML), newName).toString();
Geometry savedGeometry = getGeometryFromDatabaseXML(savedGeometryXML);
KeyValue savedKey = savedGeometry.getVersion().getVersionKey();
if (xmlHash.get(savedKey) == null) {
xmlHash.put(savedKey, savedGeometryXML);
}
updateGeometryRelatedHashes(savedGeometry);
return savedGeometry;
} catch (RemoteProxyException e) {
e.printStackTrace(System.out);
throw new DataAccessException(VCellErrorMessages.FAIL_SAVE_MESSAGE + "\n\n" + e.getMessage());
}
}
Aggregations