org.apache.poi.xslf.usermodel
Class XSLFGroupShape
- java.lang.Object
-
- org.apache.poi.xslf.usermodel.XSLFShape
-
- org.apache.poi.xslf.usermodel.XSLFGroupShape
-
- All Implemented Interfaces:
- java.lang.Iterable<XSLFShape>, XSLFShapeContainer
@Beta public class XSLFGroupShape extends XSLFShape implements XSLFShapeContainer
Represents a group shape that consists of many shapes grouped together.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidclear()Removes all of the elements from this container (optional operation).XSLFAutoShapecreateAutoShape()create a new shape with a predefined geometry and add it to this shape containerXSLFConnectorShapecreateConnector()create a connectorXSLFFreeformShapecreateFreeform()create a new shape with a custom geometryXSLFGroupShapecreateGroup()create a group of shapes belonging to this containerXSLFPictureShapecreatePicture(int pictureIndex)create a picture belonging to this containerXSLFTextBoxcreateTextBox()create a text boxvoiddraw(java.awt.Graphics2D graphics)Draw this shape into the supplied canvasjava.awt.geom.Rectangle2DgetAnchor()booleangetFlipHorizontal()Whether the shape is horizontally flippedbooleangetFlipVertical()Whether the shape is vertically flippedjava.awt.geom.Rectangle2DgetInteriorAnchor()doublegetRotation()Rotation angle in degreesintgetShapeId()Returns a unique identifier for this shape within the current document.java.lang.StringgetShapeName()XSLFShape[]getShapes()Returns an array containing all of the elements in this container in proper sequence (from first to last element).org.openxmlformats.schemas.presentationml.x2006.main.CTGroupShapegetXmlObject()java.util.Iterator<XSLFShape>iterator()Returns an iterator over the shapes in this sheetbooleanremoveShape(XSLFShape xShape)Remove the specified shape from this groupvoidsetAnchor(java.awt.geom.Rectangle2D anchor)voidsetFlipHorizontal(boolean flip)voidsetFlipVertical(boolean flip)Whether the shape is vertically flippedvoidsetInteriorAnchor(java.awt.geom.Rectangle2D anchor)voidsetRotation(double theta)Rotate this shape.
-
-
-
Method Detail
-
getXmlObject
public org.openxmlformats.schemas.presentationml.x2006.main.CTGroupShape getXmlObject()
- Specified by:
getXmlObjectin classXSLFShape- Returns:
- the xml bean holding this shape's data
-
getAnchor
public java.awt.geom.Rectangle2D getAnchor()
-
setAnchor
public void setAnchor(java.awt.geom.Rectangle2D anchor)
-
getInteriorAnchor
public java.awt.geom.Rectangle2D getInteriorAnchor()
- Returns:
- the coordinates of the child extents rectangle used for calculations of grouping, scaling, and rotation behavior of shapes placed within a group.
-
setInteriorAnchor
public void setInteriorAnchor(java.awt.geom.Rectangle2D anchor)
- Parameters:
anchor- the coordinates of the child extents rectangle used for calculations of grouping, scaling, and rotation behavior of shapes placed within a group.
-
getShapes
public XSLFShape[] getShapes()
Description copied from interface:XSLFShapeContainerReturns an array containing all of the elements in this container in proper sequence (from first to last element).- Specified by:
getShapesin interfaceXSLFShapeContainer- Returns:
- child shapes contained witin this group
-
iterator
public java.util.Iterator<XSLFShape> iterator()
Returns an iterator over the shapes in this sheet- Specified by:
iteratorin interfacejava.lang.Iterable<XSLFShape>- Returns:
- an iterator over the shapes in this sheet
-
removeShape
public boolean removeShape(XSLFShape xShape)
Remove the specified shape from this group- Specified by:
removeShapein interfaceXSLFShapeContainer- Parameters:
xShape- shape to be removed from this sheet, if present- Returns:
- true if this sheet contained the specified element
-
getShapeName
public java.lang.String getShapeName()
- Specified by:
getShapeNamein classXSLFShape- Returns:
- human-readable name of this shape, e.g. "Rectange 3"
-
getShapeId
public int getShapeId()
Description copied from class:XSLFShapeReturns a unique identifier for this shape within the current document. This ID may be used to assist in uniquely identifying this object so that it can be referred to by other parts of the document.If multiple objects within the same document share the same id attribute value, then the document shall be considered non-conformant.
- Specified by:
getShapeIdin classXSLFShape- Returns:
- unique id of this shape
-
createAutoShape
public XSLFAutoShape createAutoShape()
Description copied from interface:XSLFShapeContainercreate a new shape with a predefined geometry and add it to this shape container- Specified by:
createAutoShapein interfaceXSLFShapeContainer
-
createFreeform
public XSLFFreeformShape createFreeform()
Description copied from interface:XSLFShapeContainercreate a new shape with a custom geometry- Specified by:
createFreeformin interfaceXSLFShapeContainer
-
createTextBox
public XSLFTextBox createTextBox()
Description copied from interface:XSLFShapeContainercreate a text box- Specified by:
createTextBoxin interfaceXSLFShapeContainer
-
createConnector
public XSLFConnectorShape createConnector()
Description copied from interface:XSLFShapeContainercreate a connector- Specified by:
createConnectorin interfaceXSLFShapeContainer
-
createGroup
public XSLFGroupShape createGroup()
Description copied from interface:XSLFShapeContainercreate a group of shapes belonging to this container- Specified by:
createGroupin interfaceXSLFShapeContainer
-
createPicture
public XSLFPictureShape createPicture(int pictureIndex)
Description copied from interface:XSLFShapeContainercreate a picture belonging to this container- Specified by:
createPicturein interfaceXSLFShapeContainer
-
setFlipHorizontal
public void setFlipHorizontal(boolean flip)
- Specified by:
setFlipHorizontalin classXSLFShape- Parameters:
flip- whether the shape is horizontally flipped
-
setFlipVertical
public void setFlipVertical(boolean flip)
Description copied from class:XSLFShapeWhether the shape is vertically flipped- Specified by:
setFlipVerticalin classXSLFShape- Parameters:
flip- whether the shape is vertically flipped
-
getFlipHorizontal
public boolean getFlipHorizontal()
Description copied from class:XSLFShapeWhether the shape is horizontally flipped- Specified by:
getFlipHorizontalin classXSLFShape- Returns:
- whether the shape is horizontally flipped
-
getFlipVertical
public boolean getFlipVertical()
Description copied from class:XSLFShapeWhether the shape is vertically flipped- Specified by:
getFlipVerticalin classXSLFShape- Returns:
- whether the shape is vertically flipped
-
setRotation
public void setRotation(double theta)
Description copied from class:XSLFShapeRotate 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:
setRotationin classXSLFShape- Parameters:
theta- the rotation angle in degrees.
-
getRotation
public double getRotation()
Description copied from class:XSLFShapeRotation 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:
getRotationin classXSLFShape- Returns:
- rotation angle in degrees
-
draw
public void draw(java.awt.Graphics2D graphics)
Description copied from class:XSLFShapeDraw this shape into the supplied canvas
-
clear
public void clear()
Removes all of the elements from this container (optional operation). The container will be empty after this call returns.- Specified by:
clearin interfaceXSLFShapeContainer
-
-
DataMelt 3.0 © DataMelt by jWork.ORG