com.aspose.slides
Class Shape

java.lang.Object
  extended by com.aspose.slides.Shape
All Implemented Interfaces:
IHyperlinkContainer, IPresentationComponent, IShape, ISlideComponent
Direct Known Subclasses:
GeometryShape, GraphicalObject, GroupShape

public class Shape
extends java.lang.Object
implements IShape

Represents a shape on a slide.


Method Summary
 IPlaceholder addPlaceholder(IPlaceholder placeholderToCopyFrom)
           Adds a new placeholder if there is no and sets placeholder properties to a specified one.
 IEffectFormatEffectiveData createEffectFormatEffective()
           Creates the EffectFormatData object that contains all effects applyed to a shape, included inherited.
 IFillFormatEffectiveData createFillFormatEffective()
           Creates the FillFormatData object that contains all fill formatting properties for a shape, included inherited.
 ILineFormatEffectiveData createLineFormatEffective()
           Creates the LineFormatData object that contains all line formatting properties for a shape, included inherited.
 IThreeDFormatEffectiveData createThreeDFormatEffective()
           Creates the ThreeDFormatData object that contains volume properties and 3D transformation of a shape, included inherited.
 java.lang.String getAlternativeText()
           Returns or sets the alternative text associated with a shape.
 ICustomData getCustomData()
           Returns the shape's custom data.
 IEffectFormat getEffectFormat()
           Returns the EffectFormat object which contains pixel effects applied to a shape.
 IFillFormat getFillFormat()
           Returns the FillFormat object that contains fill formatting properties for a shape.
 IShapeFrame getFrame()
           Returns or sets the shape frame's properties.
 float getHeight()
           Returns or sets the height of the shape.
 boolean getHidden()
           Determines whether the shape is hidden.
 Hyperlink getHLinkClick()
          Deprecated. 
 Hyperlink getHLinkMouseOver()
          Deprecated. 
 IHyperlink getHyperlinkClick()
           Returns or sets the hyperlink defined for mouse click.
 IHyperlinkManager getHyperlinkManager()
           
 IHyperlink getHyperlinkMouseOver()
           Returns or sets the hyperlink defined for mouse over.
 ILineFormat getLineFormat()
           Returns the LineFormat object that contains line formatting properties for a shape.
 java.lang.String getName()
           Returns or sets the name of a shape.
 IGroupShape getParentGroup()
           Returns parent GroupShape object if shape is grouped.
 IPlaceholder getPlaceholder()
           Returns the placeholder for a shape.
 IPresentation getPresentation()
           Returns the parent presentation of a slide.
 IShapeFrame getRawFrame()
           Returns or sets the raw shape frame's properties.
 float getRotation()
           Returns or sets the number of degrees the specified shape is rotated around the z-axis.
 IBaseShapeLock getShapeLock()
           Returns shape's locks.
 IBaseSlide getSlide()
           Returns the parent slide of a shape.
 ITagCollection getTags()
          Deprecated. 
 IThreeDFormat getThreeDFormat()
           Returns the ThreeDFormat object that 3d effect properties for a shape.
 java.awt.image.BufferedImage getThumbnail()
           
 java.awt.image.BufferedImage getThumbnail(int bounds, float scaleX, float scaleY)
           
 long getUniqueId()
           Gets unique shape identifier in presentation scope.
 float getWidth()
           Returns or sets the width of the shape.
 float getX()
           Returns or sets the x-coordinate of the upper-left corner of the shape.
 float getY()
           Returns or sets the y-coordinate of the upper-left corner of the shape.
 int getZOrderPosition()
           Returns the position of a shape in the z-order.
 boolean isGrouped()
           Determines whether the shape is grouped.
 boolean isTextHolder()
           Determines whether the shape is TextHolder_PPT.
 void removePlaceholder()
           Defines that this shape isn't a placeholder.
 void setAlternativeText(java.lang.String value)
           
 void setFrame(IShapeFrame value)
           
 void setHeight(float value)
           
 void setHidden(boolean value)
           
 void setHLinkClick(Hyperlink value)
          Deprecated. 
 void setHLinkMouseOver(Hyperlink value)
          Deprecated. 
 void setHyperlinkClick(IHyperlink value)
           
 void setHyperlinkMouseOver(IHyperlink value)
           
 void setName(java.lang.String value)
           
 void setRawFrame(IShapeFrame value)
           
 void setRotation(float value)
           
 void setWidth(float value)
           
 void setX(float value)
           
 void setY(float value)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isTextHolder

public boolean isTextHolder()

Determines whether the shape is TextHolder_PPT. Read-only bool.

Specified by:
isTextHolder in interface IShape

getPlaceholder

public IPlaceholder getPlaceholder()

Returns the placeholder for a shape. Returns null if the shape has no placeholder. Read-only Placeholder.

Specified by:
getPlaceholder in interface IShape

removePlaceholder

public void removePlaceholder()

Defines that this shape isn't a placeholder.

Specified by:
removePlaceholder in interface IShape

addPlaceholder

public IPlaceholder addPlaceholder(IPlaceholder placeholderToCopyFrom)

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

Specified by:
addPlaceholder in interface IShape
Parameters:
placeholderToCopyFrom - Placeholder to copy content from.
Returns:
New Placeholder.

getTags

@Deprecated
public ITagCollection getTags()
Deprecated. 

Returns the shape's tags collection. Read-only ITagCollection.


getCustomData

public ICustomData getCustomData()

Returns the shape's custom data. Read-only ICustomData.

Specified by:
getCustomData in interface IShape

getRawFrame

public IShapeFrame getRawFrame()

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


Code that attempts to assign undefined frame to IShape.Frame doesn't make sence in general case (particulary in case when parent GroupShape is multiple nested into other GroupShape-s). For example: {code}IShape shape = ...; shape.Frame = new ShapeFrame(float.NaN, float.NaN, float.NaN, float.NaN, NullableBool.NotDefined, NullableBool.NotDefined, float.NaN);{code} or {code}slide.Shapes.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.Frame. 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.Frame = ...; // 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.RawFrame frame properties can be undefined. This make sence 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.RawFrame. 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.RawFrame = 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}

Specified by:
getRawFrame in interface IShape

setRawFrame

public void setRawFrame(IShapeFrame value)
Specified by:
setRawFrame in interface IShape

getFrame

public IShapeFrame getFrame()

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


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.

Specified by:
getFrame in interface IShape

setFrame

public void setFrame(IShapeFrame value)
Specified by:
setFrame in interface IShape

getLineFormat

public ILineFormat getLineFormat()

Returns the LineFormat object that contains line formatting properties for a shape. Read-only LineFormat. Note: can return null for certain types of shapes which don't have line properties.

Specified by:
getLineFormat in interface IShape

getThreeDFormat

public IThreeDFormat getThreeDFormat()

Returns the ThreeDFormat object that 3d effect properties for a shape. Read-only ThreeDFormat. Note: can return null for certain types of shapes which don't have 3d properties.

Specified by:
getThreeDFormat in interface IShape

getEffectFormat

public IEffectFormat getEffectFormat()

Returns the EffectFormat object which contains pixel effects applied to a shape. Read-only EffectFormat Note: can return null for certain types of shapes which don't have effect properties.

Specified by:
getEffectFormat in interface IShape

getFillFormat

public IFillFormat getFillFormat()

Returns the FillFormat object that contains fill formatting properties for a shape. Read-only FillFormat. Note: can return null for certain types of shapes which don't have fill properties.

Specified by:
getFillFormat in interface IShape

createLineFormatEffective

public ILineFormatEffectiveData createLineFormatEffective()

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

Specified by:
createLineFormatEffective in interface IShape
Returns:
LineFormatEffectiveData.

createFillFormatEffective

public IFillFormatEffectiveData createFillFormatEffective()

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

Specified by:
createFillFormatEffective in interface IShape
Returns:
FillFormatEffectiveData.

createEffectFormatEffective

public IEffectFormatEffectiveData createEffectFormatEffective()

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

Specified by:
createEffectFormatEffective in interface IShape
Returns:
EffectFormatEffectiveData.

createThreeDFormatEffective

public IThreeDFormatEffectiveData createThreeDFormatEffective()

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

Specified by:
createThreeDFormatEffective in interface IShape
Returns:
FillFormatEffectiveData.

getThumbnail

public java.awt.image.BufferedImage getThumbnail()
Specified by:
getThumbnail in interface IShape

getThumbnail

public java.awt.image.BufferedImage getThumbnail(int bounds,
                                                 float scaleX,
                                                 float scaleY)
Specified by:
getThumbnail in interface IShape

getHyperlinkClick

public IHyperlink getHyperlinkClick()

Returns or sets the hyperlink defined for mouse click. Read/write Hyperlink.

Specified by:
getHyperlinkClick in interface IHyperlinkContainer

setHyperlinkClick

public void setHyperlinkClick(IHyperlink value)
Specified by:
setHyperlinkClick in interface IHyperlinkContainer

getHLinkClick

@Deprecated
public Hyperlink getHLinkClick()
Deprecated. 

Returns or sets the hyperlink defined for mouse click. Read/write Hyperlink.


setHLinkClick

@Deprecated
public void setHLinkClick(Hyperlink value)
Deprecated. 


getHyperlinkMouseOver

public IHyperlink getHyperlinkMouseOver()

Returns or sets the hyperlink defined for mouse over. Read/write Hyperlink.

Specified by:
getHyperlinkMouseOver in interface IHyperlinkContainer

setHyperlinkMouseOver

public void setHyperlinkMouseOver(IHyperlink value)
Specified by:
setHyperlinkMouseOver in interface IHyperlinkContainer

getHLinkMouseOver

@Deprecated
public Hyperlink getHLinkMouseOver()
Deprecated. 

Returns or sets the hyperlink defined for mouse over. Read/write Hyperlink.


setHLinkMouseOver

@Deprecated
public void setHLinkMouseOver(Hyperlink value)
Deprecated. 


getHyperlinkManager

public IHyperlinkManager getHyperlinkManager()
Specified by:
getHyperlinkManager in interface IHyperlinkContainer

getHidden

public boolean getHidden()

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

Specified by:
getHidden in interface IShape

setHidden

public void setHidden(boolean value)
Specified by:
setHidden in interface IShape

getZOrderPosition

public 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.

Specified by:
getZOrderPosition in interface IShape

getRotation

public 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.

Specified by:
getRotation in interface IShape

setRotation

public void setRotation(float value)
Specified by:
setRotation in interface IShape

getX

public float getX()

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


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.

Specified by:
getX in interface IShape

setX

public void setX(float value)
Specified by:
setX in interface IShape

getY

public float getY()

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


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.

Specified by:
getY in interface IShape

setY

public void setY(float value)
Specified by:
setY in interface IShape

getWidth

public float getWidth()

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


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.

Specified by:
getWidth in interface IShape

setWidth

public void setWidth(float value)
Specified by:
setWidth in interface IShape

getHeight

public float getHeight()

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


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.

Specified by:
getHeight in interface IShape

setHeight

public void setHeight(float value)
Specified by:
setHeight in interface IShape

getUniqueId

public long getUniqueId()

Gets unique shape identifier in presentation scope.

Specified by:
getUniqueId in interface IShape

getAlternativeText

public java.lang.String getAlternativeText()

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

Specified by:
getAlternativeText in interface IShape

setAlternativeText

public void setAlternativeText(java.lang.String value)
Specified by:
setAlternativeText in interface IShape

getName

public java.lang.String getName()

Returns or sets the name of a shape. Must be not null. Use empty string value if needed. Read/write string.

Specified by:
getName in interface IShape

setName

public void setName(java.lang.String value)
Specified by:
setName in interface IShape

getShapeLock

public IBaseShapeLock getShapeLock()

Returns shape's locks. Read-only IBaseShapeLock.

Specified by:
getShapeLock in interface IShape

isGrouped

public boolean isGrouped()

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


Property ParentGroup returns parent GroupShape object if shape is grouped.

Specified by:
isGrouped in interface IShape

getParentGroup

public IGroupShape getParentGroup()

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


Property IsGrouped determines whether the shape is grouped.

Specified by:
getParentGroup in interface IShape

getSlide

public IBaseSlide getSlide()

Returns the parent slide of a shape. Read-only BaseSlide.

Specified by:
getSlide in interface ISlideComponent

getPresentation

public IPresentation getPresentation()

Returns the parent presentation of a slide. Read-only Presentation.

Specified by:
getPresentation in interface IPresentationComponent