com.levigo.jadice.annotation
Class AnnotationPageSegment

java.lang.Object
  extended by com.levigo.jadice.document.AbstractPageSegment
      extended by com.levigo.jadice.document.AbstractMutablePageSegment
          extended by com.levigo.jadice.annotation.AnnotationPageSegment
All Implemented Interfaces:
com.levigo.jadice.document.internal.model.DynamicRenderRoot, com.levigo.jadice.document.internal.model.RenderRoot, com.levigo.jadice.document.internal.PageAwarePageSegment, com.levigo.jadice.document.internal.text.TextContentFactory, MetadataProvider, MutablePageSegment, PageSegment, PermissionsProvider<PageSegment>, PropertiesProvider, Identifiable

public class AnnotationPageSegment
extends AbstractMutablePageSegment
implements com.levigo.jadice.document.internal.PageAwarePageSegment, com.levigo.jadice.document.internal.text.TextContentFactory, com.levigo.jadice.document.internal.model.DynamicRenderRoot

A page segment which holds annotations


Nested Class Summary
 
Nested classes/interfaces inherited from class com.levigo.jadice.document.AbstractPageSegment
AbstractPageSegment.CacheableRendering
 
Field Summary
 
Fields inherited from class com.levigo.jadice.document.AbstractPageSegment
CACHE_KEY_CONTENTS, format, id
 
Constructor Summary
AnnotationPageSegment()
           
AnnotationPageSegment(PageSegmentSource source)
           
 
Method Summary
 void addAnnotation(Annotation newAnno)
          Adds an existing annotation if not already present in this AnnotationPageSegment instance.
 com.levigo.jadice.document.internal.model.RenderElement createRendering()
          Caveat: this method is not part of the public API.
 com.levigo.jadice.document.internal.model.RenderElement createRendering(RenderControls controls)
           
 void deleteAnnotation(Annotation annotation)
          Remove the given annotation.
 void deleteAnnotations(Collection<Annotation> annotation)
          Remove the given annotations.
protected  AbstractPageSegment.CacheableRendering doCreateCacheableRendering()
           
protected  AbstractPageSegment.CacheableRendering doCreateCacheableRendering(RenderControls controls)
           
 AnnotationProfile getAnnotationProfile()
           
static
<A extends Annotation>
AnnotationRenderer<A>
getAnnotationRenderer(A annotation)
          Deprecated. Do not use. With the next major release this method will not be available as part of the public API any longer.
 List<Annotation> getAnnotations()
          Returns a collection of all annotations.
protected  AbstractPageSegment.CacheableRendering getCachedRendering(RenderControls controls)
           
 Collection<Annotation> getDeletedAnnotations()
          Returns a collection of all deleted annotations.
 Dimension getPageResolution()
          Returns the horizontal and vertical resolution.
 com.levigo.jadice.document.internal.Qualification getQualification(PageSegment pageSegment)
           
 Dimension2D getSize()
          Returns the raw size/dimensions of the PageSegment in base units.
 com.levigo.jadice.document.internal.text.TextContentRequestResult getTextContent(PageSegment ps, Rectangle2D roi)
           
 boolean isAuxiliary()
          Return whether this PageSegment is in some way "auxiliary".
 boolean isEligible(PageSegment s, Rectangle2D roi, com.levigo.jadice.document.internal.text.TextContentServiceInternal.Priority priority)
           
 void setAnnotationProfile(AnnotationProfile annotationProfile)
          Deprecated. Should not be used, profile will be set via AnnotationPageSegment addAnnotation(Annotation) method.
 void setCurrentPage(Page page)
          Integrator warning: this method is an implementation of an internal interface.
 void toBack(Collection<Annotation> a)
          Move the selected annotations to the back of the rendering list.
 void toFront(Collection<Annotation> a)
          Move the selected annotations to the front of the rendering list.
 String toString()
          Description of this page segment instances
 
Methods inherited from class com.levigo.jadice.document.AbstractMutablePageSegment
addPageSegmentListener, createPageSegmentEvent, fireModified, fireModified, fireModified, removePageSegmentListener
 
Methods inherited from class com.levigo.jadice.document.AbstractPageSegment
getBounds, getCachedRendering, getId, getMetadata, getPermissions, getProperties, getResolution, getSource, isInitialized, setSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.levigo.jadice.document.PageSegment
getBounds, getSource
 
Methods inherited from interface com.levigo.jadice.document.util.PropertiesProvider
getProperties
 
Methods inherited from interface com.levigo.jadice.document.metadata.MetadataProvider
getMetadata
 
Methods inherited from interface com.levigo.jadice.document.PermissionsProvider
getPermissions
 
Methods inherited from interface com.levigo.util.base.Identifiable
getId
 
Methods inherited from interface com.levigo.jadice.document.internal.model.RenderRoot
getBounds, isInitialized
 

Constructor Detail

AnnotationPageSegment

public AnnotationPageSegment()

AnnotationPageSegment

public AnnotationPageSegment(PageSegmentSource source)
Method Detail

addAnnotation

public void addAnnotation(Annotation newAnno)
Adds an existing annotation if not already present in this AnnotationPageSegment instance.

Parameters:
newAnno -
Throws:
IllegalArgumentException - if the given annotation already belongs to an other AnnotationPageSegment. In such a case remove the annotation from its AnnotationPageSegment before adding it to this AnnotationPageSegment instance.

getSize

public Dimension2D getSize()
Description copied from interface: PageSegment
Returns the raw size/dimensions of the PageSegment in base units.

Specified by:
getSize in interface PageSegment
Overrides:
getSize in class AbstractPageSegment
Returns:
the PageSegment's raw size

deleteAnnotation

public void deleteAnnotation(Annotation annotation)
Remove the given annotation.

Parameters:
annotation -

deleteAnnotations

public void deleteAnnotations(Collection<Annotation> annotation)
Remove the given annotations.

Parameters:
annotation -

toFront

public void toFront(Collection<Annotation> a)
Move the selected annotations to the front of the rendering list.


toBack

public void toBack(Collection<Annotation> a)
Move the selected annotations to the back of the rendering list.


getAnnotations

public List<Annotation> getAnnotations()
Returns a collection of all annotations.
Caveat: for performance reasons, the returned collection is mutable and does not represent a copy of the internal collection of annotations. Modifications to this collection are possible and allowed, but must be done carefully.

Returns:
Collection a collection of contained annotations

getDeletedAnnotations

public Collection<Annotation> getDeletedAnnotations()
Returns a collection of all deleted annotations.
Caveat: for performance reasons, the returned collection is mutable and does not represent a copy of the internal collection of annotations. Modifications to this collection are possible and allowed, but must be done carefully.

Returns:
Collection a collection of deleted annotations

getPageResolution

public Dimension getPageResolution()
Returns the horizontal and vertical resolution.

Returns:
Dimension containing the horizontal and vertical resolution

toString

public String toString()
Description copied from class: AbstractPageSegment
Description of this page segment instances

Overrides:
toString in class AbstractPageSegment
See Also:
Object.toString()

getAnnotationRenderer

@Deprecated
public static <A extends Annotation> AnnotationRenderer<A> getAnnotationRenderer(A annotation)
Deprecated. Do not use. With the next major release this method will not be available as part of the public API any longer.


createRendering

public com.levigo.jadice.document.internal.model.RenderElement createRendering()
Description copied from class: AbstractPageSegment
Caveat: this method is not part of the public API.

Specified by:
createRendering in interface com.levigo.jadice.document.internal.model.RenderRoot
Overrides:
createRendering in class AbstractPageSegment
See Also:
RenderRoot.createRendering()

getCachedRendering

protected AbstractPageSegment.CacheableRendering getCachedRendering(RenderControls controls)

createRendering

public com.levigo.jadice.document.internal.model.RenderElement createRendering(RenderControls controls)
Specified by:
createRendering in interface com.levigo.jadice.document.internal.model.DynamicRenderRoot

doCreateCacheableRendering

protected AbstractPageSegment.CacheableRendering doCreateCacheableRendering()
                                                                     throws JadiceException
Overrides:
doCreateCacheableRendering in class AbstractPageSegment
Throws:
JadiceException

doCreateCacheableRendering

protected AbstractPageSegment.CacheableRendering doCreateCacheableRendering(RenderControls controls)
                                                                     throws JadiceException
Throws:
JadiceException

setAnnotationProfile

@Deprecated
public void setAnnotationProfile(AnnotationProfile annotationProfile)
Deprecated. Should not be used, profile will be set via AnnotationPageSegment addAnnotation(Annotation) method.

Parameters:
annotationProfile - the annotationProfile to set

getAnnotationProfile

public AnnotationProfile getAnnotationProfile()
Returns:
the annotationProfile

isAuxiliary

public boolean isAuxiliary()
Description copied from interface: PageSegment
Return whether this PageSegment is in some way "auxiliary". Auxiliary page segments contain additions to the main page segment, but rarely represent the main page content in their own right. Currently most page segments are non-auxiliary except for the AnnotationPageSegment.

Specified by:
isAuxiliary in interface PageSegment
Overrides:
isAuxiliary in class AbstractPageSegment
Returns:
true if this page segment is auxiliary, false if it represents "main" page content.

getTextContent

public com.levigo.jadice.document.internal.text.TextContentRequestResult getTextContent(PageSegment ps,
                                                                                        Rectangle2D roi)
Specified by:
getTextContent in interface com.levigo.jadice.document.internal.text.TextContentFactory

getQualification

public com.levigo.jadice.document.internal.Qualification getQualification(PageSegment pageSegment)
Specified by:
getQualification in interface com.levigo.jadice.document.internal.text.TextContentFactory

isEligible

public boolean isEligible(PageSegment s,
                          Rectangle2D roi,
                          com.levigo.jadice.document.internal.text.TextContentServiceInternal.Priority priority)
Specified by:
isEligible in interface com.levigo.jadice.document.internal.text.TextContentFactory

setCurrentPage

public void setCurrentPage(Page page)
Integrator warning: this method is an implementation of an internal interface. Do not use.

Specified by:
setCurrentPage in interface com.levigo.jadice.document.internal.PageAwarePageSegment
See Also:
PageAwarePageSegment.setCurrentPage(com.levigo.jadice.document.Page)


Copyright © 1995-2020 levigo holding gmbh. All Rights Reserved.