Search in sources :

Example 46 with Geometry

use of cbit.vcell.geometry.Geometry in project vcell by virtualcell.

the class ApplicationsPropertiesPanel method updateInterface.

/**
 * Comment
 */
private void updateInterface() {
    if (bioModel == null) {
        return;
    }
    applicationsPanel.removeAll();
    int gridy = 0;
    SimulationContext[] simulationContexts = bioModel.getSimulationContexts();
    if (simulationContexts != null) {
        for (int i = 0; i < simulationContexts.length; i++) {
            SimulationContext simContext = simulationContexts[i];
            JLabel label = new JLabel(simContext.getName());
            label.setFont(label.getFont().deriveFont(Font.BOLD));
            label.setIcon(simulationContextIcon);
            GridBagConstraints gbc = new java.awt.GridBagConstraints();
            gbc.gridx = 0;
            gbc.gridy = gridy++;
            gbc.weightx = 1.0;
            gbc.fill = GridBagConstraints.HORIZONTAL;
            gbc.anchor = GridBagConstraints.FIRST_LINE_START;
            if (i > 0) {
                gbc.insets = new Insets(4, 0, 0, 0);
            }
            applicationsPanel.add(label, gbc);
            Geometry geometry = simContext.getGeometry();
            String geometryText = "Compartmental geometry";
            if (geometry != null) {
                Version geometryVersion = geometry.getVersion();
                int dimension = geometry.getDimension();
                if (dimension > 0) {
                    String description = geometry.getDimension() + "D " + (geometry.getGeometrySpec().hasImage() ? "image" : "analytic") + " geometry";
                    geometryText = description;
                    if (geometryVersion != null) {
                        geometryText += " - " + geometryVersion.getName();
                    }
                }
            }
            JLabel geometryLabel = new JLabel(geometryText);
            geometryLabel.setIcon(geometryIcon);
            JLabel detStochLabel = new JLabel(simContext.getMathType().getDescription());
            detStochLabel.setIcon(appTypeIcon);
            gbc.insets = new Insets(2, 20, 2, 2);
            gbc.gridy = gridy++;
            applicationsPanel.add(detStochLabel, gbc);
            gbc.gridy = gridy++;
            if (i == simulationContexts.length - 1) {
                gbc.weighty = 1.0;
            }
            applicationsPanel.add(geometryLabel, gbc);
        }
    }
}
Also used : Geometry(cbit.vcell.geometry.Geometry) GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets) Version(org.vcell.util.document.Version) JLabel(javax.swing.JLabel) SimulationContext(cbit.vcell.mapping.SimulationContext)

Example 47 with Geometry

use of cbit.vcell.geometry.Geometry in project vcell by virtualcell.

the class SurfaceViewerPanel 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 48 with Geometry

use of cbit.vcell.geometry.Geometry in project vcell by virtualcell.

the class MathModelPropertiesPanel method updateInterface.

/**
 * Comment
 */
private void updateInterface() {
    if (mathModel == null || mathModelWindowManager == null) {
        return;
    }
    nameLabel.setText(mathModel.getName());
    Version version = mathModel.getVersion();
    try {
        if (version != null) {
            ownerLabel.setText(version.getOwner().getName());
            lastModifiedLabel.setText(version.getDate().toString());
            MathModelInfo mathModelInfo = mathModelWindowManager.getRequestManager().getDocumentManager().getMathModelInfo(version.getVersionKey());
            permissionLabel.setText(mathModelInfo.getVersion().getGroupAccess().getDescription());
            changePermissionButton.setEnabled(true);
        }
        Geometry geometry = mathModel.getGeometry();
        String geometryText = "Compartmental geometry";
        if (geometry != null) {
            Version geometryVersion = geometry.getVersion();
            int dimension = geometry.getDimension();
            if (dimension > 0) {
                String description = geometry.getDimension() + "D " + (geometry.getGeometrySpec().hasImage() ? "image" : "analytic") + " geometry";
                geometryText = description;
                if (geometryVersion != null) {
                    geometryText += " - " + geometryVersion.getName() + " (" + geometryVersion.getDate() + ")";
                }
            }
        }
        geometryLabel.setText(geometryText);
        detStochLabel.setText(mathModel.getMathDescription().getMathType().getDescription());
    } catch (DataAccessException e) {
        e.printStackTrace();
    }
}
Also used : Geometry(cbit.vcell.geometry.Geometry) Version(org.vcell.util.document.Version) MathModelInfo(org.vcell.util.document.MathModelInfo) DataAccessException(org.vcell.util.DataAccessException)

Example 49 with Geometry

use of cbit.vcell.geometry.Geometry in project vcell by virtualcell.

the class OutputFunctionsListTableModel method propertyChange.

/**
 * This method gets called when a bound property is changed.
 * @param evt A PropertyChangeEvent object describing the event source
 *   	and the property that has changed.
 */
public void propertyChange(java.beans.PropertyChangeEvent evt) {
    if (evt.getSource() == getOutputFunctionContext() && evt.getPropertyName().equals(OutputFunctionContext.PROPERTY_OUTPUT_FUNCTIONS)) {
        setData(outputFunctionContext.getOutputFunctionsList());
    }
    if (evt.getPropertyName().equals(GeometryOwner.PROPERTY_NAME_GEOMETRY)) {
        Geometry oldGeometry = (Geometry) evt.getOldValue();
        Geometry newGeometry = (Geometry) evt.getNewValue();
        // changing from ode to pde
        if (oldGeometry.getDimension() == 0 && newGeometry.getDimension() > 0) {
            fireTableStructureChanged();
            setData(getOutputFunctionContext().getOutputFunctionsList());
        }
    }
}
Also used : Geometry(cbit.vcell.geometry.Geometry)

Example 50 with Geometry

use of cbit.vcell.geometry.Geometry in project vcell by virtualcell.

the class ElectrodePanel method enableComponents.

// /**
// * connPtoP3SetSource:  (ElectrodePanel.model <--> model1.this)
// */
// /* WARNING: THIS METHOD WILL BE REGENERATED. */
// private void connPtoP3SetSource() {
// /* Set the source from the target */
// try {
// if (ivjConnPtoP3Aligning == false) {
// // user code begin {1}
// // user code end
// ivjConnPtoP3Aligning = true;
// if ((getmodel1() != null)) {
// this.setModel(getmodel1());
// }
// // user code begin {2}
// // user code end
// ivjConnPtoP3Aligning = false;
// }
// } catch (java.lang.Throwable ivjExc) {
// ivjConnPtoP3Aligning = false;
// // user code begin {3}
// // user code end
// handleException(ivjExc);
// }
// }
// /**
// * connPtoP3SetTarget:  (ElectrodePanel.model <--> model1.this)
// */
// private void connPtoP3SetTarget() {
// try {
// if (ivjConnPtoP3Aligning == false) {
// ivjConnPtoP3Aligning = true;
// setmodel1(this.getModel());
// ivjConnPtoP3Aligning = false;
// }
// } catch (java.lang.Throwable ivjExc) {
// ivjConnPtoP3Aligning = false;
// handleException(ivjExc);
// }
// }
/**
 * Comment
 */
private void enableComponents() {
    // 
    // enable/disable coordinates
    // 
    Geometry geometry = getGeometry();
    boolean enable = (geometry != null);
    // 
    // rest of the widgets.
    // 
    getFeatureLabel().setEnabled(enable);
    getFeatureValueLabel().setEnabled(enable);
    getSetFeatureButton().setEnabled(enable);
    return;
}
Also used : Geometry(cbit.vcell.geometry.Geometry)

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