com.aspose.slides

Interfaces

Classes

Exceptions

com.aspose.slides

Interface IShape

    • Method Detail

      • isTextHolder

        boolean isTextHolder()

        Determines whether the shape is TextHolder. Read-only boolean.

      • addPlaceholder

        IPlaceholder addPlaceholder(IPlaceholder placeholderToCopyFrom)

        Adds a new placeholder if there is no and sets placeholder properties to a specified one.

        Parameters:
        placeholderToCopyFrom - Placeholder to copy content from.
        Returns:
        New IPlaceholder.
      • removePlaceholder

        void removePlaceholder()

        Defines that this shape isn't a placeholder.

      • getRawFrame

        IShapeFrame getRawFrame()

        Returns or sets the raw shape frame's properties. Read/write IShapeFrame.


        Code that attempts to assign undefined frame to IShape.getFrame() doesn't make sense in general case (particularly in case when parent GroupShape is multiple nested into other GroupShape-s). For example: {code}IShape shape = ...; shape.setFrame(new ShapeFrame(Float.NaN, Float.NaN, Float.NaN, Float.NaN, NullableBool.NotDefined, NullableBool.NotDefined, Float.NaN));{code} or {code}slide.getShapes().addAutoShape(ShapeType.RoundCornerRectangle, Float.NaN, Float.NaN, Float.NaN, Float.NaN);{code} Such code can lead to unclear situations. So restrictions had been added for using undefined values for IShape.getFrame(). Values of x, y, width, height, flipH, flipV and rotationAngle must be defined (not Float.NaN or NullableBool.NotDefined). Example code above now throws ArgumentException exception. This applies to these use cases: {code}IShape shape = ...; shape.setFrame(...); // cannot be undefined IShapeCollection shapes = ...; // x, y, width, height parameters cannot be Float.NaN: { shapes.addAudioFrameCD(...); shapes.addAudioFrameEmbedded(...); shapes.addAudioFrameLinked(...); shapes.addAutoShape(...); shapes.addChart(...); shapes.addConnector(...); shapes.addOleObjectFrame(...); shapes.addPictureFrame(...); shapes.addSmartArt(...); shapes.addTable(...); shapes.addVideoFrame(...); shapes.insertAudioFrameEmbedded(...); shapes.insertAudioFrameLinked(...); shapes.insertAutoShape(...); shapes.insertChart(...); shapes.insertConnector(...); shapes.insertOleObjectFrame(...); shapes.insertPictureFrame(...); shapes.insertTable(...); shapes.insertVideoFrame(...); }{code} But IShape.getRawFrame() frame properties can be undefined. This make sense when shape is linked to placeholder. Then undefined shape frame values is overridden from the parent placeholder shape. If there is no parent placeholder shape for that shape then that shape uses default values when it evaluates effective frame based on its IShape.getRawFrame(). Default values are 0 and NullableBool.False for x, y, width, height, flipH, flipV and rotationAngle. For example: {code}IShape shape = ...; // shape is linked to placeholder shape.setRawFrame(new ShapeFrame(Float.NaN, Float.NaN, 100, Float.NaN, NullableBool.NotDefined, NullableBool.NotDefined, 0)); // now shape inherits x, y, height, flipH, flipV values form placeholder and overrides width=100 and rotationAngle=0.{code}
      • setRawFrame

        void setRawFrame(IShapeFrame value)

        Returns or sets the raw shape frame's properties. Read/write IShapeFrame.


        Code that attempts to assign undefined frame to IShape.getFrame() doesn't make sense in general case (particularly in case when parent GroupShape is multiple nested into other GroupShape-s). For example: {code}IShape shape = ...; shape.setFrame(new ShapeFrame(Float.NaN, Float.NaN, Float.NaN, Float.NaN, NullableBool.NotDefined, NullableBool.NotDefined, Float.NaN));{code} or {code}slide.getShapes().addAutoShape(ShapeType.RoundCornerRectangle, Float.NaN, Float.NaN, Float.NaN, Float.NaN);{code} Such code can lead to unclear situations. So restrictions had been added for using undefined values for IShape.getFrame(). Values of x, y, width, height, flipH, flipV and rotationAngle must be defined (not Float.NaN or NullableBool.NotDefined). Example code above now throws ArgumentException exception. This applies to these use cases: {code}IShape shape = ...; shape.setFrame(...); // cannot be undefined IShapeCollection shapes = ...; // x, y, width, height parameters cannot be Float.NaN: { shapes.addAudioFrameCD(...); shapes.addAudioFrameEmbedded(...); shapes.addAudioFrameLinked(...); shapes.addAutoShape(...); shapes.addChart(...); shapes.addConnector(...); shapes.addOleObjectFrame(...); shapes.addPictureFrame(...); shapes.addSmartArt(...); shapes.addTable(...); shapes.addVideoFrame(...); shapes.insertAudioFrameEmbedded(...); shapes.insertAudioFrameLinked(...); shapes.insertAutoShape(...); shapes.insertChart(...); shapes.insertConnector(...); shapes.insertOleObjectFrame(...); shapes.insertPictureFrame(...); shapes.insertTable(...); shapes.insertVideoFrame(...); }{code} But IShape.getRawFrame() frame properties can be undefined. This make sense when shape is linked to placeholder. Then undefined shape frame values is overridden from the parent placeholder shape. If there is no parent placeholder shape for that shape then that shape uses default values when it evaluates effective frame based on its IShape.getRawFrame(). Default values are 0 and NullableBool.False for x, y, width, height, flipH, flipV and rotationAngle. For example: {code}IShape shape = ...; // shape is linked to placeholder shape.setRawFrame(new ShapeFrame(Float.NaN, Float.NaN, 100, Float.NaN, NullableBool.NotDefined, NullableBool.NotDefined, 0)); // now shape inherits x, y, height, flipH, flipV values form placeholder and overrides width=100 and rotationAngle=0.{code}
      • getFrame

        IShapeFrame getFrame()

        Returns or sets the shape frame's properties. Read/write IShapeFrame.


        Value of each property of the returned IShapeFrame instance is not undefined (is not NaN or NotDefined). Value of each property of the assigned IShapeFrame instance must be not undefined (must be not NaN or NotDefined). You can set undefined values for RawFrame instance properties.
      • setFrame

        void setFrame(IShapeFrame value)

        Returns or sets the shape frame's properties. Read/write IShapeFrame.


        Value of each property of the returned IShapeFrame instance is not undefined (is not NaN or NotDefined). Value of each property of the assigned IShapeFrame instance must be not undefined (must be not NaN or NotDefined). You can set undefined values for RawFrame instance properties.
      • getLineFormat

        ILineFormat getLineFormat()

        Returns the LineFormat object that contains line formatting properties for a shape. Read-only ILineFormat.

      • getThreeDFormat

        IThreeDFormat getThreeDFormat()

        Returns the ThreeDFormat object that contains line formatting properties for a shape. Read-only IThreeDFormat.

      • getEffectFormat

        IEffectFormat getEffectFormat()

        Returns the EffectFormat object which contains pixel effects applied to a shape. Read-only IEffectFormat.

      • getFillFormat

        IFillFormat getFillFormat()

        Returns the FillFormat object that contains fill formatting properties for a shape. Read-only IFillFormat.

      • createLineFormatEffective

        @Deprecated
        ILineFormatEffectiveData createLineFormatEffective()
        Deprecated. Use LineFormat.GetEffective() instead. The method will be removed after release of version 20.8.

        Creates the LineFormatEffectiveData object that contains all line formatting properties for a shape, included inherited.

        Returns:
        ILineFormatEffectiveData.
      • createFillFormatEffective

        @Deprecated
        IFillFormatEffectiveData createFillFormatEffective()
        Deprecated. Use FillFormat.GetEffective() instead. The method will be removed after release of version 20.8.

        Creates the FillFormatEffectiveData object that contains all fill formatting properties for a shape, included inherited.

        Returns:
        IFillFormatEffectiveData.
      • createEffectFormatEffective

        @Deprecated
        IEffectFormatEffectiveData createEffectFormatEffective()
        Deprecated. Use EffectFormat.GetEffective() instead. The method will be removed after release of version 20.8.

        Creates the EffectFormatEffectiveData object that contains all effects applyed to a shape, included inherited.

        Returns:
        IEffectFormatEffectiveData.
      • createThreeDFormatEffective

        @Deprecated
        IThreeDFormatEffectiveData createThreeDFormatEffective()
        Deprecated. Use ThreeDFormatFormat.GetEffective() instead. The method will be removed after release of version 20.8.

        Creates the ThreeDFormatEffectiveData object that contains volume properties and 3D transformation of a shape, included inherited.

        Returns:
        IThreeDFormatEffectiveData.
      • getThumbnail

        android.graphics.Bitmap getThumbnail()

        Returns shape thumbnail. ShapeThumbnailBounds.Shape shape thumbnail bounds type is used by default.

        Returns:
        Shape thumbnail.
      • getThumbnail

        android.graphics.Bitmap getThumbnail(int bounds,
                                             float scaleX,
                                             float scaleY)

        Returns shape thumbnail.

        Parameters:
        bounds - Shape thumbnail bounds type.
        scaleX - X scale
        scaleY - Y scale
        Returns:
        Shape thumbnail or null in case when ShapeThumbnailBounds.Appearance is used and a shape doesn't have visible elements.
      • getHidden

        boolean getHidden()

        Determines whether the shape is hidden. Read/write boolean.

      • setHidden

        void setHidden(boolean value)

        Determines whether the shape is hidden. Read/write boolean.

      • getZOrderPosition

        int getZOrderPosition()

        Returns the position of a shape in the z-order. Shapes[0] returns the shape at the back of the z-order, and Shapes[Shapes.Count - 1] returns the shape at the front of the z-order. Read-only int.

      • getConnectionSiteCount

        int getConnectionSiteCount()

        Returns the number of connection sites on the shape. Read-only int.

      • getRotation

        float getRotation()

        Returns or sets the number of degrees the specified shape is rotated around the z-axis. A positive value indicates clockwise rotation; a negative value indicates counterclockwise rotation. Read/write float.


        Returned value is always defined (is not Float.NaN). Assigned value must be defined (not Float.NaN). You can set undefined values for RawFrame instance properties.
      • setRotation

        void setRotation(float value)

        Returns or sets the number of degrees the specified shape is rotated around the z-axis. A positive value indicates clockwise rotation; a negative value indicates counterclockwise rotation. Read/write float.


        Returned value is always defined (is not Float.NaN). Assigned value must be defined (not Float.NaN). You can set undefined values for RawFrame instance properties.
      • getX

        float getX()

        Returns or sets the x-coordinate of the upper-left corner of the shape. Read/write float.


        Returned value is always defined (is not Float.NaN). Assigned value must be defined (not Float.NaN). You can set undefined values for RawFrame instance properties.
      • setX

        void setX(float value)

        Returns or sets the x-coordinate of the upper-left corner of the shape. Read/write float.


        Returned value is always defined (is not Float.NaN). Assigned value must be defined (not Float.NaN). You can set undefined values for RawFrame instance properties.
      • getY

        float getY()

        Returns or sets the y-coordinate of the upper-left corner of the shape. Read/write float.


        Returned value is always defined (is not Float.NaN). Assigned value must be defined (not Float.NaN). You can set undefined values for RawFrame instance properties.
      • setY

        void setY(float value)

        Returns or sets the y-coordinate of the upper-left corner of the shape. Read/write float.


        Returned value is always defined (is not Float.NaN). Assigned value must be defined (not Float.NaN). You can set undefined values for RawFrame instance properties.
      • getWidth

        float getWidth()

        Returns or sets the width of the shape. Read/write float.


        Returned value is always defined (is not Float.NaN). Assigned value must be defined (not Float.NaN). You can set undefined values for RawFrame instance properties.
      • setWidth

        void setWidth(float value)

        Returns or sets the width of the shape. Read/write float.


        Returned value is always defined (is not Float.NaN). Assigned value must be defined (not Float.NaN). You can set undefined values for RawFrame instance properties.
      • getHeight

        float getHeight()

        Returns or sets the height of the shape. Read/write float.


        Returned value is always defined (is not Float.NaN). Assigned value must be defined (not Float.NaN). You can set undefined values for RawFrame instance properties.
      • setHeight

        void setHeight(float value)

        Returns or sets the height of the shape. Read/write float.


        Returned value is always defined (is not Float.NaN). Assigned value must be defined (not Float.NaN). You can set undefined values for RawFrame instance properties.
      • getAlternativeText

        java.lang.String getAlternativeText()

        Returns or sets the alternative text associated with a shape. Read/write String.

      • setAlternativeText

        void setAlternativeText(java.lang.String value)

        Returns or sets the alternative text associated with a shape. Read/write String.

      • getAlternativeTextTitle

        java.lang.String getAlternativeTextTitle()

        Returns or sets the title of alternative text associated with a shape. Read/write String.

      • setAlternativeTextTitle

        void setAlternativeTextTitle(java.lang.String value)

        Returns or sets the title of alternative text associated with a shape. Read/write String.

      • getName

        java.lang.String getName()

        Returns or sets the name of a shape. Read/write String.

      • setName

        void setName(java.lang.String value)

        Returns or sets the name of a shape. Read/write String.

      • getUniqueId

        long getUniqueId()

        Gets unique shape identifier in presentation scope. Read-only long. See also OfficeInteropShapeId(getOfficeInteropShapeId()) for getting unique shape identifier in slide scope.

      • getOfficeInteropShapeId

        long getOfficeInteropShapeId()

        Gets unique shape identifier in slide scope. Read-only long. See also UniqueId(getUniqueId()) for getting unique shape identifier in presentation scope.

      • isGrouped

        boolean isGrouped()

        Determines whether the shape is grouped. Read-only boolean.


        Property ParentGroup(getParentGroup()) returns parent GroupShape object if shape is grouped.
      • getBlackWhiteMode

        byte getBlackWhiteMode()

        Property specifies how a shape will render in black-and-white display mode.. Read/write BlackWhiteMode.

      • setBlackWhiteMode

        void setBlackWhiteMode(byte value)

        Property specifies how a shape will render in black-and-white display mode.. Read/write BlackWhiteMode.

      • getParentGroup

        IGroupShape getParentGroup()

        Returns parent GroupShape object if shape is grouped. Otherwise returns null. Read-only IGroupShape.


        Property IsGrouped(isGrouped()) determines whether the shape is grouped.
      • writeAsSvg

        void writeAsSvg(java.io.OutputStream stream)

        Saves content of Shape as SVG file.

        Parameters:
        stream - Target stream
      • writeAsSvg

        void writeAsSvg(java.io.OutputStream stream,
                        ISVGOptions svgOptions)

        Saves content of Shape as SVG file.

        Parameters:
        stream - Target stream
        svgOptions - SVG generation options