Search in sources :

Example 61 with Geometry

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);
    }
}
Also used : Geometry(cbit.vcell.geometry.Geometry) ISize(org.vcell.util.ISize)

Example 62 with Geometry

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);
        }
    }
    ;
}
Also used : Geometry(cbit.vcell.geometry.Geometry)

Example 63 with Geometry

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);
}
Also used : Geometry(cbit.vcell.geometry.Geometry)

Example 64 with 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;
}
Also used : Geometry(cbit.vcell.geometry.Geometry) SimulationContext(cbit.vcell.mapping.SimulationContext)

Example 65 with Geometry

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());
    }
}
Also used : Geometry(cbit.vcell.geometry.Geometry) KeyValue(org.vcell.util.document.KeyValue) BigString(org.vcell.util.BigString) XmlParseException(cbit.vcell.xml.XmlParseException) BigString(org.vcell.util.BigString) DataAccessException(org.vcell.util.DataAccessException) RemoteProxyException(cbit.vcell.message.server.bootstrap.client.RemoteProxyVCellConnectionFactory.RemoteProxyException)

Aggregations

Geometry (cbit.vcell.geometry.Geometry)121 MathDescription (cbit.vcell.math.MathDescription)32 SimulationContext (cbit.vcell.mapping.SimulationContext)31 Simulation (cbit.vcell.solver.Simulation)29 PropertyVetoException (java.beans.PropertyVetoException)24 BioModel (cbit.vcell.biomodel.BioModel)23 DataAccessException (org.vcell.util.DataAccessException)23 VCImage (cbit.image.VCImage)22 SubVolume (cbit.vcell.geometry.SubVolume)21 MathModel (cbit.vcell.mathmodel.MathModel)21 Expression (cbit.vcell.parser.Expression)19 ISize (org.vcell.util.ISize)19 Hashtable (java.util.Hashtable)18 GeometryThumbnailImageFactoryAWT (cbit.vcell.geometry.GeometryThumbnailImageFactoryAWT)17 UserCancelException (org.vcell.util.UserCancelException)17 KeyValue (org.vcell.util.document.KeyValue)17 ImageException (cbit.image.ImageException)16 Extent (org.vcell.util.Extent)16 SurfaceClass (cbit.vcell.geometry.SurfaceClass)15 ExpressionException (cbit.vcell.parser.ExpressionException)15