com.aspose.slides
Class Shapes

java.lang.Object
  extended by com.aspose.slides.Shapes

public final class Shapes
extends java.lang.Object

Represents the collection of a shapes.


Method Summary
 Shape add(java.io.InputStream stream)
          load serialized shape from a stream and add it to the end of a collection.
 AudioFrame addAudioFrameEmbedded(int x, int y, int width, int height, java.io.InputStream audio_stream)
          Adds an AudioFrame with embedded audio file to the end of collection.
 AudioFrame addAudioFrameLinked(int x, int y, int width, int height, java.lang.String fname)
          Adds an AudioFrame with linked audio file to the end of collection.
 Connector addConnector(int connectorType, java.awt.geom.Point2D.Float pt1, java.awt.geom.Point2D.Float pt2)
          Adds a Connector to the end of collection.
 Ellipse addEllipse(int x, int y, int width, int height)
          Adds the Ellipse at the end of the collection.
 Line addLine(java.awt.Point pt1, java.awt.Point pt2)
          Adds the Line at the end of the collection.
 OleObjectFrame addOleObjectFrame(int x, int y, int width, int height, java.lang.String class_name, byte[] obj_data)
          Adds an OleObjectFrame to the end of collection.
 PictureFrame addPictureFrame(int id, int x, int y, int width, int height)
          Adds the PictureFrame at the end of the collection.
 Polyline addPolyline(int x, int y, int width, int height, java.awt.geom.GeneralPath gp)
          Adds a Polyline to the end of a collection.
 Rectangle addRectangle(int x, int y, int width, int height)
          Adds the Rectangle at the end of the collection.
 Table addTable(int x, int y, int width, int height, int columns, int rows)
          Adds a Table to the end of collection.
 Table addTable(int x, int y, int width, int height, int columns, int rows, float bordersWidth, java.awt.Color bordersColor)
          Adds a Table to the end of collection.
 VideoFrame addVideoFrame(int x, int y, int width, int height, java.lang.String fname)
          Adds a VideoFrame to the end of collection.
 Shape get(int index)
          Returns the element at the specified index.
 java.lang.Object getParent()
          Returns parent object for the Shapes collection.
 int indexOf(Shape value)
          Returns the zero-based index of the first occurrence of a value in the ArrayList.
 void remove(int index)
          Removes the element at the specified index of the collection.
 void remove(Shape shape)
          Removes the element at the specified index of the collection.
 int size()
          Returns the number of elements in the collection.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

size

public int size()
Returns the number of elements in the collection.

Returns:
The number of elements in the collection.

get

public Shape get(int index)
Returns the element at the specified index.

Parameters:
index - index of element to return.
Returns:
The element at the specified index.

add

public Shape add(java.io.InputStream stream)
          throws PptEditException
load serialized shape from a stream and add it to the end of a collection.

Parameters:
stream - Input stream to load shape from
Returns:
Created shape.
Throws:
PptEditException

addPictureFrame

public PictureFrame addPictureFrame(int id,
                                    int x,
                                    int y,
                                    int width,
                                    int height)
                             throws PptEditException
Adds the PictureFrame at the end of the collection.

Parameters:
id - Id of a Picture to be inserted to the new picture frame.
x - x coordinate of the new picture frame.
y - y coordinate of the new picture frame.
width - width of the new picture frame.
height - height of the new picture frame.
Returns:
The new PictureFrame object.
Throws:
PptEditException

addOleObjectFrame

public OleObjectFrame addOleObjectFrame(int x,
                                        int y,
                                        int width,
                                        int height,
                                        java.lang.String class_name,
                                        byte[] obj_data)
                                 throws PptEditException
Adds an OleObjectFrame to the end of collection.

Parameters:
x - X coordinate of a new OLE object frame.
y - Y coordinate of a new OLE object frame.
width - Width of a new OLE object frame.
height - Height of a new OLE object frame.
class_name - Name of an OLE class.
obj_data - OLE object's data.
Returns:
OleObjectFrame object.
Throws:
PptEditException

addVideoFrame

public VideoFrame addVideoFrame(int x,
                                int y,
                                int width,
                                int height,
                                java.lang.String fname)
                         throws PptEditException
Adds a VideoFrame to the end of collection.

Parameters:
x - coordinate of a new video frame.
y - coordinate of a new video frame.
width - Width of a new video frame.
height - Height of a new video frame.
fname - Video file name.
Returns:
VideoFrame object.
Throws:
PptEditException

addAudioFrameLinked

public AudioFrame addAudioFrameLinked(int x,
                                      int y,
                                      int width,
                                      int height,
                                      java.lang.String fname)
                               throws PptEditException
Adds an AudioFrame with linked audio file to the end of collection.

Parameters:
x - coordinate of a new audio frame.
y - coordinate of a new audio frame.
width - Width of a new audio frame.
height - Height of a new audio frame.
fname - Audio file name.
Returns:
AudioFrame object.
Throws:
PptEditException

addAudioFrameEmbedded

public AudioFrame addAudioFrameEmbedded(int x,
                                        int y,
                                        int width,
                                        int height,
                                        java.io.InputStream audio_stream)
                                 throws java.io.IOException,
                                        PptEditException
Adds an AudioFrame with embedded audio file to the end of collection.

Parameters:
x - X coordinate of a new audio frame.
y - Y coordinate of a new audio frame.
width - Width of a new audio frame.
height - Height of a new audio frame.
audio_stream - Audio stream.
Returns:
AudioFrame object.
Throws:
java.io.IOException
PptEditException

addLine

public Line addLine(java.awt.Point pt1,
                    java.awt.Point pt2)
             throws PptEditException
Adds the Line at the end of the collection.

Parameters:
pt1 - start point of the line.
pt2 - end point of the line.
Returns:
The new Line object.
Throws:
PptEditException

addConnector

public Connector addConnector(int connectorType,
                              java.awt.geom.Point2D.Float pt1,
                              java.awt.geom.Point2D.Float pt2)
Adds a Connector to the end of collection.

Parameters:
connectorType - Type of connector.
pt1 - Start point of the line.
pt2 - End point of the line.
Returns:
Connector object.

addPolyline

public Polyline addPolyline(int x,
                            int y,
                            int width,
                            int height,
                            java.awt.geom.GeneralPath gp)
                     throws PptException
Adds a Polyline to the end of a collection.

Parameters:
x - X coordinate of the upper-left corner of the bounding rectangle that defines the polyline.
y - Y coordinate of the upper-left corner of the bounding rectangle that defines the polyline.
width - Width of the bounding rectangle that defines the polyline.
height - Height of the bounding rectangle that defines the polyline.
gp - GraphicsPath that defines the polyline.
Returns:
Polyline object.
Throws:
PptException

addRectangle

public Rectangle addRectangle(int x,
                              int y,
                              int width,
                              int height)
                       throws PptEditException
Adds the Rectangle at the end of the collection.

Parameters:
x - x coordinate of the upper-left corner of the rectangle.
y - y coordinate of the upper-left corner of the rectangle.
width - width of the rectangle.
height - height of the rectangle.
Returns:
The new Rectangle object.
Throws:
PptEditException

addEllipse

public Ellipse addEllipse(int x,
                          int y,
                          int width,
                          int height)
                   throws PptEditException
Adds the Ellipse at the end of the collection.

Parameters:
x - x coordinate of the upper-left corner of the bounding rectangle that defines the ellipse.
y - y coordinate of the upper-left corner of the bounding rectangle that defines the ellipse.
width - width of the bounding rectangle that defines the ellipse.
height - height of the bounding rectangle that defines the ellipse.
Returns:
The new Ellipse object.
Throws:
PptEditException

addTable

public Table addTable(int x,
                      int y,
                      int width,
                      int height,
                      int columns,
                      int rows)
               throws PptEditException
Adds a Table to the end of collection.

Parameters:
x - coordinate of the upper-left corner of the bounding rectangle that defines the table.
y - coordinate of the upper-left corner of the bounding rectangle that defines the table.
width - Width of the bounding rectangle that defines the table.
height - Height of the bounding rectangle that defines the table.
columns - Number of columns in the new table.
rows - Number of rows in the new table.
Returns:
Table object.
Throws:
PptEditException

addTable

public Table addTable(int x,
                      int y,
                      int width,
                      int height,
                      int columns,
                      int rows,
                      float bordersWidth,
                      java.awt.Color bordersColor)
               throws PptEditException,
                      AsposeLicenseException
Adds a Table to the end of collection.

Parameters:
x - coordinate of the upper-left corner of the bounding rectangle that defines the table.
y - coordinate of the upper-left corner of the bounding rectangle that defines the table.
width - Width of the bounding rectangle that defines the table.
height - Height of the bounding rectangle that defines the table.
columns - Number of columns in the new table.
rows - Number of rows in the new table.
bordersWidth - Width of all borders in a table. 0 to hide borders.
bordersColor - Color of all borders in a table.
Returns:
Table object.
Throws:
PptEditException
AsposeLicenseException

indexOf

public int indexOf(Shape value)
Returns the zero-based index of the first occurrence of a value in the ArrayList.

Parameters:
value - the shape to locate in the collection.
Returns:
The zero-based index of the first occurrence of shape within the entire collection, if found; otherwise, -1.

remove

public void remove(int index)
Removes the element at the specified index of the collection.

Parameters:
index - the zero-based index of the element to remove.

remove

public void remove(Shape shape)
Removes the element at the specified index of the collection.

Parameters:
shape - the shape to remove from the collection.

getParent

public java.lang.Object getParent()
Returns parent object for the Shapes collection.

Returns:
The parent object. Can be a Slide or a GroupShape .