Class FolderWrapper

    • 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

      • setName

        public void setName​(java.lang.String name)
        Sets the name of the folder.
        Parameters:
        name - The name of the folder. Mustn't be null.
        Throws:
        java.lang.IllegalArgumentException - If the name is null.
      • 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.