Shape

Overview

Shape is a class in Aspose.Slides FOSS for Java. Inherits from: GeometryShape, IShape, ISlideComponent.

Abstract base class for shapes on a slide.

Properties

NameTypeAccessDescription
spPrElementReadReturns the {@code <p:spPr>} (or {@code <p:grpSpPr>}) element for this shape.
cNvPrElementReadReturns the {@code <p:cNvPr>} element from the shape XML.
placeholderInfoOptional<String[]>ReadReturns placeholder information for this shape, if it is a placeholder.
inheritedXfrmElementReadWalks the layout → master chain to find an inherited {@code <a:xfrm>}
for placeholder shapes.
xfrmElementReadReturns the {@code <a:xfrm>} element for this shape.
rawFrameIShapeFrameReadGets or sets the raw IShapeFrame of the shape
frameIShapeFrameReadGets or sets the IShapeFrame representing the shape’s frame
slideIBaseSlideReadGets the parent IBaseSlide of the shape
presentationIPresentationReadGets the IPresentation that contains the shape

Methods

SignatureDescription
Shape(xmlElement: Element, saveCallback: Runnable)Creates a Shape backed by the given XML element.
Shape()Creates a Shape with no backing element.
initInternal(xmlElement: Element, opcPackage: OpcPackage, layoutPartName: String, saveCallback: Runnable, parentSlide: IBaseSlide)Internal initialization with XML element, OPC package, layout part, and parent slide.
buildFrame()IShapeFrameBuilds a {@link ShapeFrame} from the current {@code <a:xfrm>} element.
applyFrame(value: IShapeFrame)Applies a {@link IShapeFrame}’s values to the {@code <a:xfrm>} element.
getSpPr()ElementReturns the {@code <p:spPr>} (or {@code <p:grpSpPr>}) element for this shape.
ensureSpPr()ElementReturns or creates the {@code <p:spPr>} element for this shape.
getCNvPr()ElementReturns the {@code <p:cNvPr>} element from the shape XML.
findXfrmInElement(shapeElement: Element)ElementFinds the {@code <a:xfrm>} element directly within a shape XML element.
getPlaceholderInfo()Optional<String[]>Returns placeholder information for this shape, if it is a placeholder.
findPlaceholderXfrmInXml(root: Element, phType: String, phIdx: String)ElementFinds the {@code <a:xfrm>} for a matching placeholder in a layout or master XML root.
getInheritedXfrm()ElementWalks the layout → master chain to find an inherited {@code <a:xfrm>}
for placeholder shapes.
getXfrm()ElementReturns the {@code <a:xfrm>} element for this shape.
ensureXfrm()ElementReturns or creates the {@code <a:xfrm>} element for this shape.
getRawFrame()IShapeFrameReturns the raw IShapeFrame of the shape
setRawFrame(value: IShapeFrame)Sets the raw IShapeFrame of the shape
getFrame()IShapeFrameReturns the IShapeFrame representing the shape’s frame
setFrame(value: IShapeFrame)Sets the shape’s frame using an IShapeFrame
getSlide()IBaseSlide
getPresentation()IPresentationReturns the presentation containing the shape
asIPresentationComponent()IPresentationComponent
setParentSlide(slide: IBaseSlide)Sets the parent slide for this shape.