@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 org.openxmlformats.schemas.drawingml.x2006.main.CTNonVisualDrawingProps |
getCNvPr() |
protected org.openxmlformats.schemas.presentationml.x2006.main.CTPlaceholder |
getCTPlaceholder() |
protected PaintStyle |
getFillPaint() |
protected org.openxmlformats.schemas.drawingml.x2006.main.CTGroupShapeProperties |
getGrpSpPr() |
protected PaintStyle |
getPaint(org.apache.xmlbeans.XmlObject spPr,
org.openxmlformats.schemas.drawingml.x2006.main.CTSchemeColor phClr) |
XSLFShapeContainer |
getParent() |
Placeholder |
getPlaceholder() |
int |
getShapeId()
Returns a unique identifier for this shape within the current document.
|
java.lang.String |
getShapeName() |
XSLFSheet |
getSheet() |
protected org.openxmlformats.schemas.drawingml.x2006.main.CTShapeProperties |
getSpPr() |
protected org.openxmlformats.schemas.drawingml.x2006.main.CTShapeStyle |
getSpStyle() |
org.apache.xmlbeans.XmlObject |
getXmlObject() |
protected PaintStyle |
selectPaint(org.openxmlformats.schemas.drawingml.x2006.main.CTBlipFillProperties blipFill,
PackagePart parentPart) |
protected PaintStyle |
selectPaint(org.openxmlformats.schemas.drawingml.x2006.main.CTGradientFillProperties gradFill,
org.openxmlformats.schemas.drawingml.x2006.main.CTSchemeColor phClr) |
protected PaintStyle |
selectPaint(org.openxmlformats.schemas.drawingml.x2006.main.CTSolidColorFillProperties solidFill,
org.openxmlformats.schemas.drawingml.x2006.main.CTSchemeColor phClr) |
protected PaintStyle |
selectPaint(org.openxmlformats.schemas.drawingml.x2006.main.CTStyleMatrixReference fillRef) |
protected PaintStyle |
selectPaint(org.apache.xmlbeans.XmlObject obj,
org.openxmlformats.schemas.drawingml.x2006.main.CTSchemeColor phClr,
PackagePart parentPart)
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) |
protected void |
setPlaceholder(Placeholder placeholder)
Specifies that the corresponding shape should be represented by the generating application
as a 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()
public int getShapeId()
If multiple objects within the same document share the same id attribute value, then the document shall be considered non-conformant.
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.CTShapeProperties getSpPr()
protected org.openxmlformats.schemas.drawingml.x2006.main.CTShapeStyle getSpStyle()
protected org.openxmlformats.schemas.presentationml.x2006.main.CTPlaceholder getCTPlaceholder()
public Placeholder getPlaceholder()
protected void setPlaceholder(Placeholder placeholder)
placeholder
- 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)
slide <-- slideLayout <-- slideMaster
visitor
- the object that collects the desired propertyprotected PaintStyle getPaint(org.apache.xmlbeans.XmlObject spPr, org.openxmlformats.schemas.drawingml.x2006.main.CTSchemeColor phClr)
protected PaintStyle selectPaint(org.apache.xmlbeans.XmlObject obj, org.openxmlformats.schemas.drawingml.x2006.main.CTSchemeColor phClr, PackagePart parentPart)
obj
- the xml to read. Must contain elements from the EG_ColorChoice group:
a:scrgbClr RGB Color Model - Percentage Variant
a:srgbClr RGB Color Model - Hex Variant
a:hslClr Hue, Saturation, Luminance Color Model
a:sysClr System Color
a:schemeClr Scheme Color
a:prstClr Preset Color
phClr
- context colorparentPart
- the parent package part. Any external references (images, etc.) are resolved relative to it.protected PaintStyle selectPaint(org.openxmlformats.schemas.drawingml.x2006.main.CTSolidColorFillProperties solidFill, org.openxmlformats.schemas.drawingml.x2006.main.CTSchemeColor phClr)
protected PaintStyle selectPaint(org.openxmlformats.schemas.drawingml.x2006.main.CTBlipFillProperties blipFill, PackagePart parentPart)
protected PaintStyle selectPaint(org.openxmlformats.schemas.drawingml.x2006.main.CTGradientFillProperties gradFill, org.openxmlformats.schemas.drawingml.x2006.main.CTSchemeColor phClr)
protected PaintStyle selectPaint(org.openxmlformats.schemas.drawingml.x2006.main.CTStyleMatrixReference fillRef)
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.Copyright 2016 The Apache Software Foundation or its licensors, as applicable.