Package org.apache.poi.xslf.usermodel
Class XSLFShape
java.lang.Object
org.apache.poi.xslf.usermodel.XSLFShape
- All Implemented Interfaces:
Shape<XSLFShape,XSLFTextParagraph>
- Direct Known Subclasses:
XSLFGraphicFrame,XSLFGroupShape,XSLFShadow,XSLFSimpleShape
Base super-class class for all shapes in PresentationML
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddraw(Graphics2D graphics, Rectangle2D bounds) booleanfetchShapeProperty(PropertyFetcher<?> visitor) Walk up the inheritance tree and fetch shape properties.protected org.openxmlformats.schemas.presentationml.x2006.main.CTBackgroundPropertiesgetBgPr()protected org.openxmlformats.schemas.drawingml.x2006.main.CTStyleMatrixReferencegetBgRef()protected <T extends XmlObject>
TReturn direct child objects of this shapeprotected org.openxmlformats.schemas.drawingml.x2006.main.CTNonVisualDrawingPropsgetCNvPr()protected PaintStyleprotected org.openxmlformats.schemas.drawingml.x2006.main.CTGroupShapePropertiesintprotected XmlObjectReturn the shape specific (visual) propertiesgetSheet()protected org.openxmlformats.schemas.drawingml.x2006.main.CTShapeStylefinal XmlObjectbooleanprotected PaintStyleselectPaint(XSLFPropertiesDelegate.XSLFFillProperties fp, org.openxmlformats.schemas.drawingml.x2006.main.CTSchemeColor phClr, PackagePart parentPart, XSLFTheme theme, boolean hasPlaceholder) Convert shape fill into java.awt.Paint.protected PaintStyleselectPaint(org.openxmlformats.schemas.drawingml.x2006.main.CTBlipFillProperties blipFill, PackagePart parentPart, org.openxmlformats.schemas.drawingml.x2006.main.CTSchemeColor phClr, XSLFTheme theme) protected PaintStyleselectPaint(org.openxmlformats.schemas.drawingml.x2006.main.CTGradientFillProperties gradFill, org.openxmlformats.schemas.drawingml.x2006.main.CTSchemeColor phClr, XSLFTheme theme) protected PaintStyleselectPaint(org.openxmlformats.schemas.drawingml.x2006.main.CTSchemeColor phClr, XSLFTheme theme) protected PaintStyleselectPaint(org.openxmlformats.schemas.drawingml.x2006.main.CTSolidColorFillProperties solidFill, org.openxmlformats.schemas.drawingml.x2006.main.CTSchemeColor phClr, XSLFTheme theme) protected PaintStyleselectPaint(org.openxmlformats.schemas.drawingml.x2006.main.CTStyleMatrixReference fillRef, XSLFTheme theme, boolean isLineStyle, boolean hasPlaceholder) protected <T extends XmlObject>
TselectProperty(Class<T> resultClass, String xquery) As there's no xmlbeans hierarchy, but XSLF works with subclassing, not all child classes work with aCTShapeobject, but often contain the same properties.voidsetParent(XSLFShapeContainer parent) voidsetPlaceholder(Placeholder placeholder)
-
Constructor Details
-
XSLFShape
-
-
Method Details
-
getXmlObject
- Returns:
- the xml bean holding this shape's data
-
getSheet
- Specified by:
getSheetin interfaceShape<XSLFShape,XSLFTextParagraph>
-
getShapeName
- Specified by:
getShapeNamein interfaceShape<XSLFShape,XSLFTextParagraph>
-
getShapeId
public int getShapeId()- Specified by:
getShapeIdin interfaceShape<XSLFShape,XSLFTextParagraph>
-
setParent
-
getParent
- Specified by:
getParentin interfaceShape<XSLFShape,XSLFTextParagraph>
-
getFillPaint
-
getBgPr
protected org.openxmlformats.schemas.presentationml.x2006.main.CTBackgroundProperties getBgPr() -
getBgRef
protected org.openxmlformats.schemas.drawingml.x2006.main.CTStyleMatrixReference getBgRef() -
getGrpSpPr
protected org.openxmlformats.schemas.drawingml.x2006.main.CTGroupShapeProperties getGrpSpPr() -
getCNvPr
protected org.openxmlformats.schemas.drawingml.x2006.main.CTNonVisualDrawingProps getCNvPr() -
getSpStyle
protected org.openxmlformats.schemas.drawingml.x2006.main.CTShapeStyle getSpStyle() -
getChild
Return direct child objects of this shape- Parameters:
childClass- the class to cast the properties tonamespace- the namespace - usually it is"http://schemas.openxmlformats.org/presentationml/2006/main"nodename- the node name, without prefix- Returns:
- the properties object or null if it can't be found
-
isPlaceholder
public boolean isPlaceholder() -
getPlaceholder
- See Also:
-
setPlaceholder
-
getPlaceholderDetails
- See Also:
-
selectProperty
As there's no xmlbeans hierarchy, but XSLF works with subclassing, not all child classes work with aCTShapeobject, but often contain the same properties. This method is the generalized form of selecting and casting those properties.- Parameters:
resultClass- the requested result classxquery- the simple (xmlbean) xpath expression to the property- Returns:
- the xml object at the xpath location, or null if not found
-
fetchShapeProperty
Walk up the inheritance tree and fetch shape properties.The following order of inheritance is assumed:
- slide
- slideLayout
- slideMaster
- Parameters:
visitor- the object that collects the desired property- Returns:
- true if the property was fetched
-
selectPaint
protected PaintStyle selectPaint(XSLFPropertiesDelegate.XSLFFillProperties fp, org.openxmlformats.schemas.drawingml.x2006.main.CTSchemeColor phClr, PackagePart parentPart, XSLFTheme theme, boolean hasPlaceholder) Convert shape fill into java.awt.Paint. The result is either Color or TexturePaint or GradientPaint or null- Parameters:
fp- a properties handler specific to the underlying shape propertiesphClr- context colorparentPart- the parent package part. Any external references (images, etc.) are resolved relative to it.theme- the theme for the shape/sheet- Returns:
- the applied Paint or null if none was applied
-
selectPaint
protected PaintStyle selectPaint(org.openxmlformats.schemas.drawingml.x2006.main.CTSchemeColor phClr, XSLFTheme theme) -
selectPaint
protected PaintStyle selectPaint(org.openxmlformats.schemas.drawingml.x2006.main.CTSolidColorFillProperties solidFill, org.openxmlformats.schemas.drawingml.x2006.main.CTSchemeColor phClr, XSLFTheme theme) -
selectPaint
protected PaintStyle selectPaint(org.openxmlformats.schemas.drawingml.x2006.main.CTBlipFillProperties blipFill, PackagePart parentPart, org.openxmlformats.schemas.drawingml.x2006.main.CTSchemeColor phClr, XSLFTheme theme) -
selectPaint
protected PaintStyle selectPaint(org.openxmlformats.schemas.drawingml.x2006.main.CTGradientFillProperties gradFill, org.openxmlformats.schemas.drawingml.x2006.main.CTSchemeColor phClr, XSLFTheme theme) -
selectPaint
protected PaintStyle selectPaint(org.openxmlformats.schemas.drawingml.x2006.main.CTStyleMatrixReference fillRef, XSLFTheme theme, boolean isLineStyle, boolean hasPlaceholder) -
draw
- Specified by:
drawin interfaceShape<XSLFShape,XSLFTextParagraph>
-
getShapeProperties
Return the shape specific (visual) properties- Returns:
- the shape specific properties
-