use of cbit.image.VCImageInfo in project vcell by virtualcell.
the class ImageDbTreeModel method createBaseTree.
/**
* Insert the method's description here.
* Creation date: (11/28/00 1:06:51 PM)
* @return cbit.vcell.desktop.BioModelNode
* @param docManager cbit.vcell.clientdb.DocumentManager
*/
private BioModelNode createBaseTree() throws DataAccessException {
VCImageInfo[] imageInfos = getDocumentManager().getImageInfos();
BioModelNode rootRootNode = new BioModelNode("Images", true);
//
// get list of users (owners)
//
Vector<User> ownerList = new Vector<User>();
ownerList.addElement(getDocumentManager().getUser());
for (int i = 0; i < imageInfos.length; i++) {
VCImageInfo imageInfo = imageInfos[i];
if (!ownerList.contains(imageInfo.getVersion().getOwner())) {
ownerList.addElement(imageInfo.getVersion().getOwner());
}
}
//
// for each user
//
TreeMap<String, BioModelNode> treeMap = new TreeMap<String, BioModelNode>();
for (int ownerIndex = 0; ownerIndex < ownerList.size(); ownerIndex++) {
User owner = (User) ownerList.elementAt(ownerIndex);
BioModelNode ownerNode = createOwnerSubTree(owner);
if (owner.equals(getDocumentManager().getUser()) || ownerNode.getChildCount() > 0) {
treeMap.put(owner.getName().toLowerCase(), ownerNode);
}
}
//
rootRootNode.add((BioModelNode) treeMap.remove(getDocumentManager().getUser().getName().toLowerCase()));
BioModelNode otherUsersNode = new BioModelNode("Images Neighborhood", true);
rootRootNode.add(otherUsersNode);
Object[] bmnArr = treeMap.values().toArray();
for (int i = 0; i < bmnArr.length; i += 1) {
otherUsersNode.add((BioModelNode) bmnArr[i]);
}
return rootRootNode;
}
use of cbit.image.VCImageInfo 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 cbit.image.VCImageInfo in project vcell by virtualcell.
the class ImageTable method getInfo.
/**
* This method was created in VisualAge.
* @return VCImage
* @param rset ResultSet
* @param log SessionLog
*/
public VersionInfo getInfo(ResultSet rset, Connection con, DatabaseSyntax dbSyntax) throws SQLException, DataAccessException {
GIFImage gifImage = null;
try {
// gifImage = new GIFImage(rset.getBytes(BrowseImageDataTable.table.data.toString()));
byte[] gifData = (byte[]) DbDriver.getLOB(rset, BrowseImageDataTable.table.data, dbSyntax);
gifImage = new GIFImage(gifData);
//
} catch (GifParsingException e) {
throw new DataAccessException("Error Parsing browseImage");
}
java.math.BigDecimal groupid = rset.getBigDecimal(VersionTable.privacy_ColumnName);
Version version = getVersion(rset, DbDriver.getGroupAccessFromGroupID(con, groupid));
int x = rset.getInt(ImageTable.table.numX.toString());
int y = rset.getInt(ImageTable.table.numY.toString());
int z = rset.getInt(ImageTable.table.numZ.toString());
org.vcell.util.ISize size = new org.vcell.util.ISize(x, y, z);
double extentX = rset.getBigDecimal(ExtentTable.table.extentX.toString()).doubleValue();
double extentY = rset.getBigDecimal(ExtentTable.table.extentY.toString()).doubleValue();
double extentZ = rset.getBigDecimal(ExtentTable.table.extentZ.toString()).doubleValue();
org.vcell.util.Extent extent = new org.vcell.util.Extent(extentX, extentY, extentZ);
String softwareVersion = rset.getString(SoftwareVersionTable.table.softwareVersion.toString());
return new VCImageInfo(version, size, extent, gifImage, VCellSoftwareVersion.fromString(softwareVersion));
}
use of cbit.image.VCImageInfo in project vcell by virtualcell.
the class ClientDocumentManager method setGroupPrivate.
/**
* Insert the method's description here.
* Creation date: (11/28/00 5:43:44 PM)
* @param bioModelInfo cbit.vcell.biomodel.BioModelInfo
*/
public VCImageInfo setGroupPrivate(VCImageInfo imageInfo) throws DataAccessException {
try {
//
// unpublish from database
//
VCImageInfo newImageInfo = (VCImageInfo) setGroupPrivate0(imageInfo, VersionableType.VCImage, imgInfoHash);
//
// delete Image from cache
//
xmlHash.remove(imageInfo.getVersion().getVersionKey());
fireDatabaseUpdate(new DatabaseEvent(this, DatabaseEvent.UPDATE, imageInfo, newImageInfo));
return newImageInfo;
} catch (RemoteProxyException e) {
handleRemoteProxyException(e);
throw new DataAccessException(e.getMessage());
}
}
use of cbit.image.VCImageInfo in project vcell by virtualcell.
the class ClientDocumentManager method removeUserFromGroup.
/**
* Insert the method's description here.
* Creation date: (11/28/00 5:43:44 PM)
* @param bioModelInfo cbit.vcell.biomodel.BioModelInfo
*/
public VCImageInfo removeUserFromGroup(VCImageInfo imageInfo, String userToRemove) throws DataAccessException {
try {
//
// publish from database
//
VCImageInfo newImageInfo = (VCImageInfo) removeUserFromGroup0(imageInfo, VersionableType.VCImage, imgInfoHash, userToRemove);
//
// delete Image from cache
//
xmlHash.remove(imageInfo.getVersion().getVersionKey());
fireDatabaseUpdate(new DatabaseEvent(this, DatabaseEvent.UPDATE, imageInfo, newImageInfo));
return newImageInfo;
} catch (RemoteProxyException e) {
handleRemoteProxyException(e);
throw new DataAccessException(e.getMessage());
}
}
Aggregations