com.aspose.slides.pptx
Class ShapesEx

java.lang.Object
  extended by com.aspose.slides.pptx.ShapesEx

public final class ShapesEx
extends java.lang.Object

Represents a collection of shapes.


Method Summary
 AudioFrameEx addAudioFrameCD(float x, float y, float width, float height)
          Adds an AudioFrameEx with CD to the end of collection.
 AudioFrameEx addAudioFrameEmbedded(float x, float y, float width, float height, java.io.InputStream audio_stream)
          Adds a new audio frame with embedded audio file to the end of a collection.
 AudioFrameEx addAudioFrameLinked(float x, float y, float width, float height, java.lang.String fname)
          Adds a new audio frame with linked audio file to the end of a collection.
 int addAutoShape(int shapeType, float x, float y, float width, float height)
          Added for auto-porting
 int addAutoShape(ShapeTypeEx shapeType, float x, float y, float width, float height)
          Creates a new AutoShapeEx and adds it to the end of the collection.
 int addConnector(ShapeTypeEx shapeType, float x, float y, float width, float height)
          Creates a new ConnectorEx and adds it to the end of the collection.
 OleObjectFrameEx addOleObjectFrame(float x, float y, float width, float height, java.lang.String class_name, byte[] obj_data)
          Adds a new OLE object to the end of a collection.
 int addPictureFrame(ShapeTypeEx shapeType, float x, float y, float width, float height, ImageEx image)
          Creates a new PictureFrameEx and adds it to the end of the collection.
 int addTable(float x, float y, double[] columnWidths, double[] rowHeights)
           
 VideoFrameEx addVideoFrame(float x, float y, float width, float height, java.lang.String fname)
          Adds a new video frame to the end of a collection.
 ShapeEx get(int index)
          Gets the element at the specified index.
 java.lang.Object getParent()
          Returns a parent object for a Shapes collection.
 int indexOf(ShapeEx shape)
          Returns the zero-based index of the first occurrence of a shape in a collection.
 void insertAudioFrameCD(int index, float x, float y, float width, float height)
          Insert an AudioFrameEx with CD.
 void insertAudioFrameEmbedded(int index, float x, float y, float width, float height, java.io.InputStream audio_stream)
          Insert an AudioFrameEx with embedded audio file.
 void insertAudioFrameLinked(int index, float x, float y, float width, float height, java.lang.String fname)
          Creates a new audio frame with linked audio file and inserts it to a collection at the specified index.
 void insertAutoShape(int index, ShapeTypeEx shapeType, float x, float y, float width, float height)
          Creates a new AutoShapeEx and inserts it to the collection at the specified index.
 void insertConnector(int index, ShapeTypeEx shapeType, float x, float y, float width, float height)
          Creates a new ConnectorEx and inserts it to the collection at the specified index.
 void insertOleObjectFrame(int index, float x, float y, float width, float height, java.lang.String class_name, byte[] obj_data)
          Creates a new OLE object and inserts it to a collection at the specified index.
 void insertPictureFrame(int index, ShapeTypeEx shapeType, float x, float y, float width, float height, ImageEx image)
          Creates a new PictureFrameEx and inserts it to the collection at the specified index.
 void insertTable(int index, float x, float y, double[] columnWidths, double[] rowHeights)
           
 void insertVideoFrame(int index, float x, float y, float width, float height, java.lang.String fname)
          Creates a new video frame and inserts it to a collection at the specified index.
 java.util.Iterator iterator()
          Returns an iterator for the entire collection.
 void remove(int index)
          Removes the element at the specified index of the collection.
 void remove(ShapeEx shape)
          Removes the first occurrence of a specific shape from the collection.
 void reorder(int index, ShapeEx shape)
          Moves a shape from the collection to the specified position.
 void reorder(int index, ShapeEx[] shapes)
          Moves shapes from the collection to the specified position.
 int size()
          Gets the number of elements actually contained in the collection.
 ShapeEx[] toArray()
          Creates and returns an array of all shapes.
 ShapeEx[] toArray(int startIndex, int count)
          Creates and returns an array with all shapes from the specified range in it.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

size

public int size()
Gets the number of elements actually contained in the collection.


get

public ShapeEx get(int index)
Gets the element at the specified index.

Parameters:
index - index of the element to return.
Returns:
See ShapeEx.

addOleObjectFrame

public OleObjectFrameEx addOleObjectFrame(float x,
                                          float y,
                                          float width,
                                          float height,
                                          java.lang.String class_name,
                                          byte[] obj_data)
Adds a new OLE object to the end of a collection.

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

insertOleObjectFrame

public void insertOleObjectFrame(int index,
                                 float x,
                                 float y,
                                 float width,
                                 float height,
                                 java.lang.String class_name,
                                 byte[] obj_data)
Creates a new OLE object and inserts it to a collection at the specified index.

Parameters:
index - The zero-based index at which OLE object should be inserted.
x - X coordinate of a new OLE frame.
y - Y coordinate of a new OLE frame.
width - Width of a new OLE frame.
height - Height of a new OLE frame.
class_name - Name of an OLE class.
obj_data - OLE object's data.

addVideoFrame

public VideoFrameEx addVideoFrame(float x,
                                  float y,
                                  float width,
                                  float height,
                                  java.lang.String fname)
Adds a new video frame to the end of a collection.

Parameters:
x - X coordinate of a new video frame.
y - 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:
Created VideoFrameEx object.

insertVideoFrame

public void insertVideoFrame(int index,
                             float x,
                             float y,
                             float width,
                             float height,
                             java.lang.String fname)
Creates a new video frame and inserts it to a collection at the specified index.

Parameters:
index - The zero-based index at which video frame should be inserted.
x - X coordinate of a new video frame.
y - 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.

addAudioFrameCD

public AudioFrameEx addAudioFrameCD(float x,
                                    float y,
                                    float width,
                                    float height)
Adds an AudioFrameEx with CD 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.
Returns:
created audio frame.

insertAudioFrameCD

public void insertAudioFrameCD(int index,
                               float x,
                               float y,
                               float width,
                               float height)
Insert an AudioFrameEx with CD.

Parameters:
index -
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.

addAudioFrameLinked

public AudioFrameEx addAudioFrameLinked(float x,
                                        float y,
                                        float width,
                                        float height,
                                        java.lang.String fname)
Adds a new audio frame with linked audio file to the end of a 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.
fname - Audio file name.
Returns:
Created AudioFrameEx object.

insertAudioFrameLinked

public void insertAudioFrameLinked(int index,
                                   float x,
                                   float y,
                                   float width,
                                   float height,
                                   java.lang.String fname)
Creates a new audio frame with linked audio file and inserts it to a collection at the specified index.

Parameters:
index - The zero-based index at which audio frame should be inserted.
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.
fname - Audio file name.

addAudioFrameEmbedded

public AudioFrameEx addAudioFrameEmbedded(float x,
                                          float y,
                                          float width,
                                          float height,
                                          java.io.InputStream audio_stream)
Adds a new audio frame with embedded audio file to the end of a collection. Embedded audio file can be a WAV only.

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 - Inout stream with audio data.
Returns:
Created AudioFrameEx object.

insertAudioFrameEmbedded

public void insertAudioFrameEmbedded(int index,
                                     float x,
                                     float y,
                                     float width,
                                     float height,
                                     java.io.InputStream audio_stream)
Insert an AudioFrameEx with embedded audio file. Embedded audio file sound can be a WAV only.

Parameters:
index - The zero-based index at which value should be inserted.
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.

indexOf

public int indexOf(ShapeEx shape)
Returns the zero-based index of the first occurrence of a shape in a collection.

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

toArray

public ShapeEx[] toArray()
Creates and returns an array of all shapes.


toArray

public ShapeEx[] toArray(int startIndex,
                         int count)
Creates and returns an array with all shapes from the specified range in it.

Parameters:
startIndex - An index of a first shape to return.
count - A number of shapes to return.

reorder

public void reorder(int index,
                    ShapeEx shape)
Moves a shape from the collection to the specified position.

Parameters:
index - Target index.
shape - Shape to move.

reorder

public void reorder(int index,
                    ShapeEx[] shapes)
Moves shapes from the collection to the specified position. Shapes will be placed starting from index in order they appear in list.

Parameters:
index - Target index.
shapes - Shapes to move.

addAutoShape

public int addAutoShape(ShapeTypeEx shapeType,
                        float x,
                        float y,
                        float width,
                        float height)
Creates a new AutoShapeEx and adds it to the end of the collection.

Parameters:
shapeType -
x - The X-coordinate for a left side of shape's frame.
y - The Y-coordinate for a top side of shape's frame.
width - The width of shape's frame.
height - The height of shape's frame.
Returns:
The zero-based index of the created shape.

addAutoShape

public int addAutoShape(int shapeType,
                        float x,
                        float y,
                        float width,
                        float height)
Added for auto-porting


insertAutoShape

public void insertAutoShape(int index,
                            ShapeTypeEx shapeType,
                            float x,
                            float y,
                            float width,
                            float height)
Creates a new AutoShapeEx and inserts it to the collection at the specified index. Note: the type of the shape will be determined by the shapeType parameter.

Parameters:
index - The zero-based index at which value should be inserted.
shapeType -
x - The X-coordinate for a left side of shape's frame
y - The Y-coordinate for a top side of shape's frame.
width - The width of shape's frame.
height - The height of shape's frame.

addConnector

public int addConnector(ShapeTypeEx shapeType,
                        float x,
                        float y,
                        float width,
                        float height)
Creates a new ConnectorEx and adds it to the end of the collection.

Parameters:
shapeType -
x - The X-coordinate for a left side of shape's frame.
y - The Y-coordinate for a top side of shape's frame.
width - The width of shape's frame.
height - The height of shape's frame.
Returns:
The zero-based index of the created shape.

insertConnector

public void insertConnector(int index,
                            ShapeTypeEx shapeType,
                            float x,
                            float y,
                            float width,
                            float height)
Creates a new ConnectorEx and inserts it to the collection at the specified index.

Parameters:
index - The zero-based index at which value should be inserted.
shapeType -
x - The X-coordinate for a left side of shape's frame.
y - The Y-coordinate for a top side of shape's frame.
width - The width of shape's frame.
height - The height of shape's frame.

addPictureFrame

public int addPictureFrame(ShapeTypeEx shapeType,
                           float x,
                           float y,
                           float width,
                           float height,
                           ImageEx image)
Creates a new PictureFrameEx and adds it to the end of the collection.

Parameters:
shapeType -
x - The X-coordinate for a left side of shape's frame.
y - The Y-coordinate for a top side of shape's frame.
width - The width of shape's frame.
height - The height of shape's frame.
image - The image of picture frame.
Returns:
The zero-based index of the created shape.

insertPictureFrame

public void insertPictureFrame(int index,
                               ShapeTypeEx shapeType,
                               float x,
                               float y,
                               float width,
                               float height,
                               ImageEx image)
Creates a new PictureFrameEx and inserts it to the collection at the specified index.

Parameters:
index - The zero-based index at which value should be inserted.
shapeType -
x - The X-coordinate for a left side of shape's frame.
y - The Y-coordinate for a top side of shape's frame.
width - The width of shape's frame.
height - The height of shape's frame.
image - The image of picture frame.

addTable

public int addTable(float x,
                    float y,
                    double[] columnWidths,
                    double[] rowHeights)

insertTable

public void insertTable(int index,
                        float x,
                        float y,
                        double[] columnWidths,
                        double[] rowHeights)

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(ShapeEx shape)
Removes the first occurrence of a specific shape from the collection.

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

iterator

public java.util.Iterator iterator()
Returns an iterator for the entire collection.


getParent

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