ShapeCollection — Aspose.Slides FOSS for Java API Reference

Enumerations ShapeCollection Klasse repräsentiert die Sammlung von Formen auf einer Folie. Sie implementiert IShapeCollection und Iterable<IShape>.

Enumerations: org.aspose.slides.foss

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

Enumerations

Enumerations

EnumerationsEnumerationsEnumerations
get(int index)IShapeForm anhand eines nullbasierten Index abrufen.
size()intAnzahl der Formen.
indexOf(IShape shape)intIndex der angegebenen Form, oder -1.
iterator()Iterator<IShape>Iterator über alle Formen.

Formen hinzufügen

EnumerationsEnumerationsEnumerations
addAutoShape(ShapeType, double x, double y, double w, double h)IAutoShapeAutomatische Form hinzufügen.
addAutoShape(ShapeType, double x, double y, double w, double h, boolean createFromTemplate)IAutoShapeAutomatische Form mit Vorlagenoption hinzufügen.
addConnector(ShapeType, double x, double y, double w, double h)IConnectorVerbindungsform hinzufügen.
addPictureFrame(ShapeType, double x, double y, double w, double h, IPPImage image)IPictureFrameBildrahmen hinzufügen.
addTable(double x, double y, double[] colWidths, double[] rowHeights)ITableTabelle hinzufügen.

Formen einfügen

EnumerationsEnumerationsEnumerations
insertAutoShape(int index, ShapeType, double x, double y, double w, double h)IAutoShapeFügen Sie eine Autoform an dem angegebenen Index ein.
insertConnector(int index, ShapeType, double x, double y, double w, double h)IConnectorFügen Sie einen Verbinder an dem angegebenen Index ein.
insertPictureFrame(int index, ShapeType, double x, double y, double w, double h, IPPImage image)IPictureFrameFügen Sie einen Bilderrahmen an dem angegebenen Index ein.
insertTable(int index, double x, double y, double[] colWidths, double[] rowHeights)ITableFügen Sie eine Tabelle an dem angegebenen Index ein.

Enumerations

EnumerationsEnumerationsEnumerations
reorderSingle(int newIndex, IShape shape)voidVerschieben Sie eine Form in eine neue Z-Order-Position.

Anwendungsbeispiele

Formen zu einer Folie hinzufügen

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);

Eine Tabelle hinzufügen

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

Siehe auch

 Deutsch