use of org.vcell.util.document.VersionInfo in project vcell by virtualcell.
the class MathModelDbTreePanel method treeSelection.
/**
* Comment
*/
protected void treeSelection() {
TreePath treePath = getJTree1().getSelectionPath();
if (treePath == null) {
setSelectedVersionInfo(null);
return;
}
BioModelNode bioModelNode = (BioModelNode) treePath.getLastPathComponent();
Object object = bioModelNode.getUserObject();
if (object instanceof VersionInfo) {
setSelectedVersionInfo((VersionInfo) object);
} else if (object instanceof VCDocumentInfoNode && bioModelNode.getChildCount() > 0 && ((BioModelNode) bioModelNode.getChildAt(0)).getUserObject() instanceof MathModelInfo) {
MathModelInfo mathModelInfo = (MathModelInfo) ((BioModelNode) bioModelNode.getChildAt(0)).getUserObject();
setSelectedVersionInfo(mathModelInfo);
} else {
setSelectedVersionInfo(null);
}
}
use of org.vcell.util.document.VersionInfo in project vcell by virtualcell.
the class GeometryTreePanel method treeSelection.
/**
* Comment
*/
protected void treeSelection() {
TreePath treePath = getJTree1().getSelectionPath();
if (treePath == null) {
setSelectedVersionInfo(null);
return;
}
BioModelNode bioModelNode = (BioModelNode) treePath.getLastPathComponent();
Object object = bioModelNode.getUserObject();
try {
BeanUtils.setCursorThroughout(this, java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.WAIT_CURSOR));
if (object instanceof VersionInfo) {
setSelectedVersionInfo((VersionInfo) object);
} else if (object instanceof VCDocumentInfoNode && bioModelNode.getChildCount() > 0 && ((BioModelNode) bioModelNode.getChildAt(0)).getUserObject() instanceof GeometryInfo) {
GeometryInfo geometryInfo = (GeometryInfo) ((BioModelNode) bioModelNode.getChildAt(0)).getUserObject();
setSelectedVersionInfo(geometryInfo);
} else {
setSelectedVersionInfo(null);
}
} catch (Exception exc) {
handleException(exc);
} finally {
BeanUtils.setCursorThroughout(this, java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
}
}
use of org.vcell.util.document.VersionInfo in project vcell by virtualcell.
the class ImageDbTreePanel method treeSelection.
/**
* Comment
*/
private void treeSelection() {
TreeSelectionModel treeSelectionModel = getselectionModel1();
TreePath treePath = treeSelectionModel.getSelectionPath();
if (treePath == null) {
setSelectedVersionInfo(null);
return;
}
BioModelNode bioModelNode = (BioModelNode) treePath.getLastPathComponent();
Object object = bioModelNode.getUserObject();
if (object instanceof VersionInfo) {
setSelectedVersionInfo((VersionInfo) object);
//
// if selected parent of VCImageInfo, setSelection as it's SimulationInfo
//
} else if (object instanceof String && bioModelNode.getChildCount() > 0 && ((BioModelNode) bioModelNode.getChildAt(0)).getUserObject() instanceof VCImageInfo) {
VCImageInfo imgInfo = (VCImageInfo) ((BioModelNode) bioModelNode.getChildAt(0)).getUserObject();
setSelectedVersionInfo(imgInfo);
} else {
setSelectedVersionInfo(null);
}
}
use of org.vcell.util.document.VersionInfo in project vcell by virtualcell.
the class DatabaseServerImpl method getVersionInfos.
/**
* This method was created in VisualAge.
* @return GeometryInfo
* @param key KeyValue
* @exception org.vcell.util.DataAccessException The exception description.
* @exception java.rmi.RemoteException The exception description.
*/
private VersionInfo[] getVersionInfos(User user, KeyValue key, VersionableType vType, boolean bAll, boolean bCheckPermission) throws DataAccessException {
try {
if (lg.isTraceEnabled())
lg.trace("DatabaseServerImpl.getVersionInfos(User=" + user + ",vType=" + vType + ",bAll=" + bAll + ")");
Vector<VersionInfo> vector = dbTop.getVersionableInfos(user, key, vType, bAll, bCheckPermission, true);
if (vType.equals(VersionableType.BioModelMetaData)) {
BioModelInfo[] bioModelInfos = new BioModelInfo[vector.size()];
vector.copyInto(bioModelInfos);
return bioModelInfos;
} else if (vType.equals(VersionableType.Geometry)) {
GeometryInfo[] geoInfos = new GeometryInfo[vector.size()];
vector.copyInto(geoInfos);
return geoInfos;
} else if (vType.equals(VersionableType.MathModelMetaData)) {
MathModelInfo[] mathInfos = new MathModelInfo[vector.size()];
vector.copyInto(mathInfos);
return mathInfos;
} else if (vType.equals(VersionableType.VCImage)) {
VCImageInfo[] imgInfos = new VCImageInfo[vector.size()];
vector.copyInto(imgInfos);
return imgInfos;
} else if (vType.equals(VersionableType.Simulation)) {
SimulationInfo[] simInfos = new SimulationInfo[vector.size()];
vector.copyInto(simInfos);
return simInfos;
} else {
throw new IllegalArgumentException("Wrong VersinableType vType:" + vType);
}
} catch (SQLException e) {
lg.error(e.getMessage(), e);
throw new DataAccessException(e.getMessage());
} catch (ObjectNotFoundException e) {
lg.error(e.getMessage(), e);
throw new ObjectNotFoundException(e.getMessage());
} catch (Throwable e) {
lg.error(e.getMessage(), e);
throw new DataAccessException(e.getMessage());
}
}
use of org.vcell.util.document.VersionInfo in project vcell by virtualcell.
the class DatabaseServerImpl method groupAddUser.
/**
* This method was created in VisualAge.
* @return void
* @param key KeyValue
* @exception org.vcell.util.DataAccessException The exception description.
* @exception java.rmi.RemoteException The exception description.
*/
public VersionInfo groupAddUser(User user, VersionableType vType, KeyValue key, String addUserToGroup, boolean isHidden) throws DataAccessException, ObjectNotFoundException {
try {
if (lg.isTraceEnabled())
lg.trace("DatabaseServerImpl.groupAddUser(vType=" + vType.getTypeName() + ", Key=" + key + ", userToAdd=" + addUserToGroup + ", isHidden=" + isHidden + ")");
dbTop.groupAddUser(user, vType, key, true, addUserToGroup, isHidden);
VersionInfo newVersionInfo = (VersionInfo) (dbTop.getVersionableInfos(user, key, vType, false, true, true).elementAt(0));
return newVersionInfo;
} catch (SQLException e) {
lg.error(e.getMessage(), e);
throw new DataAccessException(e.getMessage());
} catch (ObjectNotFoundException e) {
lg.error(e.getMessage(), e);
throw new ObjectNotFoundException(e.getMessage());
} catch (Throwable e) {
lg.error(e.getMessage(), e);
throw new DataAccessException(e.getMessage());
}
}
Aggregations