com.aspose.slides

Interfaces

Classes

Exceptions

com.aspose.slides

Interface ICommentCollection

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method and Description
      IComment addComment(java.lang.String text, ISlide slide, java.awt.geom.Point2D.Float position, java.util.Date creationTime)
      Add new comment at the end of a collection.
      IModernComment addModernComment(java.lang.String text, ISlide slide, IShape shape, java.awt.geom.Point2D.Float position, java.util.Date creationTime)
      Add new modern comment at the end of a collection.
      void clear()
      Removes all comments from a collection.
      IComment get_Item(int index)
      Gets the element at the specified index.
      IComment insertComment(int index, java.lang.String text, ISlide slide, java.awt.geom.Point2D.Float position, java.util.Date creationTime)
      Insert new comment to a collection at the specified index.
      IModernComment insertModernComment(int index, java.lang.String text, ISlide slide, IShape shape, java.awt.geom.Point2D.Float position, java.util.Date creationTime)
      Insert new modern comment to a collection at the specified index.
      void remove(IComment comment)
      Removes the first occurrence of the specified comment in a collection.
      void removeAt(int index)
      Removes the element at the specified index in a collection.
      IComment[] toArray()
      Creates and returns an array with all comments.
      IComment[] toArray(int startIndex, int count)
      Creates and returns an array with all comments from the specified range.
      • Methods inherited from interface com.aspose.ms.System.Collections.Generic.IGenericEnumerable

        iterator
      • Methods inherited from interface com.aspose.ms.System.Collections.ICollection

        copyTo, getSyncRoot, isSynchronized, size
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Method Detail

      • get_Item

        IComment get_Item(int index)

        Gets the element at the specified index. Read-only IComment.

      • addComment

        IComment addComment(java.lang.String text,
                            ISlide slide,
                            java.awt.geom.Point2D.Float position,
                            java.util.Date creationTime)

        Add new comment at the end of a collection.

        Parameters:
        text - Plain text of a new comment.
        slide - Slide in a presentation where to add a new comment.
        position - Position on a slide where to add a new comment.
        creationTime - Time of a comment creation.
        Returns:
        Added comment.
      • addModernComment

        IModernComment addModernComment(java.lang.String text,
                                        ISlide slide,
                                        IShape shape,
                                        java.awt.geom.Point2D.Float position,
                                        java.util.Date creationTime)

        Add new modern comment at the end of a collection.


         
         Presentation pres = new Presentation();
         try {
             ICommentAuthor newAuthor = pres.getCommentAuthors().addAuthor("Some Author", "SA");
             newAuthor.getComments().addModernComment("This is modern comment", pres.getSlides().get_Item(0), null, new Point2D.Float(100, 100), new Date());
             pres.save(outPptxFileName, SaveFormat.Pptx);
         } finally {
             if (pres != null) pres.dispose();
         }
         
        Parameters:
        text - Plain text of a new modern comment.
        slide - Slide in a presentation where to add a new modern comment.
        shape - Shape on a slide to which a new modern comment is associated.
        position - Position on a slide where to add a new modern comment.
        creationTime - Time of a modern comment creation.
        Returns:
        Added modern comment.
      • insertComment

        IComment insertComment(int index,
                               java.lang.String text,
                               ISlide slide,
                               java.awt.geom.Point2D.Float position,
                               java.util.Date creationTime)

        Insert new comment to a collection at the specified index.

        Parameters:
        index - Index of the element in a collection at which comment should be inserted.
        text - Plain text of a new comment.
        slide - Slide in a presentation where to add a new comment.
        position - Position on a slide where to add a new comment.
        creationTime - Time of a comment creation.
        Returns:
        Inserted comment.
      • insertModernComment

        IModernComment insertModernComment(int index,
                                           java.lang.String text,
                                           ISlide slide,
                                           IShape shape,
                                           java.awt.geom.Point2D.Float position,
                                           java.util.Date creationTime)

        Insert new modern comment to a collection at the specified index.

        Parameters:
        index - Index of the element in a collection at which modern comment should be inserted.
        text - Plain text of a new modern comment.
        slide - Slide in a presentation where to add a new modern comment.
        shape - Shape on a slide to which a new modern comment is associated.
        position - Position on a slide where to add a new modern comment.
        creationTime - Time of a modern comment creation.
        Returns:
        Inserted modern comment.
      • toArray

        IComment[] toArray()

        Creates and returns an array with all comments.

        Returns:
        Array of IComment.
      • toArray

        IComment[] toArray(int startIndex,
                           int count)

        Creates and returns an array with all comments from the specified range.

        Parameters:
        startIndex - An index of a first comment to return.
        count - A number of comments to return.
        Returns:
        Array of IComment.
      • removeAt

        void removeAt(int index)

        Removes the element at the specified index in a collection.

        Parameters:
        index - The zero-based index of the element to remove.
        Throws:
        com.aspose.ms.System.ArgumentOutOfRangeException - Index is less than 0 or index is equal or greater than Count
        PptxEditException - Thrown if comment is already removed.
      • remove

        void remove(IComment comment)

        Removes the first occurrence of the specified comment in a collection.

        Parameters:
        comment - The comment to remove from a collection.
        Throws:
        com.aspose.ms.System.ArgumentNullException - If comment is null
        PptxEditException - Thrown if comment is already removed.
      • clear

        void clear()

        Removes all comments from a collection.