com.aspose.slides
Class Shape

java.lang.Object
  extended by com.aspose.slides.Shape
All Implemented Interfaces:
IShape, IShapeFormat
Direct Known Subclasses:
AutoShape, Ellipse, GroupShape, Line, PictureFrame, Polyline, Rectangle, TextFrame

public class Shape
extends java.lang.Object
implements IShape, IShapeFormat

Represents the abstract shape on a slide.


Field Summary
protected static java.awt.geom.Point2D.Float[] defaultConnectionPoints
           
protected static java.awt.geom.Point2D.Float[] emptyConnectionPoints
           
protected static ShapeElement[] emptyShape
           
protected  IEsAnchor m_anchor
           
protected  AnimationSettings m_animationSettings
           
protected  FillFormat m_fillFormat
           
protected  EsContainer m_frame
           
protected  LineFormat m_lineFormat
           
protected  Link m_link
           
protected  long m_nFSTVersion
           
protected  EsOpt m_options
           
protected  Slide m_parent
           
protected  ShadowFormat m_shadowFormat
           
protected  Shapes m_shapesParent
           
protected  Tags m_tags
           
protected  TextFrame m_TextFrame
           
protected  long m_version
           
 
Constructor Summary
protected Shape(Slide parent)
           
protected Shape(Slide parent, EsSpContainer frame)
           
 
Method Summary
 Link addLink()
          Adds the new link to a shape.
 TextFrame addTextFrame(java.lang.String text)
          Adds a new TextFrame to a shape.
 void clearLink()
          Clears the Link.
 ShapeElement[] createShapeElements()
          Creates and returns array of shape elements.
 ShapeElement[] createShapeElements(ShapeDrawingOptions shapeDrawingOptions)
          Creates array of shape's elements.
 java.lang.String getAlternativeText()
          Returns the alternative text associated with a shape in a Web presentation.
protected  IEsAnchor getAnchor()
           
 AnimationSettings getAnimationSettings()
          Returns the AnimationSettings object that contains animation properties of a shape.
 java.awt.geom.Point2D.Float[] getConnectionSites()
          Returns array of points, where connector can be attached.
 java.awt.geom.Point2D.Float[] getConnectionSitesRaw()
          Returns array of points, where connector can be attached.
 FillFormat getFillFormat()
          Returns the FillFormat object that contains fill formatting properties of a shape.
protected  EsSpContainer getFrame()
           
protected  int getgeoBottom()
           
protected  int getgeoRight()
           
 int getHeight()
          Returns the height of a shape.
 LineFormat getLineFormat()
          Returns the LineFormat object that contains line formatting properties of a shape.
 Link getLink()
          Return the Link object for a shape.
 int getMasterShapeId()
          Returns the unique Id of a master shape or 0 in case shape is not inherited from any master shapes.
 java.lang.String getName()
          Returns the name of a shape.
protected  EsOpt getOptions()
           
 Slide getParent()
          Returns the parent slide.
 Placeholder getPlaceholder()
          Returns the Placeholder object for a shape in case of shape is a placeholder.
 int getRotation()
          Returns the number of degrees the specified shape is rotated around the z-axis.
protected  int getRotation0_360()
          Rotation, normalized to [0; 360) interval
 ShadowFormat getShadowFormat()
          Returns the ShadowFormat object that contains shadow decoration properties of a shape.
 int getShapeId()
          Returns the unique Id of a shape.
 java.awt.geom.Rectangle2D.Float getShapeRectangle()
          Returns shape rectangle in presentation coordinates.
 Tags getTags()
          Returns the tags for a shape.
 TextFrame getTextFrame()
          Returns the TextFrame object for a Shape.
 ThreeDFormat getThreeDFormat()
          Returns the ThreeDFormat object that contains 3D decoration properties of a shape.
 int getWidth()
          Returns the width of a shape.
 int getX()
          Returns the x-coordinate of the upper-left corner of a shape.
 int getY()
          Returns the y-coordinate of the upper-left corner of a shape.
 int getZOrderPosition()
          Returns the position of a shape in the z-order.
 boolean hasExternalData()
          Determines whether the shape has external referenced data e.g.
 boolean isFlipH()
          Determines whether the shape is flipped horizontally.
 boolean isFlipV()
          Determines whether the shape is flipped vertically.
 boolean isHidden()
          Determines whether the shape is hidden.
 boolean isMasterTextHolder()
          True if shape is a master text holder.
 boolean isTextHolder()
          Returns true if shape is a TextHolder.
 void serialize(java.io.OutputStream stream)
          Serializes a Shape object to the stream.
 void setAlternativeText(java.lang.String value)
          Sets the alternative text associated with a shape in a Web presentation.
 void setFlipH(boolean value)
          Flips the shape horizontally.
 void setFlipV(boolean value)
          Flips the shape vertically.
 void setHeight(int value)
          Sets the height of a shape.
 void setHidden(boolean value)
          Sets whether the shape is hidden.
 void setName(java.lang.String value)
          Sets the name of a shape.
 void setRotation(int value)
          Sets the number of degrees the specified shape is rotated around the z-axis.
 void setWidth(int value)
          Sets the width of a shape.
 void setX(int value)
          Sets the x-coordinate of the upper-left corner of a shape.
 void setY(int value)
          Sets the y-coordinate of the upper-left corner of a shape.
protected  boolean shouldDraw(int drc, IDrawingControl[] drawingControl, boolean[] recurseToChildren)
          Determines whether the shape should be drawn.
 void zOrder(int cmd)
          Moves the shape in front of or behind other shapes in the collection (that is, changes the shape's position in the z-order).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_parent

protected Slide m_parent

m_shapesParent

protected Shapes m_shapesParent

m_frame

protected EsContainer m_frame

m_anchor

protected IEsAnchor m_anchor

m_options

protected EsOpt m_options

m_version

protected long m_version

m_nFSTVersion

protected long m_nFSTVersion

m_lineFormat

protected LineFormat m_lineFormat

m_fillFormat

protected FillFormat m_fillFormat

m_shadowFormat

protected ShadowFormat m_shadowFormat

m_animationSettings

protected AnimationSettings m_animationSettings

m_tags

protected Tags m_tags

m_link

protected Link m_link

m_TextFrame

protected TextFrame m_TextFrame

emptyShape

protected static final ShapeElement[] emptyShape

emptyConnectionPoints

protected static final java.awt.geom.Point2D.Float[] emptyConnectionPoints

defaultConnectionPoints

protected static final java.awt.geom.Point2D.Float[] defaultConnectionPoints
Constructor Detail

Shape

protected Shape(Slide parent)

Shape

protected Shape(Slide parent,
                EsSpContainer frame)
Method Detail

isTextHolder

public boolean isTextHolder()
Returns true if shape is a TextHolder.

Returns:
True if shape is a TextHolder.

getPlaceholder

public Placeholder getPlaceholder()
Returns the Placeholder object for a shape in case of shape is a placeholder.

Returns:
The Placeholder object. See Placeholder.

isMasterTextHolder

public boolean isMasterTextHolder()
True if shape is a master text holder.

Returns:
True if shape is a master text holder.

getLineFormat

public LineFormat getLineFormat()
Returns the LineFormat object that contains line formatting properties of a shape.

Specified by:
getLineFormat in interface IShapeFormat
Returns:
The LineFormat object. See LineFormat.

getFillFormat

public FillFormat getFillFormat()
Returns the FillFormat object that contains fill formatting properties of a shape.

Specified by:
getFillFormat in interface IShapeFormat
Returns:
The FillFormat object. See FillFormat.

getShadowFormat

public ShadowFormat getShadowFormat()
Returns the ShadowFormat object that contains shadow decoration properties of a shape.

Specified by:
getShadowFormat in interface IShapeFormat
Returns:
The ShadowFormat object. See ShadowFormat.

getThreeDFormat

public ThreeDFormat getThreeDFormat()
Returns the ThreeDFormat object that contains 3D decoration properties of a shape.

Specified by:
getThreeDFormat in interface IShapeFormat
Returns:
The ThreeDFormat object. See ThreeDFormat.

getAnimationSettings

public AnimationSettings getAnimationSettings()
Returns the AnimationSettings object that contains animation properties of a shape.

Returns:
The AnimationSettings object. See AnimationSettings.

getLink

public Link getLink()
Return the Link object for a shape.

Returns:
The Link object. See Link.

addLink

public Link addLink()
Adds the new link to a shape.

Returns:
The new Link object. See Link.

clearLink

public void clearLink()
Clears the Link.


serialize

public void serialize(java.io.OutputStream stream)
               throws PptException
Serializes a Shape object to the stream.

Parameters:
stream - The stream to which the Shape is to be serialized.
Throws:
PptException

getConnectionSitesRaw

public java.awt.geom.Point2D.Float[] getConnectionSitesRaw()
Returns array of points, where connector can be attached. Coordinates aren't transformed and do not take into account shape's and its parents' FlipH, FlipH, FlipV and Rotation properties. Use getConnectionSites() instead.

Returns:
Array of points, where connector can be attached.

getConnectionSites

public java.awt.geom.Point2D.Float[] getConnectionSites()
Returns array of points, where connector can be attached. Returned coordinates are in the document's coordinate system.

Returns:
Array of points, where connector can be attached.

createShapeElements

public ShapeElement[] createShapeElements()
Creates and returns array of shape elements.

Returns:
Array of shape elements. See ShapeElement.

getShapeRectangle

public java.awt.geom.Rectangle2D.Float getShapeRectangle()
Returns shape rectangle in presentation coordinates. Note: It is not guaranteed actual shape will fit this rectangle, some autoshapes won't.

Returns:
Shape rectangle.

createShapeElements

public ShapeElement[] createShapeElements(ShapeDrawingOptions shapeDrawingOptions)
Creates array of shape's elements.

Parameters:
shapeDrawingOptions -
Returns:
Array of ShapeElement.

getFrame

protected EsSpContainer getFrame()

getOptions

protected EsOpt getOptions()

getParent

public Slide getParent()
Returns the parent slide.

Specified by:
getParent in interface IShape
Returns:
The parent slide.

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.

Returns:
The z-order position.

zOrder

public void zOrder(int cmd)
Moves the shape in front of or behind other shapes in the collection (that is, changes the shape's position in the z-order).

Parameters:
cmd - specifies where to move the specified shape relative to the other shapes.

getAlternativeText

public java.lang.String getAlternativeText()
Returns the alternative text associated with a shape in a Web presentation.

Specified by:
getAlternativeText in interface IShape
Returns:
The alternative text.

setAlternativeText

public void setAlternativeText(java.lang.String value)
Sets the alternative text associated with a shape in a Web presentation.

Specified by:
setAlternativeText in interface IShape
Parameters:
value - the alternative text.

getName

public java.lang.String getName()
Returns the name of a shape. Returns real name value only if name was explicitly set.

Returns:
The alternative text.

setName

public void setName(java.lang.String value)
Sets the name of a shape.

Parameters:
value - the alternative text.

isHidden

public boolean isHidden()
Determines whether the shape is hidden.

Returns:
true if the shape is hidden.

setHidden

public void setHidden(boolean value)
Sets whether the shape is hidden.

Parameters:
value - true if the shape is hidden.

getRotation

public int getRotation()
Returns 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.

Returns:
The rotation angle.

setRotation

public void setRotation(int value)
                 throws java.lang.Exception
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.

Parameters:
value - new rotation angle.
Throws:
java.lang.Exception

getRotation0_360

protected int getRotation0_360()
Rotation, normalized to [0; 360) interval


getAnchor

protected IEsAnchor getAnchor()

getX

public int getX()
Returns the x-coordinate of the upper-left corner of a shape.

Specified by:
getX in interface IShape
Returns:
The x coordinate.

setX

public void setX(int value)
Sets the x-coordinate of the upper-left corner of a shape.

Specified by:
setX in interface IShape
Parameters:
value - new x coordinate.

getY

public int getY()
Returns the y-coordinate of the upper-left corner of a shape.

Specified by:
getY in interface IShape
Returns:
The y coordinate.

setY

public void setY(int value)
Sets the y-coordinate of the upper-left corner of a shape.

Specified by:
setY in interface IShape
Parameters:
value - new y coordinate.

getWidth

public int getWidth()
Returns the width of a shape.

Specified by:
getWidth in interface IShape
Returns:
The width of a shape.

setWidth

public void setWidth(int value)
Sets the width of a shape.

Specified by:
setWidth in interface IShape
Parameters:
value - new width of a shape.

getHeight

public int getHeight()
Returns the height of a shape.

Specified by:
getHeight in interface IShape
Returns:
The height of a shape.

setHeight

public void setHeight(int value)
Sets the height of a shape.

Specified by:
setHeight in interface IShape
Parameters:
value - new height of a shape.

isFlipH

public boolean isFlipH()
Determines whether the shape is flipped horizontally.

Returns:
true if the shape is flipped horizontally.

setFlipH

public void setFlipH(boolean value)
Flips the shape horizontally.

Parameters:
value - true to flip the shape horizontally.

isFlipV

public boolean isFlipV()
Determines whether the shape is flipped vertically.

Returns:
true if the shape is flipped vertically.

setFlipV

public void setFlipV(boolean value)
Flips the shape vertically.

Parameters:
value - true to flip the shape vertically.

getgeoRight

protected int getgeoRight()

getgeoBottom

protected int getgeoBottom()

getShapeId

public int getShapeId()
Returns the unique Id of a shape.

Returns:
unique Id of a shape.

getMasterShapeId

public int getMasterShapeId()
Returns the unique Id of a master shape or 0 in case shape is not inherited from any master shapes.

Returns:
unique Id of a master shape or 0 in case shape is not inherited from any master shapes.

getTextFrame

public TextFrame getTextFrame()
Returns the TextFrame object for a Shape.

Returns:
The TextFrame object.

addTextFrame

public TextFrame addTextFrame(java.lang.String text)
                       throws PptEditException
Adds a new TextFrame to a shape. If shape already has TextFrame then do nothing.

Parameters:
text - Default text for a new TextFrame.
Throws:
PptEditException

getTags

public Tags getTags()
Returns the tags for a shape.

Returns:
the tags for a shape. See Tags.

hasExternalData

public boolean hasExternalData()
Determines whether the shape has external referenced data e.g. OLE object or embedded sound.

Returns:
true if shape has external referenced data.

shouldDraw

protected boolean shouldDraw(int drc,
                             IDrawingControl[] drawingControl,
                             boolean[] recurseToChildren)
Determines whether the shape should be drawn.

Parameters:
drc - DrawingControlDecision
drawingControl - IDrawingControl
recurseToChildren - returns whether we should recurse
Returns:
true if we should draw the shape