Package org.apache.poi.xslf.usermodel
Class XSLFSimpleShape
java.lang.Object
org.apache.poi.xslf.usermodel.XSLFShape
org.apache.poi.xslf.usermodel.XSLFSimpleShape
- All Implemented Interfaces:
IAdjustableShape
,PlaceableShape<XSLFShape,
,XSLFTextParagraph> Shape<XSLFShape,
,XSLFTextParagraph> SimpleShape<XSLFShape,
XSLFTextParagraph>
- Direct Known Subclasses:
XSLFBackground
,XSLFConnectorShape
,XSLFPictureShape
,XSLFTextShape
@Beta
public abstract class XSLFSimpleShape
extends XSLFShape
implements SimpleShape<XSLFShape,XSLFTextParagraph>
Represents a single (non-group) shape in a .pptx slide show
-
Method Summary
Modifier and TypeMethodDescriptionCreates a hyperlink and asigns it to this shape.getAdjustValue
(String name) Returns the anchor (the bounding box rectangle) of this shape.Returns the solid color fill.fetch shape fill as a java.awt.Paintboolean
Whether the shape is horizontally flippedboolean
Whether the shape is vertically flippedReturns the hyperlink assigned to this shapeprotected PaintStyle
double
double
Rotation angle in degreesprotected org.openxmlformats.schemas.drawingml.x2006.main.CTTransform2D
getXfrm
(boolean create) void
setAnchor
(Rectangle2D anchor) void
setFillColor
(Color color) Specifies a solid color fill.void
setFlipHorizontal
(boolean flip) void
setFlipVertical
(boolean flip) Whether the shape is vertically flippedvoid
void
setLineColor
(Color color) void
setLineCompound
(StrokeStyle.LineCompound compound) void
void
Specifies the line end decoration, such as a triangle or arrowhead.void
Specifies the line end width in relation to the line width.void
specifies decoration width of the head of a line.void
Specifies the line end decoration, such as a triangle or arrowhead.void
Specifies the line end width in relation to the line width.void
specifies decorations which can be added to the tail of a line.void
setLineWidth
(double width) void
setRotation
(double theta) Rotate this shape.void
setShapeType
(ShapeType type) void
setStrokeStyle
(Object... styles) Sets the line attributes.Methods inherited from class org.apache.poi.xslf.usermodel.XSLFShape
draw, fetchShapeProperty, getBgPr, getBgRef, getChild, getCNvPr, getFillPaint, getGrpSpPr, getParent, getPlaceholder, getPlaceholderDetails, getShapeId, getShapeName, getShapeProperties, getSheet, getSpStyle, getXmlObject, isPlaceholder, selectPaint, selectPaint, selectPaint, selectPaint, selectPaint, selectProperty, setParent, setPlaceholder
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.poi.sl.usermodel.PlaceableShape
getParent, getSheet
Methods inherited from interface org.apache.poi.sl.usermodel.Shape
draw, getParent, getShapeId, getShapeName, getSheet
Methods inherited from interface org.apache.poi.sl.usermodel.SimpleShape
getPlaceholder, getPlaceholderDetails, isPlaceholder, setPlaceholder
-
Method Details
-
setShapeType
- Specified by:
setShapeType
in interfaceSimpleShape<XSLFShape,
XSLFTextParagraph>
-
getShapeType
- Specified by:
getShapeType
in interfaceSimpleShape<XSLFShape,
XSLFTextParagraph>
-
getXfrm
protected org.openxmlformats.schemas.drawingml.x2006.main.CTTransform2D getXfrm(boolean create) -
getAnchor
Description copied from interface:Shape
Returns the anchor (the bounding box rectangle) of this shape. All coordinates are expressed in points (72 dpi).- Specified by:
getAnchor
in interfacePlaceableShape<XSLFShape,
XSLFTextParagraph> - Specified by:
getAnchor
in interfaceShape<XSLFShape,
XSLFTextParagraph> - Returns:
- the anchor of this shape
-
setAnchor
- Specified by:
setAnchor
in interfacePlaceableShape<XSLFShape,
XSLFTextParagraph> - Parameters:
anchor
- the position of this shape within the drawing canvas. The coordinates are expressed in points
-
setRotation
public void setRotation(double theta) Description copied from interface:PlaceableShape
Rotate this shape.Positive angles are clockwise (i.e., towards the positive y axis); negative angles are counter-clockwise (i.e., towards the negative y axis).
- Specified by:
setRotation
in interfacePlaceableShape<XSLFShape,
XSLFTextParagraph> - Parameters:
theta
- the rotation angle in degrees.
-
getRotation
public double getRotation()Description copied from interface:PlaceableShape
Rotation angle in degreesPositive angles are clockwise (i.e., towards the positive y axis); negative angles are counter-clockwise (i.e., towards the negative y axis).
- Specified by:
getRotation
in interfacePlaceableShape<XSLFShape,
XSLFTextParagraph> - Returns:
- rotation angle in degrees
-
setFlipHorizontal
public void setFlipHorizontal(boolean flip) - Specified by:
setFlipHorizontal
in interfacePlaceableShape<XSLFShape,
XSLFTextParagraph> - Parameters:
flip
- whether the shape is horizontally flipped
-
setFlipVertical
public void setFlipVertical(boolean flip) Description copied from interface:PlaceableShape
Whether the shape is vertically flipped- Specified by:
setFlipVertical
in interfacePlaceableShape<XSLFShape,
XSLFTextParagraph> - Parameters:
flip
- whether the shape is vertically flipped
-
getFlipHorizontal
public boolean getFlipHorizontal()Description copied from interface:PlaceableShape
Whether the shape is horizontally flipped- Specified by:
getFlipHorizontal
in interfacePlaceableShape<XSLFShape,
XSLFTextParagraph> - Returns:
- whether the shape is horizontally flipped
-
getFlipVertical
public boolean getFlipVertical()Description copied from interface:PlaceableShape
Whether the shape is vertically flipped- Specified by:
getFlipVertical
in interfacePlaceableShape<XSLFShape,
XSLFTextParagraph> - Returns:
- whether the shape is vertically flipped
-
setLineColor
- Parameters:
color
- the color to paint the shape outline. Anull
value turns off the shape outline.
-
getLineColor
- Returns:
- the color of the shape outline or
null
if outline is turned off
-
getLinePaint
-
setLineWidth
public void setLineWidth(double width) - Parameters:
width
- line width in points.0
means no line
-
getLineWidth
public double getLineWidth()- Returns:
- line width in points.
0
means no line.
-
setLineCompound
- Parameters:
compound
- set the line compound style
-
getLineCompound
- Returns:
- the line compound
-
setLineDash
- Parameters:
dash
- a preset line dashing scheme to stroke thr shape outline
-
getLineDash
- Returns:
- a preset line dashing scheme to stroke the shape outline
-
setLineCap
- Parameters:
cap
- the line end cap style
-
getLineCap
- Returns:
- the line end cap style
-
setFillColor
Description copied from interface:SimpleShape
Specifies a solid color fill. The shape is filled entirely with the specified color.- Specified by:
setFillColor
in interfaceSimpleShape<XSLFShape,
XSLFTextParagraph> - Parameters:
color
- the solid color fill. The value ofnull
unsets the solid fill attribute from the underlying implementation
-
getFillColor
Description copied from interface:SimpleShape
Returns the solid color fill.- Specified by:
getFillColor
in interfaceSimpleShape<XSLFShape,
XSLFTextParagraph> - Returns:
- solid fill color of null if not set or fill color is not solid (pattern or gradient)
-
getShadow
- Specified by:
getShadow
in interfaceSimpleShape<XSLFShape,
XSLFTextParagraph> - Returns:
- shadow of this shape or null if shadow is disabled
-
getGeometry
- Specified by:
getGeometry
in interfaceSimpleShape<XSLFShape,
XSLFTextParagraph> - Returns:
- definition of the shape geometry
-
setLineHeadDecoration
Specifies the line end decoration, such as a triangle or arrowhead.- Parameters:
style
- the line end docoration style
-
getLineHeadDecoration
- Returns:
- the line end decoration shape
-
setLineHeadWidth
specifies decoration width of the head of a line.- Parameters:
style
- the decoration width
-
getLineHeadWidth
- Returns:
- the line end decoration width
-
setLineHeadLength
Specifies the line end width in relation to the line width. -
getLineHeadLength
- Returns:
- the line end decoration length
-
setLineTailDecoration
Specifies the line end decoration, such as a triangle or arrowhead. -
getLineTailDecoration
- Returns:
- the line end decoration shape
-
setLineTailWidth
specifies decorations which can be added to the tail of a line. -
getLineTailWidth
- Returns:
- the line end decoration width
-
setLineTailLength
Specifies the line end width in relation to the line width. -
getLineTailLength
- Returns:
- the line end decoration length
-
getAdjustValue
- Specified by:
getAdjustValue
in interfaceIAdjustableShape
- Parameters:
name
- name of a adjust value, e.g. adj1- Returns:
- adjust guide defined in the shape or null
-
getLineDecoration
- Specified by:
getLineDecoration
in interfaceSimpleShape<XSLFShape,
XSLFTextParagraph>
-
getFillStyle
fetch shape fill as a java.awt.Paint- Specified by:
getFillStyle
in interfaceSimpleShape<XSLFShape,
XSLFTextParagraph> - Returns:
- either Color or GradientPaint or TexturePaint or null
-
getStrokeStyle
- Specified by:
getStrokeStyle
in interfaceSimpleShape<XSLFShape,
XSLFTextParagraph>
-
setStrokeStyle
Description copied from interface:SimpleShape
Sets the line attributes. Possible attributes are Double (width), LineCap, LineDash, LineCompound, Color (implementations of PaintStyle aren't yet supported ...) If no styles are given, the line will be hidden- Specified by:
setStrokeStyle
in interfaceSimpleShape<XSLFShape,
XSLFTextParagraph> - Parameters:
styles
- the line attributes
-
getHyperlink
Description copied from interface:SimpleShape
Returns the hyperlink assigned to this shape- Specified by:
getHyperlink
in interfaceSimpleShape<XSLFShape,
XSLFTextParagraph> - Returns:
- the hyperlink assigned to this shape
or
null
if not found.
-
createHyperlink
Description copied from interface:SimpleShape
Creates a hyperlink and asigns it to this shape. If the shape has already a hyperlink assigned, return it instead- Specified by:
createHyperlink
in interfaceSimpleShape<XSLFShape,
XSLFTextParagraph> - Returns:
- the hyperlink assigned to this shape
-