@Beta public abstract class XSLFShape extends java.lang.Object implements Shape<XSLFShape,XSLFTextParagraph>
Modifier | Constructor and Description |
---|---|
protected |
XSLFShape(org.apache.xmlbeans.XmlObject shape,
XSLFSheet sheet) |
Modifier and Type | Method and Description |
---|---|
void |
draw(java.awt.Graphics2D graphics,
java.awt.geom.Rectangle2D bounds)
Convenience method to draw a single shape
|
protected boolean |
fetchShapeProperty(PropertyFetcher<?> visitor)
Walk up the inheritance tree and fetch shape properties.
|
protected org.openxmlformats.schemas.presentationml.x2006.main.CTBackgroundProperties |
getBgPr() |
protected org.openxmlformats.schemas.drawingml.x2006.main.CTStyleMatrixReference |
getBgRef() |
protected <T extends org.apache.xmlbeans.XmlObject> |
getChild(java.lang.Class<T> childClass,
java.lang.String namespace,
java.lang.String nodename)
Return direct child objects of this shape
|
protected org.openxmlformats.schemas.drawingml.x2006.main.CTNonVisualDrawingProps |
getCNvPr() |
protected PaintStyle |
getFillPaint() |
protected org.openxmlformats.schemas.drawingml.x2006.main.CTGroupShapeProperties |
getGrpSpPr() |
XSLFShapeContainer |
getParent() |
Placeholder |
getPlaceholder() |
XSLFPlaceholderDetails |
getPlaceholderDetails() |
int |
getShapeId()
Returns a unique identifier for this shape within the current slide.
|
java.lang.String |
getShapeName() |
protected org.apache.xmlbeans.XmlObject |
getShapeProperties()
Return the shape specific (visual) properties
|
XSLFSheet |
getSheet() |
protected org.openxmlformats.schemas.drawingml.x2006.main.CTShapeStyle |
getSpStyle() |
org.apache.xmlbeans.XmlObject |
getXmlObject() |
boolean |
isPlaceholder() |
protected static PaintStyle |
selectPaint(org.openxmlformats.schemas.drawingml.x2006.main.CTBlipFillProperties blipFill,
PackagePart parentPart) |
protected static PaintStyle |
selectPaint(org.openxmlformats.schemas.drawingml.x2006.main.CTGradientFillProperties gradFill,
org.openxmlformats.schemas.drawingml.x2006.main.CTSchemeColor phClr,
XSLFTheme theme) |
protected static PaintStyle |
selectPaint(org.openxmlformats.schemas.drawingml.x2006.main.CTSolidColorFillProperties solidFill,
org.openxmlformats.schemas.drawingml.x2006.main.CTSchemeColor phClr,
XSLFTheme theme) |
protected static PaintStyle |
selectPaint(org.openxmlformats.schemas.drawingml.x2006.main.CTStyleMatrixReference fillRef,
XSLFTheme theme,
boolean isLineStyle,
boolean hasPlaceholder) |
protected static 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.
|
protected <T extends org.apache.xmlbeans.XmlObject> |
selectProperty(java.lang.Class<T> resultClass,
java.lang.String xquery)
As there's no xmlbeans hierarchy, but XSLF works with subclassing, not all
child classes work with a
CTShape object, but often contain the same
properties. |
void |
setParent(XSLFShapeContainer parent) |
void |
setPlaceholder(Placeholder placeholder) |
protected XSLFShape(org.apache.xmlbeans.XmlObject shape, XSLFSheet sheet)
public final org.apache.xmlbeans.XmlObject getXmlObject()
public XSLFSheet getSheet()
getSheet
in interface Shape<XSLFShape,XSLFTextParagraph>
public java.lang.String getShapeName()
getShapeName
in interface Shape<XSLFShape,XSLFTextParagraph>
public int getShapeId()
Shape
If multiple objects within the same slide share the same id attribute value, then the document shall be considered non-conformant.
getShapeId
in interface Shape<XSLFShape,XSLFTextParagraph>
public void setParent(XSLFShapeContainer parent)
public XSLFShapeContainer getParent()
getParent
in interface Shape<XSLFShape,XSLFTextParagraph>
protected PaintStyle getFillPaint()
protected org.openxmlformats.schemas.presentationml.x2006.main.CTBackgroundProperties getBgPr()
protected org.openxmlformats.schemas.drawingml.x2006.main.CTStyleMatrixReference getBgRef()
protected org.openxmlformats.schemas.drawingml.x2006.main.CTGroupShapeProperties getGrpSpPr()
protected org.openxmlformats.schemas.drawingml.x2006.main.CTNonVisualDrawingProps getCNvPr()
protected org.openxmlformats.schemas.drawingml.x2006.main.CTShapeStyle getSpStyle()
protected <T extends org.apache.xmlbeans.XmlObject> T getChild(java.lang.Class<T> childClass, java.lang.String namespace, java.lang.String nodename)
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 prefixpublic boolean isPlaceholder()
public Placeholder getPlaceholder()
PlaceholderDetails.getPlaceholder()
public void setPlaceholder(Placeholder placeholder)
public XSLFPlaceholderDetails getPlaceholderDetails()
SimpleShape.getPlaceholderDetails()
protected <T extends org.apache.xmlbeans.XmlObject> T selectProperty(java.lang.Class<T> resultClass, java.lang.String xquery)
CTShape
object, but often contain the same
properties. This method is the generalized form of selecting and casting those
properties.resultClass
- the requested result classxquery
- the simple (xmlbean) xpath expression to the propertyprotected boolean fetchShapeProperty(PropertyFetcher<?> visitor)
The following order of inheritance is assumed:
visitor
- the object that collects the desired propertyprotected static PaintStyle selectPaint(XSLFPropertiesDelegate.XSLFFillProperties fp, org.openxmlformats.schemas.drawingml.x2006.main.CTSchemeColor phClr, PackagePart parentPart, XSLFTheme theme, boolean hasPlaceholder)
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/sheetprotected static PaintStyle selectPaint(org.openxmlformats.schemas.drawingml.x2006.main.CTSolidColorFillProperties solidFill, org.openxmlformats.schemas.drawingml.x2006.main.CTSchemeColor phClr, XSLFTheme theme)
protected static PaintStyle selectPaint(org.openxmlformats.schemas.drawingml.x2006.main.CTBlipFillProperties blipFill, PackagePart parentPart)
protected static PaintStyle selectPaint(org.openxmlformats.schemas.drawingml.x2006.main.CTGradientFillProperties gradFill, org.openxmlformats.schemas.drawingml.x2006.main.CTSchemeColor phClr, XSLFTheme theme)
protected static PaintStyle selectPaint(org.openxmlformats.schemas.drawingml.x2006.main.CTStyleMatrixReference fillRef, XSLFTheme theme, boolean isLineStyle, boolean hasPlaceholder)
public void draw(java.awt.Graphics2D graphics, java.awt.geom.Rectangle2D bounds)
Shape
draw
in interface Shape<XSLFShape,XSLFTextParagraph>
graphics
- the graphics contextbounds
- the rectangle to fit the shape to.
if null, the bounds of the shape are used.protected org.apache.xmlbeans.XmlObject getShapeProperties()
Copyright 2018 The Apache Software Foundation or its licensors, as applicable.