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.

This class provides 61 methods for working with Shape objects in Java programs. Available methods include: GeometryShape, Shape, applyFrame, asIPresentationComponent, buildFrame, ensureSpPr, ensureXfrm, findPlaceholderXfrmInXml, findXfrmInElement, getAdjustments, getAlternativeText, getAlternativeTextTitle, and 48 additional methods. All public members are accessible to any Java application after installing the Aspose.Slides FOSS for Java package. Properties: adjustments, alternativeText, alternativeTextTitle, asISlideComponent, cNvPr, connectionSiteCount, and 29 more.

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 the raw frame.
frameIShapeFrameReadGets the frame.
slideIBaseSlideReadGets the slide.
presentationIPresentationReadGets the presentation.
xdoubleReadGets the x.
ydoubleReadGets the y.
widthdoubleReadGets the width.
heightdoubleReadGets the height.
rotationdoubleReadGets the rotation.
shapeStyleIShapeStyleReadGets the shape style.
shapeTypeShapeTypeReadGets the shape type.
fillFormatIFillFormatReadGets the fill format.
adjustmentsIAdjustValueCollectionReadGets the adjustments.
textHolderbooleanReadGets the text holder.
placeholderIPlaceholderReadGets the placeholder.
customDataICustomDataReadGets the custom data.
lineFormatILineFormatReadGets the line format.
threeDFormatIThreeDFormatReadGets the three d format.
effectFormatIEffectFormatReadGets the effect format.
hiddenbooleanReadGets the hidden.
zOrderPositionintReadGets the z order position.
connectionSiteCountintReadGets the connection site count.
alternativeTextStringReadGets the alternative text.
alternativeTextTitleStringReadGets the alternative text title.
nameStringReadGets the name.
decorativebooleanReadGets the decorative.
uniqueIdintReadGets the unique id.
officeInteropShapeIdintReadGets the office interop shape id.
groupedbooleanReadGets the grouped.
asISlideComponentISlideComponentReadGets the as i slide component.

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 frame.
setRawFrame(value: IShapeFrame)Sets the raw frame value.
getFrame()IShapeFrameReturns the frame.
setFrame(value: IShapeFrame)Sets the frame value.
getSlide()IBaseSlideReturns the slide.
getPresentation()IPresentationReturns the presentation.
asIPresentationComponent()IPresentationComponentCasts the shape to an IPresentationComponent
setParentSlide(slide: IBaseSlide)Sets the parent slide for this shape.
GeometryShape(xmlElement: Element, saveCallback: Runnable)Creates a GeometryShape backed by the given XML element.
setParentShapes(shapes: Iterable<IShape>)Sets the sibling shapes collection used for connection lookups.
getX()doubleReturns the x.
setX(x: double)Sets the x value.
getY()doubleReturns the y.
setY(y: double)Sets the y value.
getWidth()doubleReturns the width.
setWidth(width: double)Sets the width value.
getHeight()doubleReturns the height.
setHeight(height: double)Sets the height value.
getRotation()doubleReturns the rotation.
setRotation(rotation: double)Sets the rotation value.
getShapeStyle()IShapeStyleReturns the shape style.
getShapeType()ShapeTypeReturns the shape type.
setShapeType(value: ShapeType)Sets the shape type value.
getFillFormat()IFillFormatReturns the fill format.
getAdjustments()IAdjustValueCollectionReturns the adjustments.
isTextHolder()booleanReturns true if text holder is set.
getPlaceholder()IPlaceholderReturns the placeholder.
getCustomData()ICustomDataReturns the custom data.
getLineFormat()ILineFormatReturns the line format.
getThreeDFormat()IThreeDFormatReturns the three d format.
getEffectFormat()IEffectFormatReturns the effect format.
isHidden()booleanReturns true if hidden is set.
setHidden(value: boolean)Sets the hidden value.
getZOrderPosition()intReturns the z order position.
getConnectionSiteCount()intReturns the connection site count.
getAlternativeText()StringReturns the alternative text.
setAlternativeText(value: String)Sets the alternative text value.
getAlternativeTextTitle()StringReturns the alternative text title.
setAlternativeTextTitle(value: String)Sets the alternative text title value.
getName()StringReturns the name.
setName(value: String)Sets the name value.
isDecorative()booleanReturns true if decorative is set.
setDecorative(value: boolean)Sets the decorative value.
getUniqueId()intReturns the unique id.
getOfficeInteropShapeId()intReturns the office interop shape id.
isGrouped()booleanReturns true if grouped is set.
getAsISlideComponent()ISlideComponentReturns the as i slide component.

See Also