Package 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:
Iterable<XSLFShape>,GroupShape<XSLFShape,XSLFTextParagraph>,PlaceableShape<XSLFShape,XSLFTextParagraph>,Shape<XSLFShape,XSLFTextParagraph>,ShapeContainer<XSLFShape,XSLFTextParagraph>,XSLFShapeContainer
@Beta public class XSLFGroupShape extends XSLFShape implements XSLFShapeContainer, GroupShape<XSLFShape,XSLFTextParagraph>
Represents a group shape that consists of many shapes grouped together.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddShape(XSLFShape shape)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 containerXSLFObjectShapecreateOleShape(PictureData pictureData)Create a new OLE object shape with the given pictureData as preview imageXSLFPictureShapecreatePicture(PictureData pictureData)create a picture belonging to this containerXSLFTablecreateTable()XSLFTablecreateTable(int numRows, int numCols)Create a new Table of the given number of rows and columnsXSLFTextBoxcreateTextBox()create a text boxRectangle2DgetAnchor()Returns the anchor (the bounding box rectangle) of this shape.booleangetFlipHorizontal()Whether the shape is horizontally flippedbooleangetFlipVertical()Whether the shape is vertically flippedRectangle2DgetInteriorAnchor()Gets the coordinate space of this group.doublegetRotation()Rotation angle in degreesList<XSLFShape>getShapes()Returns an list containing all of the elements in this container in proper sequence (from first to last element).Iterator<XSLFShape>iterator()Returns an iterator over the shapes in this sheetbooleanremoveShape(XSLFShape xShape)Remove the specified shape from this groupvoidsetAnchor(Rectangle2D anchor)voidsetFlipHorizontal(boolean flip)voidsetFlipVertical(boolean flip)Whether the shape is vertically flippedvoidsetInteriorAnchor(Rectangle2D anchor)Sets the coordinate space of this group.voidsetRotation(double theta)Rotate this shape.-
Methods inherited from class org.apache.poi.xslf.usermodel.XSLFShape
draw, getParent, getPlaceholder, getPlaceholderDetails, getShapeId, getShapeName, getSheet, getXmlObject, isPlaceholder, setParent, setPlaceholder
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
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
-
-
-
-
Method Detail
-
getAnchor
public Rectangle2D getAnchor()
Description copied from interface:ShapeReturns the anchor (the bounding box rectangle) of this shape. All coordinates are expressed in points (72 dpi).- Specified by:
getAnchorin interfacePlaceableShape<XSLFShape,XSLFTextParagraph>- Specified by:
getAnchorin interfaceShape<XSLFShape,XSLFTextParagraph>- Returns:
- the anchor of this shape
-
setAnchor
public void setAnchor(Rectangle2D anchor)
- Specified by:
setAnchorin interfacePlaceableShape<XSLFShape,XSLFTextParagraph>- Parameters:
anchor- the position of this shape within the drawing canvas. The coordinates are expressed in points
-
getInteriorAnchor
public Rectangle2D getInteriorAnchor()
Description copied from interface:GroupShapeGets the coordinate space of this group. All children are constrained to these coordinates.- Specified by:
getInteriorAnchorin interfaceGroupShape<XSLFShape,XSLFTextParagraph>- 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(Rectangle2D anchor)
Description copied from interface:GroupShapeSets the coordinate space of this group. All children are constrained to these coordinates.- Specified by:
setInteriorAnchorin interfaceGroupShape<XSLFShape,XSLFTextParagraph>- 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 List<XSLFShape> getShapes()
Description copied from interface:ShapeContainerReturns an list containing all of the elements in this container in proper sequence (from first to last element).- Specified by:
getShapesin interfaceShapeContainer<XSLFShape,XSLFTextParagraph>- Returns:
- child shapes contained within this group
-
removeShape
public boolean removeShape(XSLFShape xShape)
Remove the specified shape from this group- Specified by:
removeShapein interfaceShapeContainer<XSLFShape,XSLFTextParagraph>- Parameters:
xShape- the shape to be removed from this sheet, if present- Returns:
- true if this sheet contained the specified element
-
createAutoShape
public XSLFAutoShape createAutoShape()
Description copied from interface:ShapeContainercreate a new shape with a predefined geometry and add it to this shape container- Specified by:
createAutoShapein interfaceShapeContainer<XSLFShape,XSLFTextParagraph>- Specified by:
createAutoShapein interfaceXSLFShapeContainer
-
createFreeform
public XSLFFreeformShape createFreeform()
Description copied from interface:ShapeContainercreate a new shape with a custom geometry- Specified by:
createFreeformin interfaceShapeContainer<XSLFShape,XSLFTextParagraph>- Specified by:
createFreeformin interfaceXSLFShapeContainer
-
createTextBox
public XSLFTextBox createTextBox()
Description copied from interface:ShapeContainercreate a text box- Specified by:
createTextBoxin interfaceShapeContainer<XSLFShape,XSLFTextParagraph>- Specified by:
createTextBoxin interfaceXSLFShapeContainer
-
createConnector
public XSLFConnectorShape createConnector()
Description copied from interface:ShapeContainercreate a connector- Specified by:
createConnectorin interfaceShapeContainer<XSLFShape,XSLFTextParagraph>- Specified by:
createConnectorin interfaceXSLFShapeContainer
-
createGroup
public XSLFGroupShape createGroup()
Description copied from interface:ShapeContainercreate a group of shapes belonging to this container- Specified by:
createGroupin interfaceShapeContainer<XSLFShape,XSLFTextParagraph>- Specified by:
createGroupin interfaceXSLFShapeContainer
-
createPicture
public XSLFPictureShape createPicture(PictureData pictureData)
Description copied from interface:ShapeContainercreate a picture belonging to this container- Specified by:
createPicturein interfaceShapeContainer<XSLFShape,XSLFTextParagraph>- Specified by:
createPicturein interfaceXSLFShapeContainer
-
createOleShape
public XSLFObjectShape createOleShape(PictureData pictureData)
Description copied from interface:ShapeContainerCreate a new OLE object shape with the given pictureData as preview image- Specified by:
createOleShapein interfaceShapeContainer<XSLFShape,XSLFTextParagraph>- Parameters:
pictureData- the preview image
-
createTable
public XSLFTable createTable()
-
createTable
public XSLFTable createTable(int numRows, int numCols)
Description copied from interface:ShapeContainerCreate a new Table of the given number of rows and columns- Specified by:
createTablein interfaceShapeContainer<XSLFShape,XSLFTextParagraph>- Parameters:
numRows- the number of rowsnumCols- the number of columns
-
setFlipHorizontal
public void setFlipHorizontal(boolean flip)
- Specified by:
setFlipHorizontalin interfacePlaceableShape<XSLFShape,XSLFTextParagraph>- Parameters:
flip- whether the shape is horizontally flipped
-
setFlipVertical
public void setFlipVertical(boolean flip)
Description copied from interface:PlaceableShapeWhether the shape is vertically flipped- Specified by:
setFlipVerticalin interfacePlaceableShape<XSLFShape,XSLFTextParagraph>- Parameters:
flip- whether the shape is vertically flipped
-
getFlipHorizontal
public boolean getFlipHorizontal()
Description copied from interface:PlaceableShapeWhether the shape is horizontally flipped- Specified by:
getFlipHorizontalin interfacePlaceableShape<XSLFShape,XSLFTextParagraph>- Returns:
- whether the shape is horizontally flipped
-
getFlipVertical
public boolean getFlipVertical()
Description copied from interface:PlaceableShapeWhether the shape is vertically flipped- Specified by:
getFlipVerticalin interfacePlaceableShape<XSLFShape,XSLFTextParagraph>- Returns:
- whether the shape is vertically flipped
-
setRotation
public void setRotation(double theta)
Description copied from interface:PlaceableShapeRotate 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 interfacePlaceableShape<XSLFShape,XSLFTextParagraph>- Parameters:
theta- the rotation angle in degrees.
-
getRotation
public double getRotation()
Description copied from interface:PlaceableShapeRotation 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 interfacePlaceableShape<XSLFShape,XSLFTextParagraph>- Returns:
- rotation angle in degrees
-
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
-
addShape
public void addShape(XSLFShape shape)
- Specified by:
addShapein interfaceShapeContainer<XSLFShape,XSLFTextParagraph>
-
-