Package fr.igred.omero.repository
Class FolderWrapper
- java.lang.Object
-
- fr.igred.omero.GenericObjectWrapper<T>
-
- fr.igred.omero.AnnotatableWrapper<T>
-
- fr.igred.omero.repository.GenericRepositoryObjectWrapper<FolderData>
-
- fr.igred.omero.repository.FolderWrapper
-
public class FolderWrapper extends GenericRepositoryObjectWrapper<FolderData>
Class containing a FolderData object.Wraps function calls to the FolderData contained.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class fr.igred.omero.repository.GenericRepositoryObjectWrapper
GenericRepositoryObjectWrapper.ReplacePolicy
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringANNOTATION_LINKAnnotation link name for this type of object-
Fields inherited from class fr.igred.omero.GenericObjectWrapper
data
-
-
Constructor Summary
Constructors Constructor Description FolderWrapper(Client client, java.lang.String name)Constructor of the FolderWrapper class.FolderWrapper(FolderData folder)Constructor of the FolderWrapper class.FolderWrapper(Folder folder)Constructor of the FolderWrapper class.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddChild(FolderWrapper folder)Adds a child folder to this folder.voidaddChildren(java.util.Collection<? extends FolderWrapper> folders)Adds children folders to this folder.voidaddImages(Client client, ImageWrapper... images)Links images to the folder in OMERO.voidaddROI(Client client, ROIWrapper roi)Deprecated.Adds an ROI to the folder and associate it to the image id set(an image need to be associated)voidaddROIs(Client client, long imageId, ROIWrapper... rois)Adds ROIs to the folder and associate them to the provided image ID.voidaddROIs(Client client, ImageWrapper image, ROIWrapper... rois)Adds ROIs to the folder and associate them to the provided image.protected java.lang.StringannotationLinkType()Returns the type of annotation link for this object.FolderDataasFolderData()Deprecated.Gets the folder contained in the FolderWrapper.java.util.List<FolderWrapper>getChildren()Retrieves the children folders for this folder.java.lang.StringgetDescription()Gets the folder descriptionjava.util.List<ImageWrapper>getImages()Retrieves the images contained in this folder.java.util.List<ImageWrapper>getImages(Client client)Retrieves the images contained in this folder.java.lang.StringgetName()Gets the name of the folderFolderWrappergetParent()Retrieves the parent folders for this folder.java.util.List<ROIWrapper>getROIs(Client client)Deprecated.Gets the ROI contained in the folder associated with the image id set (an image need to be associated)java.util.List<ROIWrapper>getROIs(Client client, long imageId)Gets the ROIs contained in the folder associated with the provided image ID.java.util.List<ROIWrapper>getROIs(Client client, ImageWrapper image)Gets the ROIs contained in the folder associated with the provided image.protected <A extends AnnotationData>
voidlink(Client client, A annotation)Adds an annotation to the object in OMERO, if possible.voidreload(Client client)Reloads the folder from OMERO, to update all links.voidsetDescription(java.lang.String description)Sets the description of the folder.voidsetImage(long id)Deprecated.Sets the image associated to the foldervoidsetImage(ImageWrapper image)Deprecated.Sets the image associated to the foldervoidsetName(java.lang.String name)Sets the name of the folder.voidsetParent(FolderWrapper folder)Sets the parent folder for this folder.voidunlinkAllROI(Client client)Deprecated.Unlink all ROI, associated to the image set, in the folder.voidunlinkAllROIs(Client client)Unlink all ROIs associated to this folder.voidunlinkAllROIs(Client client, long imageId)Unlink all ROIs associated to the provided image ID from the folder.voidunlinkAllROIs(Client client, ImageWrapper image)Unlink all ROIs associated to the provided image from the folder.voidunlinkROI(Client client, ROIWrapper roi)Deprecated.Unlink an ROI, associated to the image set, in the folder.voidunlinkROIs(Client client, ROIWrapper... rois)Unlink ROIs from the folder.-
Methods inherited from class fr.igred.omero.repository.GenericRepositoryObjectWrapper
copyAnnotationLinks, importImage, importImages
-
Methods inherited from class fr.igred.omero.AnnotatableWrapper
addAndReplaceFile, addAndReplaceFile, addAndReplaceTable, addAndReplaceTable, addFile, addFileAnnotation, addKeyValuePair, addMapAnnotation, addPairKeyValue, addTable, addTag, addTag, addTag, addTags, addTags, copyAnnotationLinks, getAnnotations, getFileAnnotations, getKeyValuePairs, getMapAnnotations, getMyRating, getTable, getTables, getTags, getValue, isLinked, link, link, linkIfNotLinked, rate, removeLink, unlink
-
Methods inherited from class fr.igred.omero.GenericObjectWrapper
asDataObject, canAnnotate, canChgrp, canChown, canDelete, canEdit, canLink, delete, distinct, flatten, getCreated, getGroupId, getId, getOwner, saveAndUpdate, toString, wrap, wrap
-
-
-
-
Field Detail
-
ANNOTATION_LINK
public static final java.lang.String ANNOTATION_LINK
Annotation link name for this type of object- See Also:
- Constant Field Values
-
-
Constructor Detail
-
FolderWrapper
public FolderWrapper(FolderData folder)
Constructor of the FolderWrapper class.- Parameters:
folder- The FolderData to wrap.
-
FolderWrapper
public FolderWrapper(Folder folder)
Constructor of the FolderWrapper class.- Parameters:
folder- Folder to contain.
-
FolderWrapper
public FolderWrapper(Client client, java.lang.String name) throws ServiceException, OMEROServerError
Constructor of the FolderWrapper class. Save the folder in OMERO- Parameters:
client- The client handling the connection.name- Name of the folder.- Throws:
ServiceException- Cannot connect to OMERO.OMEROServerError- Server error.
-
-
Method Detail
-
annotationLinkType
protected java.lang.String annotationLinkType()
Returns the type of annotation link for this object.- Specified by:
annotationLinkTypein classAnnotatableWrapper<FolderData>- Returns:
- See above.
-
link
protected <A extends AnnotationData> void link(Client client, A annotation) throws ServiceException, AccessException, java.util.concurrent.ExecutionException
Adds an annotation to the object in OMERO, if possible.- Overrides:
linkin classAnnotatableWrapper<FolderData>- Type Parameters:
A- The type of the annotation.- Parameters:
client- The client handling the connection.annotation- Annotation to be added.- Throws:
ServiceException- Cannot connect to OMERO.AccessException- Cannot access data.java.util.concurrent.ExecutionException- A Facility can't be retrieved or instantiated.
-
getName
public java.lang.String getName()
Gets the name of the folder- Specified by:
getNamein classGenericRepositoryObjectWrapper<FolderData>- Returns:
- name.
-
setName
public void setName(java.lang.String name)
Sets the name of the folder.- Parameters:
name- The name of the folder. Mustn't benull.- Throws:
java.lang.IllegalArgumentException- If the name isnull.
-
asFolderData
@Deprecated public FolderData asFolderData()
Deprecated.Gets the folder contained in the FolderWrapper. UseGenericObjectWrapper.asDataObject()instead.- Returns:
- the FolderData.
-
getDescription
public java.lang.String getDescription()
Gets the folder description- Specified by:
getDescriptionin classGenericRepositoryObjectWrapper<FolderData>- Returns:
- The folder description.
-
setDescription
public void setDescription(java.lang.String description)
Sets the description of the folder.- Parameters:
description- The folder description.
-
reload
public void reload(Client client) throws AccessException, ServiceException, java.util.concurrent.ExecutionException
Reloads the folder from OMERO, to update all links.- Parameters:
client- The client handling the connection.- Throws:
AccessException- Cannot access data.ServiceException- Cannot connect to OMERO.java.util.concurrent.ExecutionException- A Facility can't be retrieved or instantiated.
-
getParent
public FolderWrapper getParent()
Retrieves the parent folders for this folder.- Returns:
- See above
-
setParent
public void setParent(FolderWrapper folder)
Sets the parent folder for this folder.- Parameters:
folder- The new parent folder.
-
addChild
public void addChild(FolderWrapper folder)
Adds a child folder to this folder.- Parameters:
folder- The new child folder.
-
addChildren
public void addChildren(java.util.Collection<? extends FolderWrapper> folders)
Adds children folders to this folder.- Parameters:
folders- The new children folders.
-
getChildren
public java.util.List<FolderWrapper> getChildren()
Retrieves the children folders for this folder.- Returns:
- See above
-
addImages
public void addImages(Client client, ImageWrapper... images) throws ServiceException, AccessException, java.util.concurrent.ExecutionException
Links images to the folder in OMERO.- Parameters:
client- The client handling the connection.images- Images to add.- Throws:
ServiceException- Cannot connect to OMERO.AccessException- Cannot access data.java.util.concurrent.ExecutionException- A Facility can't be retrieved or instantiated.
-
getImages
public java.util.List<ImageWrapper> getImages()
Retrieves the images contained in this folder.- Returns:
- See above
-
getImages
public java.util.List<ImageWrapper> getImages(Client client) throws AccessException, ServiceException, java.util.concurrent.ExecutionException
Retrieves the images contained in this folder.- Parameters:
client- The client handling the connection.- Returns:
- See above
- Throws:
ServiceException- Cannot connect to OMERO.AccessException- Cannot access data.java.util.concurrent.ExecutionException- A Facility can't be retrieved or instantiated.
-
setImage
@Deprecated public void setImage(long id)
Deprecated.Sets the image associated to the folder- Parameters:
id- ID of the image to associate.
-
setImage
@Deprecated public void setImage(ImageWrapper image)
Deprecated.Sets the image associated to the folder- Parameters:
image- Image to associate.
-
addROI
@Deprecated public void addROI(Client client, ROIWrapper roi) throws ServiceException, AccessException, java.util.concurrent.ExecutionException
Deprecated.Adds an ROI to the folder and associate it to the image id set(an image need to be associated)- Parameters:
client- The client handling the connection.roi- ROI to add.- Throws:
ServiceException- Cannot connect to OMERO.AccessException- Cannot access data.java.util.concurrent.ExecutionException- If the ROIFacility can't be retrieved or instantiated.
-
addROIs
public void addROIs(Client client, long imageId, ROIWrapper... rois) throws ServiceException, AccessException, java.util.concurrent.ExecutionException
Adds ROIs to the folder and associate them to the provided image ID.- Parameters:
client- The client handling the connection.imageId- The image ID.rois- ROIs to add.- Throws:
ServiceException- Cannot connect to OMERO.AccessException- Cannot access data.java.util.concurrent.ExecutionException- If the ROIFacility can't be retrieved or instantiated.
-
addROIs
public void addROIs(Client client, ImageWrapper image, ROIWrapper... rois) throws ServiceException, AccessException, java.util.concurrent.ExecutionException
Adds ROIs to the folder and associate them to the provided image.- Parameters:
client- The client handling the connection.image- The image.rois- ROIs to add.- Throws:
ServiceException- Cannot connect to OMERO.AccessException- Cannot access data.java.util.concurrent.ExecutionException- If the ROIFacility can't be retrieved or instantiated.
-
getROIs
@Deprecated public java.util.List<ROIWrapper> getROIs(Client client) throws ServiceException, AccessException, java.util.concurrent.ExecutionException
Deprecated.Gets the ROI contained in the folder associated with the image id set (an image need to be associated)- Parameters:
client- The client handling the connection.- Returns:
- List of ROIWrapper containing the ROI.
- Throws:
ServiceException- Cannot connect to OMERO.AccessException- Cannot access data.java.util.concurrent.ExecutionException- A Facility can't be retrieved or instantiated.
-
getROIs
public java.util.List<ROIWrapper> getROIs(Client client, long imageId) throws ServiceException, AccessException, java.util.concurrent.ExecutionException
Gets the ROIs contained in the folder associated with the provided image ID.- Parameters:
client- The client handling the connection.imageId- The image.- Returns:
- See above.
- Throws:
ServiceException- Cannot connect to OMERO.AccessException- Cannot access data.java.util.concurrent.ExecutionException- A Facility can't be retrieved or instantiated.
-
getROIs
public java.util.List<ROIWrapper> getROIs(Client client, ImageWrapper image) throws ServiceException, AccessException, java.util.concurrent.ExecutionException
Gets the ROIs contained in the folder associated with the provided image.- Parameters:
client- The client handling the connection.image- The image.- Returns:
- See above.
- Throws:
ServiceException- Cannot connect to OMERO.AccessException- Cannot access data.java.util.concurrent.ExecutionException- A Facility can't be retrieved or instantiated.
-
unlinkAllROI
@Deprecated public void unlinkAllROI(Client client) throws ServiceException, AccessException, java.util.concurrent.ExecutionException
Deprecated.Unlink all ROI, associated to the image set, in the folder. ROIs are now linked to the image directly- Parameters:
client- The client handling the connection.- Throws:
ServiceException- Cannot connect to OMERO.AccessException- Cannot access data.java.util.concurrent.ExecutionException- A Facility can't be retrieved or instantiated.
-
unlinkAllROIs
public void unlinkAllROIs(Client client, long imageId) throws ServiceException, AccessException, java.util.concurrent.ExecutionException
Unlink all ROIs associated to the provided image ID from the folder.ROIs are now linked to the image directly.
- Parameters:
client- The client handling the connection.imageId- The image ID.- Throws:
ServiceException- Cannot connect to OMERO.AccessException- Cannot access data.java.util.concurrent.ExecutionException- A Facility can't be retrieved or instantiated.
-
unlinkAllROIs
public void unlinkAllROIs(Client client, ImageWrapper image) throws ServiceException, AccessException, java.util.concurrent.ExecutionException
Unlink all ROIs associated to the provided image from the folder.ROIs are now linked to the image directly.
- Parameters:
client- The client handling the connection.image- The image.- Throws:
ServiceException- Cannot connect to OMERO.AccessException- Cannot access data.java.util.concurrent.ExecutionException- A Facility can't be retrieved or instantiated.
-
unlinkAllROIs
public void unlinkAllROIs(Client client) throws ServiceException, AccessException, java.util.concurrent.ExecutionException
Unlink all ROIs associated to this folder.The folder must be loaded beforehand.
ROIs are now linked to their images directly.
- Parameters:
client- The client handling the connection.- Throws:
ServiceException- Cannot connect to OMERO.AccessException- Cannot access data.java.util.concurrent.ExecutionException- A Facility can't be retrieved or instantiated.
-
unlinkROI
@Deprecated public void unlinkROI(Client client, ROIWrapper roi) throws ServiceException, AccessException, java.util.concurrent.ExecutionException
Deprecated.Unlink an ROI, associated to the image set, in the folder. The ROI is now linked to the image directly.- Parameters:
client- The client handling the connection.roi- ROI to unlink.- Throws:
ServiceException- Cannot connect to OMERO.AccessException- Cannot access data.java.util.concurrent.ExecutionException- A Facility can't be retrieved or instantiated.
-
unlinkROIs
public void unlinkROIs(Client client, ROIWrapper... rois) throws ServiceException, AccessException, java.util.concurrent.ExecutionException
Unlink ROIs from the folder.The ROIs are now linked to the image directly.
- Parameters:
client- The data manager.rois- ROI to unlink.- Throws:
ServiceException- Cannot connect to OMERO.AccessException- Cannot access data.java.util.concurrent.ExecutionException- A Facility can't be retrieved or instantiated.
-
-