com.aspose.slides
Class ShapeCollection

java.lang.Object
  extended by com.aspose.slides.ShapeCollection
All Implemented Interfaces:
com.aspose.ms.System.Collections.Generic.IGenericEnumerable<IShape>, com.aspose.ms.System.Collections.IEnumerable<IShape>, IGenericCollection<IShape>, IShapeCollection, java.lang.Iterable<IShape>

public final class ShapeCollection
extends java.lang.Object
implements IShapeCollection

Represents a collection of a shapes.


Method Summary
 IAudioFrame addAudioFrameCD(float x, float y, float width, float height)
           Adds an AudioFrame with CD to the end of collection.
 IAudioFrame addAudioFrameEmbedded(float x, float y, float width, float height, IAudio audio)
           Adds a new audio frame with embedded audio file to the end of a collection.
 IAudioFrame 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.
 IAudioFrame 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.
 IAutoShape addAutoShape(int shapeType, float x, float y, float width, float height)
           Creates a new AutoShape, tunes it from default template and adds it to the end of the collection.
 IAutoShape addAutoShape(int shapeType, float x, float y, float width, float height, boolean createFromTemplate)
           Creates a new AutoShape and adds it to the end of the collection.
 IChart addChart(int type, float x, float y, float width, float height)
           Creates a new Chart, initialize it with sample series data and settings and adds it to the end of the collection.
 IChart addChart(int type, float x, float y, float width, float height, boolean initWithSample)
           Creates a new Chart and adds it to the end of the collection.
 IShape addClone(IShape sourceShape)
           Adds a copy of a specified shape to the end of the collection.
 IShape addClone(IShape sourceShape, float x, float y)
           Adds a copy of a specified shape to the end of the collection.
 IShape addClone(IShape sourceShape, float x, float y, float width, float height)
           Adds a copy of a specified shape to the end of the collection.
 IConnector addConnector(int shapeType, float x, float y, float width, float height)
           Creates a new Connector, tunes it from default template and adds it to the end of the collection.
 IConnector addConnector(int shapeType, float x, float y, float width, float height, boolean createFromTemplate)
           Creates a new Connector and adds it to the end of the collection.
 IGroupShape addGroupShape()
           Creates a new GroupShape and adds it to the end of the collection.
 IOleObjectFrame addOleObjectFrame(float x, float y, float width, float height, java.lang.String className, byte[] objectData)
           Adds a new OLE object to the end of a collection.
 IOleObjectFrame addOleObjectFrame(float x, float y, float width, float height, java.lang.String className, java.lang.String path)
           Adds a new OLE object to the end of a collection.
 IPictureFrame addPictureFrame(int shapeType, float x, float y, float width, float height, IPPImage image)
           Creates a new PictureFrame and adds it to the end of the collection.
 ISmartArt addSmartArt(float x, float y, float width, float height, int layoutType)
           Add SmartArt diagram.
 ITable addTable(float x, float y, double[] columnWidths, double[] rowHeights)
           Creates a new Table and adds it to the end of the collection.
 IVideoFrame addVideoFrame(float x, float y, float width, float height, IVideo video)
           Adds a new video frame to the end of a collection.
 IVideoFrame addVideoFrame(float x, float y, float width, float height, java.lang.String fname)
           Adds a new video frame to the end of a collection.
 void clear()
           Removes all shapes from the collection.
 void copyTo(IShape[] array, int index)
           Copies all elements from the collection to the specified array.
 IShape get_Item(int index)
           Gets the element at the specified index.
 com.aspose.slides.IDOMObject getParent_Immediate()
           Returns Parent_Immediate object.
 IGroupShape getParentGroup()
           Returns parent GroupShape object for a shapes collection.
 java.lang.Object getSyncRoot()
           Returns a synchronization root.
 int indexOf(IShape shape)
           Returns the zero-based index of the first occurrence of a shape in the collection.
 IAudioFrame insertAudioFrameCD(int index, float x, float y, float width, float height)
           Insert an AudioFrame with CD.
 IAudioFrame insertAudioFrameEmbedded(int index, float x, float y, float width, float height, IAudio audio)
           Insert an AudioFrame with embedded audio file.
 IAudioFrame insertAudioFrameEmbedded(int index, float x, float y, float width, float height, java.io.InputStream audio_stream)
           Insert an AudioFrame with embedded audio file.
 IAudioFrame 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.
 IAutoShape insertAutoShape(int index, int shapeType, float x, float y, float width, float height)
           Creates a new AutoShape, tunes it from default template and inserts it to the collection at the specified index.
 IAutoShape insertAutoShape(int index, int shapeType, float x, float y, float width, float height, boolean createFromTemplate)
           Creates a new AutoShape and inserts it to the collection at the specified index.
 IChart insertChart(int type, float x, float y, float width, float height, int index)
           Creates a new Chart, initialize it with sample series data and settings and inserts it to the specified position in the collection.
 IChart insertChart(int type, float x, float y, float width, float height, int index, boolean initWithSample)
           Creates a new Chart and inserts it to the specified position in the collection.
 IShape insertClone(int index, IShape sourceShape)
           Inserts a copy of a specified shape to specified position of the collection.
 IShape insertClone(int index, IShape sourceShape, float x, float y)
           Inserts a copy of a specified shape to specified position of the collection.
 IShape insertClone(int index, IShape sourceShape, float x, float y, float width, float height)
           Inserts a copy of a specified shape to specified position of the collection.
 IConnector insertConnector(int index, int shapeType, float x, float y, float width, float height)
           Creates a new Connector, tunes it from default template and inserts it to the collection at the specified index.
 IConnector insertConnector(int index, int shapeType, float x, float y, float width, float height, boolean createFromTemplate)
           Creates a new Connector and inserts it to the collection at the specified index.
 IGroupShape insertGroupShape(int index)
           Creates a new GroupShape and inserts it to the collection at the specified index.
 IOleObjectFrame insertOleObjectFrame(int index, float x, float y, float width, float height, java.lang.String className, byte[] objectData)
           Creates a new OLE object and inserts it to a collection at the specified index.
 IOleObjectFrame insertOleObjectFrame(int index, float x, float y, float width, float height, java.lang.String className, java.lang.String path)
           Creates a new OLE object and inserts it to a collection at the specified index.
 IPictureFrame insertPictureFrame(int index, int shapeType, float x, float y, float width, float height, IPPImage image)
           Creates a new PictureFrame and inserts it to the collection at the specified index.
 ITable insertTable(int index, float x, float y, double[] columnWidths, double[] rowHeights)
           Creates a new Table and inserts it to the collection at the specified index.
 IVideoFrame 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.
 boolean isSynchronized()
           Returns a value indicating whether access to the collection is synchronized (thread-safe).
 com.aspose.ms.System.Collections.Generic.IGenericEnumerator<IShape> iterator()
           Returns an enumerator that iterates through the collection.
 void remove(IShape shape)
           Removes the first occurrence of a specific shape from the collection.
 void removeAt(int index)
           Removes the element at the specified index of the collection.
 void reorder(int index, IShape... shapes)
           Moves shapes from the collection to the specified position.
 void reorder(int index, IShape shape)
           Moves a shape from the collection to the specified position.
 int size()
           Gets the number of elements actually contained in the collection.
 IShape[] toArray()
           Creates and returns an array with all shapse in it.
 IShape[] 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. Read-only int.

Specified by:
size in interface IGenericCollection<IShape>

get_Item

public IShape get_Item(int index)

Gets the element at the specified index. Read-only IShape.

Specified by:
get_Item in interface IShapeCollection

addChart

public IChart addChart(int type,
                       float x,
                       float y,
                       float width,
                       float height)

Creates a new Chart, initialize it with sample series data and settings and adds it to the end of the collection.

Specified by:
addChart in interface IShapeCollection
Parameters:
type - Type of chart.
x - X coordinate of a new chart.
y - Y coordinate of a new chart.
width - Chart's width.
height - Chart's height.
Returns:
Created chart.

addChart

public IChart addChart(int type,
                       float x,
                       float y,
                       float width,
                       float height,
                       boolean initWithSample)

Creates a new Chart and adds it to the end of the collection.

Specified by:
addChart in interface IShapeCollection
Parameters:
type - Type of chart.
x - X coordinate of a new chart.
y - Y coordinate of a new chart.
width - Chart's width.
height - Chart's height.
initWithSample - If true then new chart will be initialized with sample series data and settings. If false then new chart will have no series and minimum settings. In this case chart creation will be more fast.
Returns:
Created chart.

addSmartArt

public ISmartArt addSmartArt(float x,
                             float y,
                             float width,
                             float height,
                             int layoutType)

Add SmartArt diagram.


Example:
 

Specified by:
addSmartArt in interface IShapeCollection
Parameters:
x - The X-coordinate for a left side of diagram's frame.
y - The Y-coordinate for a left side of diagram's frame.
width - The width of diagram's frame.
height - The height of diagram's frame.
layoutType - The type of SmartArt diagram
Returns:
Create SmartArt diagram

insertChart

public IChart insertChart(int type,
                          float x,
                          float y,
                          float width,
                          float height,
                          int index)

Creates a new Chart, initialize it with sample series data and settings and inserts it to the specified position in the collection.

Specified by:
insertChart in interface IShapeCollection
Parameters:
type - Type of chart.
x - X coordinate of a new chart.
y - Y coordinate of a new chart.
width - Chart's width.
height - Chart's height.
index - Chart's position in the collection.
Returns:
Created chart.

insertChart

public IChart insertChart(int type,
                          float x,
                          float y,
                          float width,
                          float height,
                          int index,
                          boolean initWithSample)

Creates a new Chart and inserts it to the specified position in the collection.

Specified by:
insertChart in interface IShapeCollection
Parameters:
type - Type of chart.
x - X coordinate of a new chart.
y - Y coordinate of a new chart.
width - Chart's width.
height - Chart's height.
index - Chart's position in the collection.
initWithSample - If true then new chart will be initialized with sample series data and settings. If false then new chart will have no series and minimum settings. In this case chart creation will be more fast.
Returns:
Created chart.

addOleObjectFrame

public IOleObjectFrame addOleObjectFrame(float x,
                                         float y,
                                         float width,
                                         float height,
                                         java.lang.String className,
                                         byte[] objectData)

Adds a new OLE object to the end of a collection.

Specified by:
addOleObjectFrame in interface IShapeCollection
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.
className - Name of an OLE class.
objectData - OLE object's data.
Returns:
Created OLE object.

addOleObjectFrame

public IOleObjectFrame addOleObjectFrame(float x,
                                         float y,
                                         float width,
                                         float height,
                                         java.lang.String className,
                                         java.lang.String path)

Adds a new OLE object to the end of a collection.

Specified by:
addOleObjectFrame in interface IShapeCollection
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.
className - Name of an OLE class.
path - Path to the linked file.

The path is stored in the presentation as is. If a relative path is specified the corresponding file will be inaccessible when opening the presentation from a different directory.

Returns:
Created OLE object.

insertOleObjectFrame

public IOleObjectFrame insertOleObjectFrame(int index,
                                            float x,
                                            float y,
                                            float width,
                                            float height,
                                            java.lang.String className,
                                            byte[] objectData)

Creates a new OLE object and inserts it to a collection at the specified index.

Specified by:
insertOleObjectFrame in interface IShapeCollection
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.
className - Name of an OLE class.
objectData - OLE object's data.
Returns:
Created OLE object.

insertOleObjectFrame

public IOleObjectFrame insertOleObjectFrame(int index,
                                            float x,
                                            float y,
                                            float width,
                                            float height,
                                            java.lang.String className,
                                            java.lang.String path)

Creates a new OLE object and inserts it to a collection at the specified index.

Specified by:
insertOleObjectFrame in interface IShapeCollection
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.
className - Name of an OLE class.
path - Path to the linked file.
Returns:
Created OLE object.

addVideoFrame

public IVideoFrame addVideoFrame(float x,
                                 float y,
                                 float width,
                                 float height,
                                 java.lang.String fname)

Adds a new video frame to the end of a collection.

Specified by:
addVideoFrame in interface IShapeCollection
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 VideoFrame object.

addVideoFrame

public IVideoFrame addVideoFrame(float x,
                                 float y,
                                 float width,
                                 float height,
                                 IVideo video)

Adds a new video frame to the end of a collection.

Specified by:
addVideoFrame in interface IShapeCollection
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.
video - Video to add.
Returns:
Created VideoFrame object.

insertVideoFrame

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

Specified by:
insertVideoFrame in interface IShapeCollection
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.
Returns:
Created VideoFrame object.

addAudioFrameCD

public IAudioFrame addAudioFrameCD(float x,
                                   float y,
                                   float width,
                                   float height)

Adds an AudioFrame with CD to the end of collection.

Specified by:
addAudioFrameCD in interface IShapeCollection
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 AudioFrame object.

insertAudioFrameCD

public IAudioFrame insertAudioFrameCD(int index,
                                      float x,
                                      float y,
                                      float width,
                                      float height)

Insert an AudioFrame with CD.

Specified by:
insertAudioFrameCD in interface IShapeCollection
Parameters:
index - The zero-based index at which video 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.
Returns:
Created AudioFrame object.

addAudioFrameLinked

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

Specified by:
addAudioFrameLinked in interface IShapeCollection
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 AudioFrame object.

insertAudioFrameLinked

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

Specified by:
insertAudioFrameLinked in interface IShapeCollection
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.
Returns:
Created AudioFrame object.

addAudioFrameEmbedded

public IAudioFrame 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. It adds new audio into Presentation.Audios list.

Specified by:
addAudioFrameEmbedded in interface IShapeCollection
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 AudioFrame object.

insertAudioFrameEmbedded

public IAudioFrame insertAudioFrameEmbedded(int index,
                                            float x,
                                            float y,
                                            float width,
                                            float height,
                                            java.io.InputStream audio_stream)

Insert an AudioFrame with embedded audio file. Embedded audio file sound can be a WAV only.

Specified by:
insertAudioFrameEmbedded in interface IShapeCollection
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.
Returns:
Created AudioFrame object.

addAudioFrameEmbedded

public IAudioFrame addAudioFrameEmbedded(float x,
                                         float y,
                                         float width,
                                         float height,
                                         IAudio audio)

Adds a new audio frame with embedded audio file to the end of a collection. It uses audio file from Presentation.Audios list.

Specified by:
addAudioFrameEmbedded in interface IShapeCollection
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 - Audio from Presentation.Audios list.
Returns:
Created AudioFrame object.

insertAudioFrameEmbedded

public IAudioFrame insertAudioFrameEmbedded(int index,
                                            float x,
                                            float y,
                                            float width,
                                            float height,
                                            IAudio audio)

Insert an AudioFrame with embedded audio file. It uses audio file from Presentation.Audios list.

Specified by:
insertAudioFrameEmbedded in interface IShapeCollection
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 - Audio from Presentation.Audios list.
Returns:
Created AudioFrame object.

indexOf

public int indexOf(IShape shape)

Returns the zero-based index of the first occurrence of a shape in the collection.

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

toArray

public IShape[] toArray()

Creates and returns an array with all shapse in it.

Specified by:
toArray in interface IShapeCollection
Returns:
Array of Shape

toArray

public IShape[] toArray(int startIndex,
                        int count)

Creates and returns an array with all shapes from the specified range in it.

Specified by:
toArray in interface IShapeCollection
Parameters:
startIndex - An index of a first shape to return.
count - A number of shapes to return.
Returns:
Array of Shape

reorder

public void reorder(int index,
                    IShape shape)

Moves a shape from the collection to the specified position.

Specified by:
reorder in interface IShapeCollection
Parameters:
index - Target index.
shape - Shape to move.

reorder

public void reorder(int index,
                    IShape... shapes)

Moves shapes from the collection to the specified position. Shapes will be placed starting from index in order they appear in list.

Specified by:
reorder in interface IShapeCollection
Parameters:
index - Target index.
shapes - Shapes to move.

addAutoShape

public IAutoShape addAutoShape(int shapeType,
                               float x,
                               float y,
                               float width,
                               float height)

Creates a new AutoShape, tunes it from default template and adds it to the end of the collection.

Specified by:
addAutoShape in interface IShapeCollection
Parameters:
shapeType - The ShapeType of shape.
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:
Created AutoShape object.

addAutoShape

public IAutoShape addAutoShape(int shapeType,
                               float x,
                               float y,
                               float width,
                               float height,
                               boolean createFromTemplate)

Creates a new AutoShape and adds it to the end of the collection.

Specified by:
addAutoShape in interface IShapeCollection
Parameters:
shapeType - The ShapeType of shape.
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.
createFromTemplate - If true then new shape will be tuned from default template. Not empty name, simple style, text centered will be assined to the new shape. If false then all values of the properties of the new shape will have default values.
Returns:
Created AutoShape object.

insertAutoShape

public IAutoShape insertAutoShape(int index,
                                  int shapeType,
                                  float x,
                                  float y,
                                  float width,
                                  float height)

Creates a new AutoShape, tunes it from default template and inserts it to the collection at the specified index. Note: the type of the shape will be determined by the shapeType parameter.

Specified by:
insertAutoShape in interface IShapeCollection
Parameters:
index - The zero-based index at which value should be inserted.
shapeType - An ShapeType of shape.
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:
Created AutoShape object.

insertAutoShape

public IAutoShape insertAutoShape(int index,
                                  int shapeType,
                                  float x,
                                  float y,
                                  float width,
                                  float height,
                                  boolean createFromTemplate)

Creates a new AutoShape and inserts it to the collection at the specified index. Note: the type of the shape will be determined by the shapeType parameter.

Specified by:
insertAutoShape in interface IShapeCollection
Parameters:
index - The zero-based index at which value should be inserted.
shapeType - An ShapeType of shape.
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.
createFromTemplate - If true then new shape will be tuned from default template. Not empty name, simple style, text centered will be assined to the new shape. If false then all values of the properties of the new shape will have default values.
Returns:
Created AutoShape object.

addGroupShape

public IGroupShape addGroupShape()

Creates a new GroupShape and adds it to the end of the collection. GroupShape frame size and position will be fitted to content when new shape will be added into the GroupShape.

Specified by:
addGroupShape in interface IShapeCollection
Returns:
Created GroupShape object.

insertGroupShape

public IGroupShape insertGroupShape(int index)

Creates a new GroupShape and inserts it to the collection at the specified index. GroupShape frame size and position will be fitted to content when new shape will be added into the GroupShape.

Specified by:
insertGroupShape in interface IShapeCollection
Parameters:
index - The zero-based index at which value should be inserted.
Returns:
Created GroupShape object.

addConnector

public IConnector addConnector(int shapeType,
                               float x,
                               float y,
                               float width,
                               float height)

Creates a new Connector, tunes it from default template and adds it to the end of the collection.

Specified by:
addConnector in interface IShapeCollection
Parameters:
shapeType - The ShapeType of shape.
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.

addConnector

public IConnector addConnector(int shapeType,
                               float x,
                               float y,
                               float width,
                               float height,
                               boolean createFromTemplate)

Creates a new Connector and adds it to the end of the collection.

Specified by:
addConnector in interface IShapeCollection
Parameters:
shapeType - The ShapeType of shape.
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.
createFromTemplate - If true then new shape will be tuned from default template. Not empty name, simple style, text centered will be assined to the new shape. If false then all values of the properties of the new shape will have default values.
Returns:
The zero-based index of the created shape.

insertConnector

public IConnector insertConnector(int index,
                                  int shapeType,
                                  float x,
                                  float y,
                                  float width,
                                  float height)

Creates a new Connector, tunes it from default template and inserts it to the collection at the specified index.

Specified by:
insertConnector in interface IShapeCollection
Parameters:
index - The zero-based index at which value should be inserted.
shapeType - An ShapeType of shape.
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:
Created Connector object.

insertConnector

public IConnector insertConnector(int index,
                                  int shapeType,
                                  float x,
                                  float y,
                                  float width,
                                  float height,
                                  boolean createFromTemplate)

Creates a new Connector and inserts it to the collection at the specified index.

Specified by:
insertConnector in interface IShapeCollection
Parameters:
index - The zero-based index at which value should be inserted.
shapeType - An ShapeType of shape.
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.
createFromTemplate - If true then new shape will be tuned from default template. Not empty name, simple style, text centered will be assined to the new shape. If false then all values of the properties of the new shape will have default values.
Returns:
Created Connector object.

addPictureFrame

public IPictureFrame addPictureFrame(int shapeType,
                                     float x,
                                     float y,
                                     float width,
                                     float height,
                                     IPPImage image)

Creates a new PictureFrame and adds it to the end of the collection.

Specified by:
addPictureFrame in interface IShapeCollection
Parameters:
shapeType -

The shape contained in the set ShapeType of shapes, except all sorts of lines:

ShapeType.Line,

ShapeType.StraightConnector1,

ShapeType.BentConnector2,

ShapeType.BentConnector3,

ShapeType.BentConnector4,

ShapeType.BentConnector5,

ShapeType.CurvedConnector2,

ShapeType.CurvedConnector3,

ShapeType.CurvedConnector4,

ShapeType.CurvedConnector5.

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:
Created PictureFrame object.

insertPictureFrame

public IPictureFrame insertPictureFrame(int index,
                                        int shapeType,
                                        float x,
                                        float y,
                                        float width,
                                        float height,
                                        IPPImage image)

Creates a new PictureFrame and inserts it to the collection at the specified index.

Specified by:
insertPictureFrame in interface IShapeCollection
Parameters:
index - The zero-based index at which value should be inserted.
shapeType -

The shape contained in the set ShapeType of shapes, except all sorts of lines:

ShapeType.Line,

ShapeType.StraightConnector1,

ShapeType.BentConnector2,

ShapeType.BentConnector3,

ShapeType.BentConnector4,

ShapeType.BentConnector5,

ShapeType.CurvedConnector2,

ShapeType.CurvedConnector3,

ShapeType.CurvedConnector4,

ShapeType.CurvedConnector5.

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:
Created PictureFrame object.

addTable

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

Creates a new Table and adds it to the end of the collection.

Specified by:
addTable in interface IShapeCollection
Parameters:
x - The X-coordinate for a left side of shape's frame.
y - The Y-coordinate for a top side of shape's frame.
columnWidths - Array of doubles which represents widths of columns in the table.
rowHeights - Array of doubles which represents heights of rows in the table.
Returns:
Created Table object.

insertTable

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

Creates a new Table and inserts it to the collection at the specified index.

Specified by:
insertTable in interface IShapeCollection
Parameters:
index - The zero-based index at which value should be inserted.
x - The X-coordinate for a left side of shape's frame.
y - The Y-coordinate for a top side of shape's frame.
columnWidths - Array of doubles which represents widths of columns in the table.
rowHeights - Array of doubles which represents heights of rows in the table.
Returns:
Created Table object.

removeAt

public void removeAt(int index)

Removes the element at the specified index of the collection.

Specified by:
removeAt in interface IShapeCollection
Parameters:
index - The zero-based index of the element to remove.

remove

public void remove(IShape shape)

Removes the first occurrence of a specific shape from the collection.

Specified by:
remove in interface IShapeCollection
Parameters:
shape - The shape to remove from the collection.

clear

public void clear()

Removes all shapes from the collection.

Specified by:
clear in interface IShapeCollection

iterator

public com.aspose.ms.System.Collections.Generic.IGenericEnumerator<IShape> iterator()

Returns an enumerator that iterates through the collection.

Specified by:
iterator in interface com.aspose.ms.System.Collections.Generic.IGenericEnumerable<IShape>
Specified by:
iterator in interface com.aspose.ms.System.Collections.IEnumerable<IShape>
Specified by:
iterator in interface java.lang.Iterable<IShape>
Returns:
A T:System.Collections.Generic.IEnumerator`1 that can be used to iterate through the collection.

getParent_Immediate

public com.aspose.slides.IDOMObject getParent_Immediate()

Returns Parent_Immediate object. Read-only IDOMObject.


getParentGroup

public IGroupShape getParentGroup()

Returns parent GroupShape object for a shapes collection. Read-only IGroupShape.

Specified by:
getParentGroup in interface IShapeCollection

addClone

public IShape addClone(IShape sourceShape,
                       float x,
                       float y,
                       float width,
                       float height)

Adds a copy of a specified shape to the end of the collection.

Specified by:
addClone in interface IShapeCollection
Parameters:
sourceShape - Shape to clone.
x - X coordinate of a new shape.
y - Y coordinate of a new shape.
width - Width of a new shape.
height - Height of a new shape.
Returns:
New shape.

addClone

public IShape addClone(IShape sourceShape,
                       float x,
                       float y)

Adds a copy of a specified shape to the end of the collection. Width and Height of the new shape are equal to Width and Height of the sourceShape.

Specified by:
addClone in interface IShapeCollection
Parameters:
sourceShape - Shape to clone.
x - X coordinate of a new shape.
y - Y coordinate of a new shape.
Returns:
New shape.

addClone

public IShape addClone(IShape sourceShape)

Adds a copy of a specified shape to the end of the collection. X, Y, Width and Height of the new shape are equal to X, Y, Width and Height of the sourceShape.

Specified by:
addClone in interface IShapeCollection
Parameters:
sourceShape - Shape to clone.
Returns:
New shape.

insertClone

public IShape insertClone(int index,
                          IShape sourceShape,
                          float x,
                          float y,
                          float width,
                          float height)

Inserts a copy of a specified shape to specified position of the collection.

Specified by:
insertClone in interface IShapeCollection
Parameters:
index - Index of new shape.
sourceShape - Shape to clone.
x - X coordinate of a new shape.
y - Y coordinate of a new shape.
width - Width of a new shape.
height - Height of a new shape.
Returns:
Inserted shape.

insertClone

public IShape insertClone(int index,
                          IShape sourceShape,
                          float x,
                          float y)

Inserts a copy of a specified shape to specified position of the collection. Width and Height of the new shape are equal to Width and Height of the sourceShape.

Specified by:
insertClone in interface IShapeCollection
Parameters:
index - Index of new shape.
sourceShape - Shape to clone.
x - X coordinate of a new shape.
y - Y coordinate of a new shape.
Returns:
Inserted shape.

insertClone

public IShape insertClone(int index,
                          IShape sourceShape)

Inserts a copy of a specified shape to specified position of the collection. X, Y, Width and Height of the new shape are equal to X, Y, Width and Height of the sourceShape.

Specified by:
insertClone in interface IShapeCollection
Parameters:
index - Index of new shape.
sourceShape - Shape to clone.
Returns:
Inserted shape.

copyTo

public void copyTo(IShape[] array,
                   int index)

Copies all elements from the collection to the specified array.

Specified by:
copyTo in interface IGenericCollection<IShape>
Parameters:
array - Target array.
index - Starting index in the target array.

isSynchronized

public boolean isSynchronized()

Returns a value indicating whether access to the collection is synchronized (thread-safe). Read-only boolean.

Specified by:
isSynchronized in interface IGenericCollection<IShape>

getSyncRoot

public java.lang.Object getSyncRoot()

Returns a synchronization root. Read-only Object.

Specified by:
getSyncRoot in interface IGenericCollection<IShape>


Copyright © Copyright 2004-2016 Aspose Pty Ltd. All Rights Reserved.