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