Class Annotations


  • public class Annotations
    extends Object
    Helper class for various annotation related information, like permission checks or retrieval of annotation collections.
    • Constructor Detail

      • Annotations

        public Annotations()
    • Method Detail

      • getDeletedAnnotations

        public static Collection<Annotation> getDeletedAnnotations​(Page page)
        To a given Page retrieve the list of annotations that have been deleted from the initial set of annotations which was sent from the server to the client
        Parameters:
        page - the Page containing possibly deleted Annotation objects
        Returns:
        the list of deleted Annotation objects
      • getDeletedAnnotations

        public static Collection<Annotation> getDeletedAnnotations​(Document document)
        To a given Document retrieve the list of annotations that have been deleted from the initial set of annotations which was sent from the server to the client
        Parameters:
        document - the Document containing possibly deleted Annotation objects
        Returns:
        the list of deleted Annotation objects
      • isModified

        public static boolean isModified​(Page page)
        Checks whether the annotations on the given page were modified after loading it from the server.

        Only modifications regarding annotations are tracked - like adding, deleting or changing annotations. Modifications referring to the base document (rotation, zoom, ...) do not qualify for a modification.

        Parameters:
        page - A Page that may contain Annotation objects
        Returns:
        true if any of the page's annotations was modified after loading it from the server
      • isModified

        public static boolean isModified​(Document document)
        Checks whether the annotations on the given document were modified after loading it from the server.

        Only modifications regarding annotations are tracked - like adding, deleting or changing annotations. Modifications referring to the base document (rotation, zoom, ...) do not qualify for a modification.

        Parameters:
        document - A Document that may contain Annotations on its Pages
        Returns:
        true if any of the document's annotations was modified after loading it from the server
      • clearModified

        public static void clearModified​(Page page)
        Clear the modified state of all Annotations on the Page.
        Parameters:
        page - a Page which may contains Annotations.
      • isAnnotationPageSegment

        public boolean isAnnotationPageSegment​(PageSegment pageSegment)
        Check if the given PageSegment is an AnnotationPageSegment
        Parameters:
        pageSegment - the PageSegment to be checked
        Returns:
        true if the PageSegment is an AnnotationPageSegment; else false
      • getRelativeAnnotationBoundsInPixel

        @Deprecated
        public static Rectangle getRelativeAnnotationBoundsInPixel​(PageView pageView,
                                                                   Annotation annotation,
                                                                   com.levigo.jadice.web.shared.model.annotation.internal.AnnotationPageSegment pageSegment)
        Deprecated.
        Returns the Bounds of the given Annotation in Pixel. The Bounds are relative to the viewer unlike Annotation.getBounds() which are relative to the Page containing the Annotation and given in jadice document units.
        Parameters:
        pageView - the PageView
        annotation - the annotation
        pageSegment - the AnnotationPageSegment which contains the Annotation
        Returns:
        the bounds of the annotation
      • getRelativeAnnotationBoundsInPixel

        public static Rectangle getRelativeAnnotationBoundsInPixel​(PageView pageView,
                                                                   Annotation annotation,
                                                                   Page page)
        Returns the Bounds of the given Annotation in Pixel. The Bounds are relative to the viewer unlike Annotation.getBounds() which are relative to the Page containing the Annotation and given in jadice document units.
        Parameters:
        pageView - the PageView
        annotation - the annotation
        page - the Page which contains the Annotation
        Returns:
        the bounds of the annotation
      • getAnnotationBoundsInPixel

        public static Rectangle getAnnotationBoundsInPixel​(PageView pageView,
                                                           Annotation annotation,
                                                           Page page)
        Returns the Bounds of the given Annotation in Pixel. The Bounds are absolute inside of the viewer unlike Annotation.getBounds() which are relative to the Page containing the Annotation and given in jadice document units.
        Parameters:
        pageView - the PageView
        annotation - the annotation
        page - the Page which contains the Annotation
        Returns:
        the bounds of the annotation
      • getAnnotationPageSegment

        public static com.levigo.jadice.web.shared.model.annotation.internal.AnnotationPageSegment getAnnotationPageSegment​(Page page,
                                                                                                                            String profileId)
        Returns the AnnotationPageSegment for passed page. If no AnnotationPageSegment exists, a new AnnotationPageSegment is created and added to the page.
        Parameters:
        page - The page where the page segment resides in
        profileId - The id of the used AnnotationProfile
        Returns:
        Either the found AnnotationPageSegment or the newly created.