Class AnnotationPageSegment

  • All Implemented Interfaces:
    ConditionFactoryProvider, com.levigo.jadice.document.internal.ModCountingPageSegment, com.levigo.jadice.document.internal.PageAwarePageSegment, com.levigo.jadice.document.internal.presentation.group.DynamicPresentationInitializer, com.levigo.jadice.document.internal.presentation.group.PresentationInitializer, com.levigo.jadice.document.internal.presentation.group.VisualizationInitializer, 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.presentation.group.DynamicPresentationInitializer, com.levigo.jadice.document.internal.ModCountingPageSegment
    A page segment which holds annotations
    • Constructor Detail

      • AnnotationPageSegment

        public AnnotationPageSegment()
    • Method Detail

      • deleteAnnotation

        public void deleteAnnotation​(Annotation annotation)
        Remove the given annotation.
      • deleteAnnotations

        public void deleteAnnotations​(Collection<Annotation> annotation)
        Remove the given annotations.
      • 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
      • getModCount

        public int getModCount()
        Deprecated.
        Do not use this method. It is not part of the jadice document platform public API.
        Description copied from interface: com.levigo.jadice.document.internal.ModCountingPageSegment
        Get the number of page segment modifications since its creation. A modification occurs when the contents of a PageSegment are modified.
        Specified by:
        getModCount in interface com.levigo.jadice.document.internal.ModCountingPageSegment
        Returns:
        number of page segment modifications
      • getInitialized

        public com.levigo.jadice.document.internal.presentation.group.TransparencyGroupContainer getInitialized()
        Description copied from class: AbstractPageSegment
        Caveat: this method is not part of the public API.
        Specified by:
        getInitialized in interface com.levigo.jadice.document.internal.presentation.group.PresentationInitializer
        Overrides:
        getInitialized in class AbstractPageSegment
      • initialize

        public com.levigo.jadice.document.internal.presentation.group.TransparencyGroupContainer initialize​(RenderControls controls)
        Specified by:
        initialize in interface com.levigo.jadice.document.internal.presentation.group.DynamicPresentationInitializer
      • 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,
                                                                                                List<com.levigo.jadice.document.internal.condition.PresentationElementCondition> conditions)
        Description copied from interface: com.levigo.jadice.document.internal.text.TextContentFactory
        If the factory provides the text content based on the presentation tree the given conditions shall be applied while traversing it.
        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)
        Description copied from interface: com.levigo.jadice.document.internal.text.TextContentFactory
        Return whether this factory is eligible for the given page segment and the given priority. Whether a factory is eligible in a given situation may be a rather complex decision. For instance an OCR-based factory may refuse to become active at low priorities given the high cost of performing an OCR. However it may find that it already has a cached result for the page segment causing it to spring into action at a lower priority already.
        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)
      • getResolution

        public Resolution getResolution()
        Description copied from class: AbstractPageSegment
        Return the resolution of the page segment (in DPI).

        Some PageSegments return just the base resolution as their native resolution. PageSegments with pixel data return the actual pixel resolution they can provide. This information is used to hint e.g. the printer about the maximum resolution a page segment can produce.

        Specified by:
        getResolution in class AbstractPageSegment
        Returns:
        This PageSegment's resolution