Class Annotation

  • All Implemented Interfaces:
    Element

    public class Annotation
    extends java.lang.Object
    implements Element
    An Annotation is a little note that can be added to a page on a document.
    See Also:
    Element, Anchor
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private Annotation​(float llx, float lly, float urx, float ury)
      Constructs an Annotation with a certain title and some text.
        Annotation​(float llx, float lly, float urx, float ury, int named)
      Constructs an Annotation.
        Annotation​(float llx, float lly, float urx, float ury, java.lang.String url)
      Constructs an Annotation.
        Annotation​(float llx, float lly, float urx, float ury, java.lang.String file, int page)
      Constructs an Annotation.
        Annotation​(float llx, float lly, float urx, float ury, java.lang.String file, java.lang.String dest)
      Constructs an Annotation.
        Annotation​(float llx, float lly, float urx, float ury, java.lang.String moviePath, java.lang.String mimeType, boolean showOnDisplay)
      Creates a Screen annotation to embed media clips
        Annotation​(float llx, float lly, float urx, float ury, java.lang.String application, java.lang.String parameters, java.lang.String operation, java.lang.String defaultdir)
      Constructs an Annotation.
        Annotation​(float llx, float lly, float urx, float ury, java.net.URL url)
      Constructs an Annotation.
        Annotation​(Annotation an)
      Copy constructor.
        Annotation​(java.lang.String title, java.lang.String text)
      Constructs an Annotation with a certain title and some text.
        Annotation​(java.lang.String title, java.lang.String text, float llx, float lly, float urx, float ury)
      Constructs an Annotation with a certain title and some text.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int annotationType()
      Returns the type of this Annotation.
      java.util.HashMap<java.lang.String,​java.lang.Object> attributes()
      Gets the content of this Annotation.
      java.lang.String content()
      Gets the content of this Annotation.
      java.util.List<Chunk> getChunks()
      Gets all the chunks in this element.
      boolean isContent()
      Checks if this element is a content object.
      boolean isNestable()
      Checks if this element is nestable.
      float llx()
      Returns the lower left x-value.
      float llx​(float def)
      Returns the lower left x-value.
      float lly()
      Returns the lower left y-value.
      float lly​(float def)
      Returns the lower left y-value.
      boolean process​(ElementListener listener)
      Processes the element by adding it (or the different parts) to an ElementListener.
      void setDimensions​(float llx, float lly, float urx, float ury)
      Sets the dimensions of this annotation.
      java.lang.String title()
      Returns the title of this Annotation.
      int type()
      Gets the type of the text element.
      float urx()
      Returns the upper right x-value.
      float urx​(float def)
      Returns the upper right x-value.
      float ury()
      Returns the upper right y-value.
      float ury​(float def)
      Returns the upper right y-value.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • URL_NET

        public static final int URL_NET
        This is a possible annotation type.
        See Also:
        Constant Field Values
      • URL_AS_STRING

        public static final int URL_AS_STRING
        This is a possible annotation type.
        See Also:
        Constant Field Values
      • FILE_DEST

        public static final int FILE_DEST
        This is a possible annotation type.
        See Also:
        Constant Field Values
      • FILE_PAGE

        public static final int FILE_PAGE
        This is a possible annotation type.
        See Also:
        Constant Field Values
      • NAMED_DEST

        public static final int NAMED_DEST
        This is a possible annotation type.
        See Also:
        Constant Field Values
      • LAUNCH

        public static final int LAUNCH
        This is a possible annotation type.
        See Also:
        Constant Field Values
      • SCREEN

        public static final int SCREEN
        This is a possible annotation type.
        See Also:
        Constant Field Values
      • TITLE

        public static final java.lang.String TITLE
        This is a possible attribute.
        See Also:
        Constant Field Values
      • CONTENT

        public static final java.lang.String CONTENT
        This is a possible attribute.
        See Also:
        Constant Field Values
      • URL

        public static final java.lang.String URL
        This is a possible attribute.
        See Also:
        Constant Field Values
      • FILE

        public static final java.lang.String FILE
        This is a possible attribute.
        See Also:
        Constant Field Values
      • DESTINATION

        public static final java.lang.String DESTINATION
        This is a possible attribute.
        See Also:
        Constant Field Values
      • PAGE

        public static final java.lang.String PAGE
        This is a possible attribute.
        See Also:
        Constant Field Values
      • NAMED

        public static final java.lang.String NAMED
        This is a possible attribute.
        See Also:
        Constant Field Values
      • APPLICATION

        public static final java.lang.String APPLICATION
        This is a possible attribute.
        See Also:
        Constant Field Values
      • PARAMETERS

        public static final java.lang.String PARAMETERS
        This is a possible attribute.
        See Also:
        Constant Field Values
      • OPERATION

        public static final java.lang.String OPERATION
        This is a possible attribute.
        See Also:
        Constant Field Values
      • DEFAULTDIR

        public static final java.lang.String DEFAULTDIR
        This is a possible attribute.
        See Also:
        Constant Field Values
      • LLX

        public static final java.lang.String LLX
        This is a possible attribute.
        See Also:
        Constant Field Values
      • LLY

        public static final java.lang.String LLY
        This is a possible attribute.
        See Also:
        Constant Field Values
      • URX

        public static final java.lang.String URX
        This is a possible attribute.
        See Also:
        Constant Field Values
      • URY

        public static final java.lang.String URY
        This is a possible attribute.
        See Also:
        Constant Field Values
      • MIMETYPE

        public static final java.lang.String MIMETYPE
        This is a possible attribute.
        See Also:
        Constant Field Values
      • annotationtype

        protected int annotationtype
        This is the type of annotation.
      • annotationAttributes

        protected java.util.HashMap<java.lang.String,​java.lang.Object> annotationAttributes
        This is the title of the Annotation.
      • llx

        protected float llx
        This is the lower left x-value
      • lly

        protected float lly
        This is the lower left y-value
      • urx

        protected float urx
        This is the upper right x-value
      • ury

        protected float ury
        This is the upper right y-value
    • Constructor Detail

      • Annotation

        private Annotation​(float llx,
                           float lly,
                           float urx,
                           float ury)
        Constructs an Annotation with a certain title and some text.
        Parameters:
        llx - lower left x coordinate
        lly - lower left y coordinate
        urx - upper right x coordinate
        ury - upper right y coordinate
      • Annotation

        public Annotation​(Annotation an)
        Copy constructor.
        Parameters:
        an - the annotation to create a new Annotation from
      • Annotation

        public Annotation​(java.lang.String title,
                          java.lang.String text)
        Constructs an Annotation with a certain title and some text.
        Parameters:
        title - the title of the annotation
        text - the content of the annotation
      • Annotation

        public Annotation​(java.lang.String title,
                          java.lang.String text,
                          float llx,
                          float lly,
                          float urx,
                          float ury)
        Constructs an Annotation with a certain title and some text.
        Parameters:
        title - the title of the annotation
        text - the content of the annotation
        llx - the lower left x-value
        lly - the lower left y-value
        urx - the upper right x-value
        ury - the upper right y-value
      • Annotation

        public Annotation​(float llx,
                          float lly,
                          float urx,
                          float ury,
                          java.net.URL url)
        Constructs an Annotation.
        Parameters:
        llx - the lower left x-value
        lly - the lower left y-value
        urx - the upper right x-value
        ury - the upper right y-value
        url - the external reference
      • Annotation

        public Annotation​(float llx,
                          float lly,
                          float urx,
                          float ury,
                          java.lang.String url)
        Constructs an Annotation.
        Parameters:
        llx - the lower left x-value
        lly - the lower left y-value
        urx - the upper right x-value
        ury - the upper right y-value
        url - the external reference
      • Annotation

        public Annotation​(float llx,
                          float lly,
                          float urx,
                          float ury,
                          java.lang.String file,
                          java.lang.String dest)
        Constructs an Annotation.
        Parameters:
        llx - the lower left x-value
        lly - the lower left y-value
        urx - the upper right x-value
        ury - the upper right y-value
        file - an external PDF file
        dest - the destination in this file
      • Annotation

        public Annotation​(float llx,
                          float lly,
                          float urx,
                          float ury,
                          java.lang.String moviePath,
                          java.lang.String mimeType,
                          boolean showOnDisplay)
        Creates a Screen annotation to embed media clips
        Parameters:
        llx -
        lly -
        urx -
        ury -
        moviePath - path to the media clip file
        mimeType - mime type of the media
        showOnDisplay - if true play on display of the page
      • Annotation

        public Annotation​(float llx,
                          float lly,
                          float urx,
                          float ury,
                          java.lang.String file,
                          int page)
        Constructs an Annotation.
        Parameters:
        llx - the lower left x-value
        lly - the lower left y-value
        urx - the upper right x-value
        ury - the upper right y-value
        file - an external PDF file
        page - a page number in this file
      • Annotation

        public Annotation​(float llx,
                          float lly,
                          float urx,
                          float ury,
                          int named)
        Constructs an Annotation.
        Parameters:
        llx - the lower left x-value
        lly - the lower left y-value
        urx - the upper right x-value
        ury - the upper right y-value
        named - a named destination in this file
      • Annotation

        public Annotation​(float llx,
                          float lly,
                          float urx,
                          float ury,
                          java.lang.String application,
                          java.lang.String parameters,
                          java.lang.String operation,
                          java.lang.String defaultdir)
        Constructs an Annotation.
        Parameters:
        llx - the lower left x-value
        lly - the lower left y-value
        urx - the upper right x-value
        ury - the upper right y-value
        application - an external application
        parameters - parameters to pass to this application
        operation - the operation to pass to this application
        defaultdir - the default directory to run this application in
    • Method Detail

      • type

        public int type()
        Gets the type of the text element.
        Specified by:
        type in interface Element
        Returns:
        a type
      • process

        public boolean process​(ElementListener listener)
        Processes the element by adding it (or the different parts) to an ElementListener.
        Specified by:
        process in interface Element
        Parameters:
        listener - an ElementListener
        Returns:
        true if the element was processed successfully
      • getChunks

        public java.util.List<Chunk> getChunks()
        Gets all the chunks in this element.
        Specified by:
        getChunks in interface Element
        Returns:
        an ArrayList
      • setDimensions

        public void setDimensions​(float llx,
                                  float lly,
                                  float urx,
                                  float ury)
        Sets the dimensions of this annotation.
        Parameters:
        llx - the lower left x-value
        lly - the lower left y-value
        urx - the upper right x-value
        ury - the upper right y-value
      • llx

        public float llx()
        Returns the lower left x-value.
        Returns:
        a value
      • lly

        public float lly()
        Returns the lower left y-value.
        Returns:
        a value
      • urx

        public float urx()
        Returns the upper right x-value.
        Returns:
        a value
      • ury

        public float ury()
        Returns the upper right y-value.
        Returns:
        a value
      • llx

        public float llx​(float def)
        Returns the lower left x-value.
        Parameters:
        def - the default value
        Returns:
        a value
      • lly

        public float lly​(float def)
        Returns the lower left y-value.
        Parameters:
        def - the default value
        Returns:
        a value
      • urx

        public float urx​(float def)
        Returns the upper right x-value.
        Parameters:
        def - the default value
        Returns:
        a value
      • ury

        public float ury​(float def)
        Returns the upper right y-value.
        Parameters:
        def - the default value
        Returns:
        a value
      • annotationType

        public int annotationType()
        Returns the type of this Annotation.
        Returns:
        a type
      • title

        public java.lang.String title()
        Returns the title of this Annotation.
        Returns:
        a name
      • content

        public java.lang.String content()
        Gets the content of this Annotation.
        Returns:
        a reference
      • attributes

        public java.util.HashMap<java.lang.String,​java.lang.Object> attributes()
        Gets the content of this Annotation.
        Returns:
        a reference
      • isContent

        public boolean isContent()
        Description copied from interface: Element
        Checks if this element is a content object. If not, it's a metadata object.
        Specified by:
        isContent in interface Element
        Returns:
        true if this is a 'content' element; false if this is a 'metadata' element
        Since:
        iText 2.0.8
        See Also:
        Element.isContent()
      • isNestable

        public boolean isNestable()
        Description copied from interface: Element
        Checks if this element is nestable.
        Specified by:
        isNestable in interface Element
        Returns:
        true if this element can be nested inside other elements.
        Since:
        iText 2.0.8
        See Also:
        Element.isNestable()