ShapeCollection

ShapeCollection

Overview

ShapeCollection is a class in Aspose.Slides FOSS for Java. Inherits from: IShapeCollection, Iterable<IShape>.

Represents a collection of shapes on a slide.

Properties

NameTypeAccessDescription
spTreeElementReadGets the {@code <p:spTree>} element from the slide XML.
parentGroupIGroupShapeReadGets or sets the parent group shape for this collection

Methods

SignatureDescription
ShapeCollection()Creates an empty ShapeCollection.
ShapeCollection(spTree: Element, saveCallback: Runnable)Creates a ShapeCollection backed by the given shape tree element.
initInternal(spTree: Element, saveCallback: Runnable)Internal initialization with slide context.
getSpTree()ElementGets the {@code <p:spTree>} element from the slide XML.
loadShapes()List<IShape>Loads all shapes from the XML, using the cache when available.
invalidateCache()Invalidates the shapes cache, forcing a reload on next access.
save()Persists changes to the slide part via the save callback.
nextShapeId()intFinds the next available shape ID by scanning all {@code id} attributes
in the spTree.
buildAutoShapeXml(shapeId: int, name: String, shapeType: ShapeType, x: double, y: double, width: double, height: double, createFromTemplate: boolean)ElementBuilds XML for a new AutoShape ({@code <p:sp>}) element.
buildConnectorXml(shapeId: int, name: String, shapeType: ShapeType, x: double, y: double, width: double, height: double, createFromTemplate: boolean)ElementBuilds XML for a new connector ({@code <p:cxnSp>}) element.
addAutoShapeImpl(index: Integer, shapeType: ShapeType, x: double, y: double, width: double, height: double, createFromTemplate: boolean)IAutoShapeCore implementation for adding or inserting an AutoShape.
addConnectorImpl(index: Integer, shapeType: ShapeType, x: double, y: double, width: double, height: double, createFromTemplate: boolean)IConnectorCore implementation for adding or inserting a connector.
addPictureFrameImpl(index: Integer, shapeType: ShapeType, x: double, y: double, width: double, height: double, image: IPPImage)IPictureFrameCore implementation for adding or inserting a picture frame.
addTableImpl(index: Integer, x: double, y: double, colWidths: double[], rowHeights: double[])ITableCore implementation for adding or inserting a table.
reorderSingle(newIndex: int, shape: IShape)Reorders a single shape to a new position within the spTree XML.
getParentGroup()IGroupShapeReturns the parent IGroupShape of this collection
setParentGroup(parentGroup: IGroupShape)Sets the parent group shape for this collection.
asICollection()List<IShape>Returns the shapes as a List
asIEnumerable()Iterable<IShape>Returns the shapes as an Iterable
get(index: int)IShapeReturns the shape at the specified index
size()int
iterator()Iterator<IShape>Returns an iterator over the shapes in this collection.
addAutoShape(shapeType: ShapeType, x: double, y: double, width: double, height: double)IAutoShapeAdds a new AutoShape with given type and geometry
addAutoShape(shapeType: ShapeType, x: double, y: double, width: double, height: double, createFromTemplate: boolean)IAutoShape
insertAutoShape(index: int, shapeType: ShapeType, x: double, y: double, width: double, height: double)IAutoShapeInserts a new AutoShape at index with given type and geometry
insertAutoShape(index: int, shapeType: ShapeType, x: double, y: double, width: double, height: double, createFromTemplate: boolean)IAutoShape
addConnector(shapeType: ShapeType, x: double, y: double, width: double, height: double)IConnectorAdds a new connector with given type and geometry
addConnector(shapeType: ShapeType, x: double, y: double, width: double, height: double, createFromTemplate: boolean)IConnector
insertConnector(index: int, shapeType: ShapeType, x: double, y: double, width: double, height: double)IConnectorInserts a connector at index with given type and geometry
insertConnector(index: int, shapeType: ShapeType, x: double, y: double, width: double, height: double, createFromTemplate: boolean)IConnector
addPictureFrame(shapeType: ShapeType, x: double, y: double, width: double, height: double, image: IPPImage)IPictureFrame
insertPictureFrame(index: int, shapeType: ShapeType, x: double, y: double, width: double, height: double, image: IPPImage)IPictureFrame
addTable(x: double, y: double, colWidths: double[], rowHeights: double[])ITable
insertTable(index: int, x: double, y: double, colWidths: double[], rowHeights: double[])ITable
indexOf(shape: IShape)int
toArray()IShape[]
toArray(startIndex: int, count: int)IShape[]
reorder(index: int, shape: IShape)
reorder(index: int, shapesToReorder: IShape[])
removeAt(index: int)
remove(shape: IShape)
clear()

See Also