Class Annotations
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
clearModified
(Document document) Clear the modified state of allAnnotation
s on theDocument
.static void
clearModified
(Page page) Clear the modified state of allAnnotation
s on thePage
.static Rectangle
getAnnotationBoundsInPixel
(PageView pageView, Annotation annotation, Page page) Returns the Bounds of the givenAnnotation
in Pixel.static List
<AnnotationCustomizer> AList
of all registeredannotation customizers
.static com.levigo.jadice.web.shared.model.annotation.internal.AnnotationPageSegment
getAnnotationPageSegment
(Page page, String profileId) Returns theAnnotationPageSegment
for passed page.static Collection
<Annotation> getAnnotations
(Document document) Retrieves the list of annotations in the whole givenDocument
.static Collection
<Annotation> getAnnotations
(Page page) Retrieves the list of annotations lying in thePageSegment
corresponding to the givenPage
.static Collection
<Annotation> getAnnotations
(Page page, DocumentLayer documentLayer) Retrieves the list of annotations lying in the correspondingPageSegment
for a givenPage
andDocumentLayer
.static Collection
<Annotation> getDeletedAnnotations
(Document document) To a givenDocument
retrieve the list of annotations that have been deleted from the initial set of annotations which was sent from the server to the clientstatic Collection
<Annotation> getDeletedAnnotations
(Page page) To a givenPage
retrieve the list of annotations that have been deleted from the initial set of annotations which was sent from the server to the clientstatic Collection
<Annotation> getDeletedAnnotations
(Page page, DocumentLayer documentLayer) To a givenPage
andDocumentLayer
retrieve the list of annotations that have been deleted from the initial set of annotations which was sent from the server to the clientstatic Rectangle
getRelativeAnnotationBoundsInPixel
(PageView pageView, Annotation annotation, Page page) Returns the Bounds of the givenAnnotation
in Pixel.static Rectangle
getRelativeAnnotationBoundsInPixel
(PageView pageView, Annotation annotation, com.levigo.jadice.web.shared.model.annotation.internal.AnnotationPageSegment pageSegment) Deprecated.boolean
isAnnotationPageSegment
(Page page, DocumentLayer documentLayer) boolean
isAnnotationPageSegment
(PageSegment pageSegment) Check if the givenPageSegment
is anAnnotationPageSegment
static boolean
isModified
(Document document) Checks whether the annotations on the given document were modified after loading it from the server.static boolean
isModified
(Page page) Checks whether the annotations on the given page were modified after loading it from the server.
-
Constructor Details
-
Annotations
public Annotations()
-
-
Method Details
-
getAnnotationCustomizers
AList
of all registeredannotation customizers
.This
List
is intentionally writable to allow the registration and deregistration of customAnnotationCustomizer
implementations.The registered
annotation customizers
will all be executed duringannotation
creation by theAnnotationTool
. Execution of the registeredannotation customizers
will be in insertion order of theList
.AnnotationCustomizer
implementations shall be aware that they might encounter differentAnnotation
types as all customizers will be executed regardless of the actualAnnotation
type.- Returns:
- the
AnnotationCustomizer
objects
-
getDeletedAnnotations
To a givenPage
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
- thePage
containing possibly deletedAnnotation
objects- Returns:
- the list of deleted
Annotation
objects
-
getDeletedAnnotations
To a givenPage
andDocumentLayer
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
- thePage
containing possibly deletedAnnotation
objectsdocumentLayer
- theDocumentLayer
defining thePageSegment
where theAnnotation
objects lie in- Returns:
- the list of deleted
Annotation
objects
-
getDeletedAnnotations
To a givenDocument
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
- theDocument
containing possibly deletedAnnotation
objects- Returns:
- the list of deleted
Annotation
objects
-
getAnnotations
Retrieves the list of annotations lying in thePageSegment
corresponding to the givenPage
.- Parameters:
page
- thePage
containing possibly deletedAnnotation
objects- Returns:
- the list of
Annotation
objects
-
getAnnotations
Retrieves the list of annotations in the whole givenDocument
.- Parameters:
document
- theDocument
containingAnnotation
objects.- Returns:
- the list of
Annotation
objects in theDocument
.
-
getAnnotations
Retrieves the list of annotations lying in the correspondingPageSegment
for a givenPage
andDocumentLayer
.- Parameters:
page
- thePage
containingAnnotation
objectsdocumentLayer
- theDocumentLayer
defining thePageSegment
where theAnnotation
objects lie in- Returns:
- the list of
Annotation
objects
-
isModified
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
- APage
that may containAnnotation
objects- Returns:
- true if any of the page's annotations was modified after loading it from the server
-
isModified
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
- ADocument
that may containAnnotation
s on itsPage
s- Returns:
- true if any of the document's annotations was modified after loading it from the server
-
clearModified
Clear the modified state of allAnnotation
s on theDocument
.- Parameters:
document
- aDocument
which may containsAnnotation
s.
-
clearModified
Clear the modified state of allAnnotation
s on thePage
.- Parameters:
page
- aPage
which may containsAnnotation
s.
-
isAnnotationPageSegment
- Parameters:
page
- thePage
containing thePageSegment
documentLayer
- theDocumentLayer
containing thePageSegment
in question- Returns:
- true if the
PageSegment
is anAnnotationPageSegment
; else false
-
isAnnotationPageSegment
Check if the givenPageSegment
is anAnnotationPageSegment
- Parameters:
pageSegment
- thePageSegment
to be checked- Returns:
- true if the
PageSegment
is anAnnotationPageSegment
; else false
-
getRelativeAnnotationBoundsInPixel
public static Rectangle getRelativeAnnotationBoundsInPixel(PageView pageView, Annotation annotation, Page page) Returns the Bounds of the givenAnnotation
in Pixel. The Bounds are relative to the viewer unlikeAnnotation.getBounds()
which are relative to the Page containing the Annotation and given in jadice document units. -
getAnnotationBoundsInPixel
public static Rectangle getAnnotationBoundsInPixel(PageView pageView, Annotation annotation, Page page) Returns the Bounds of the givenAnnotation
in Pixel. The Bounds are absolute inside of the viewer unlikeAnnotation.getBounds()
which are relative to the Page containing the Annotation and given in jadice document units. -
getAnnotationPageSegment
public static com.levigo.jadice.web.shared.model.annotation.internal.AnnotationPageSegment getAnnotationPageSegment(Page page, String profileId) Returns theAnnotationPageSegment
for passed page. If noAnnotationPageSegment
exists, a newAnnotationPageSegment
is created and added to the page.- Parameters:
page
- The page where the page segment resides inprofileId
- The id of the usedAnnotationProfile
- Returns:
- Either the found
AnnotationPageSegment
or the newly created.
-