use of cbit.vcell.geometry.GeometryInfo in project vcell by virtualcell.
the class GeometryDbTreeModel method databaseDelete.
/**
* @param event cbit.vcell.clientdb.DatabaseEvent
*/
public void databaseDelete(DatabaseEvent databaseEvent) {
if (databaseEvent.getOldVersionInfo() instanceof GeometryInfo) {
GeometryInfo removedGeometryInfo = (GeometryInfo) databaseEvent.getOldVersionInfo();
BioModelNode removedNode = ((BioModelNode) getRoot()).findNodeByUserObject(removedGeometryInfo);
if (removedNode != null) {
if (removedNode.getParent() != null && removedNode.getSiblingCount() == 1) {
// just this one version
removedNode = (BioModelNode) removedNode.getParent();
}
removeNodeFromParent(removedNode);
}
}
}
use of cbit.vcell.geometry.GeometryInfo in project vcell by virtualcell.
the class PublicationInfoNodeTreeModel method createVersionSubTree.
private BioModelNode createVersionSubTree(BioModelNode publicationsInfoNode) throws DataAccessException {
BioModelNode versionNode = new BioModelNode("Root", true);
Object uo = publicationsInfoNode.getUserObject();
if (!(uo instanceof PublicationInfo)) {
String title = "PublicationInfo missing";
publicationNode = new BioModelNode(title, false);
versionNode.add(publicationNode);
return versionNode;
}
publicationNode = null;
modelsNode = null;
PublicationInfo pi = (PublicationInfo) uo;
publicationNode = new BioModelNode("Publication", true);
publicationNode.setRenderHint("type", "PublicationsInfo");
BioModelNode piTitleNode = new BioModelNode(pi, true);
piTitleNode.setRenderHint("type", "PublicationInfoTitle");
publicationNode.add(piTitleNode);
BioModelNode piAuthorsNode = new BioModelNode(pi, false);
piAuthorsNode.setRenderHint("type", "PublicationInfoAuthors");
piTitleNode.add(piAuthorsNode);
BioModelNode piCitationNode = new BioModelNode(pi, false);
piCitationNode.setRenderHint("type", "PublicationInfoCitation");
piTitleNode.add(piCitationNode);
BioModelNode piDoiNode = new BioModelNode(pi, false);
piDoiNode.setRenderHint("type", "PublicationInfoDoi");
piTitleNode.add(piDoiNode);
if (pi.getUrl() != null && !pi.getUrl().isEmpty()) {
if (pi.getUrl().contains("pubmed") || pi.getUrl().contains("PubMed")) {
BioModelNode piUrlNode = new BioModelNode(pi, false);
piUrlNode.setRenderHint("type", "PublicationInfoUrl");
piTitleNode.add(piUrlNode);
}
}
versionNode.add(publicationNode);
String name = publicationsInfoNode.getChildCount() > 1 ? "Models" : "Model";
modelsNode = new BioModelNode(name, true);
modelsNode.setRenderHint("type", "ModelsList");
for (int i = 0; i < publicationsInfoNode.getChildCount(); i++) {
TreeNode child = publicationsInfoNode.getChildAt(i);
if (!(child instanceof BioModelNode)) {
versionNode.add(modelsNode);
return versionNode;
}
BioModelNode modelNode = (BioModelNode) child;
uo = modelNode.getUserObject();
if (!(uo instanceof VCDocumentInfoNode)) {
versionNode.add(modelsNode);
return versionNode;
}
VCDocumentInfoNode din = (VCDocumentInfoNode) uo;
Version version = din.getVCDocumentInfo().getVersion();
BioModelNode mNameNode = new BioModelNode(version.getName(), true);
mNameNode.setRenderHint("type", "ModelName");
VCDocumentInfo di = din.getVCDocumentInfo();
if (di instanceof BioModelInfo) {
mNameNode.setRenderHint("category", "BioModel");
} else if (di instanceof MathModelInfo) {
mNameNode.setRenderHint("category", "MathModel");
} else if (di instanceof GeometryInfo) {
mNameNode.setRenderHint("category", "Geometry");
}
modelsNode.add(mNameNode);
BioModelNode mOwnerNode = new BioModelNode(version.getOwner(), true);
mOwnerNode.setRenderHint("type", "ModelOwner");
mNameNode.add(mOwnerNode);
BioModelNode mDateNode = new BioModelNode(version.getDate(), true);
mDateNode.setRenderHint("type", "ModelDate");
mNameNode.add(mDateNode);
}
versionNode.add(modelsNode);
return versionNode;
}
use of cbit.vcell.geometry.GeometryInfo in project vcell by virtualcell.
the class GeometryMetaDataPanel method setGeometryInfo.
/**
* Sets the geometryInfo property (cbit.vcell.geometry.GeometryInfo) value.
* @param geometryInfo The new value for the property.
* @see #getGeometryInfo
*/
public void setGeometryInfo(GeometryInfo geometryInfo) {
GeometryInfo oldValue = fieldGeometryInfo;
fieldGeometryInfo = geometryInfo;
firePropertyChange("geometryInfo", oldValue, geometryInfo);
}
use of cbit.vcell.geometry.GeometryInfo in project vcell by virtualcell.
the class GeometryTreePanel method documentManager_DatabaseUpdate.
/**
* Comment
*/
protected void documentManager_DatabaseUpdate(DatabaseEvent event) {
if (event.getNewVersionInfo() instanceof GeometryInfo && getSelectedVersionInfo() instanceof GeometryInfo) {
GeometryInfo selectedGeoInfo = (GeometryInfo) getSelectedVersionInfo();
GeometryInfo eventGeoInfo = (GeometryInfo) event.getNewVersionInfo();
if (eventGeoInfo.getVersion().getVersionKey().equals(selectedGeoInfo.getVersion().getVersionKey())) {
setSelectedVersionInfo(event.getNewVersionInfo());
}
}
}
use of cbit.vcell.geometry.GeometryInfo in project vcell by virtualcell.
the class GeometryTreePanel method documentManager_DatabaseDelete.
/**
* Comment
*/
protected void documentManager_DatabaseDelete(DatabaseEvent event) {
if (event.getOldVersionInfo() instanceof GeometryInfo && getSelectedVersionInfo() instanceof GeometryInfo) {
GeometryInfo selectedGeoInfo = (GeometryInfo) getSelectedVersionInfo();
GeometryInfo eventGeoInfo = (GeometryInfo) event.getOldVersionInfo();
if (eventGeoInfo.getVersion().getVersionKey().equals(selectedGeoInfo.getVersion().getVersionKey())) {
setSelectedVersionInfo(null);
getJTree1().getSelectionModel().clearSelection();
}
}
}
Aggregations