ShapeCollection

ShapeCollection — Aspose.Slides FOSS for Java API Reference

BoundingBoxExtent ShapeCollection klasse vertegenwoordigt de verzameling vormen op een dia. Het implementeert IShapeCollection en Iterable<IShape>.

BoundingBoxExtent: org.aspose.slides.foss

import org.aspose.slides.foss.*;
public class ShapeCollection implements IShapeCollection, Iterable<IShape>

BoundingBoxExtent

BoundingBoxExtent

BoundingBoxExtentBoundingBoxExtentBoundingBoxExtent
get(int index)IShapeHaal vorm op met nul‑gebaseerde index.
size()intAantal vormen.
indexOf(IShape shape)intIndex van de opgegeven vorm, of -1.
iterator()Iterator<IShape>Iterator over alle vormen.

Vormen toevoegen

BoundingBoxExtentBoundingBoxExtentBoundingBoxExtent
addAutoShape(ShapeType, double x, double y, double w, double h)IAutoShapeVoeg een auto shape toe.
addAutoShape(ShapeType, double x, double y, double w, double h, boolean createFromTemplate)IAutoShapeVoeg een auto shape toe met sjabloonoptie.
addConnector(ShapeType, double x, double y, double w, double h)IConnectorVoeg een connector shape toe.
addPictureFrame(ShapeType, double x, double y, double w, double h, IPPImage image)IPictureFrameVoeg een picture frame toe.
addTable(double x, double y, double[] colWidths, double[] rowHeights)ITableVoeg een tabel toe.

Vormen invoegen

BoundingBoxExtentBoundingBoxExtentBoundingBoxExtent
insertAutoShape(int index, ShapeType, double x, double y, double w, double h)IAutoShapeVoeg een auto shape in op de opgegeven index.
insertConnector(int index, ShapeType, double x, double y, double w, double h)IConnectorVoeg een connector in op de opgegeven index.
insertPictureFrame(int index, ShapeType, double x, double y, double w, double h, IPPImage image)IPictureFrameVoeg een picture frame in op de opgegeven index.
insertTable(int index, double x, double y, double[] colWidths, double[] rowHeights)ITableVoeg een tabel in op de opgegeven index.

BoundingBoxExtent

BoundingBoxExtentBoundingBoxExtentBoundingBoxExtent
reorderSingle(int newIndex, IShape shape)voidVerplaats een vorm naar een nieuwe z-order positie.

Voorbeelden van gebruik

Vormen aan een dia toevoegen

import org.aspose.slides.foss.*;

Presentation prs = new Presentation();
ISlide slide = prs.getSlides().get(0);
IShapeCollection shapes = slide.getShapes();

IAutoShape rect = shapes.addAutoShape(ShapeType.RECTANGLE, 50, 50, 200, 100);
rect.addTextFrame("Rectangle");

IAutoShape ellipse = shapes.addAutoShape(ShapeType.ELLIPSE, 300, 50, 100, 100);

System.out.println("Shape count: " + shapes.size());
prs.save("shapes.pptx", SaveFormat.PPTX);

Een tabel toevoegen

double[] colWidths = {100, 100, 100};
double[] rowHeights = {30, 30, 30};
ITable table = slide.getShapes().addTable(50, 200, colWidths, rowHeights);

See Also

 Nederlands