Package org.apache.poi.hslf.usermodel
Class HSLFGroupShape
java.lang.Object
org.apache.poi.hslf.usermodel.HSLFShape
org.apache.poi.hslf.usermodel.HSLFGroupShape
- All Implemented Interfaces:
Iterable<HSLFShape>,HSLFShapeContainer,GroupShape<HSLFShape,,HSLFTextParagraph> PlaceableShape<HSLFShape,,HSLFTextParagraph> Shape<HSLFShape,,HSLFTextParagraph> ShapeContainer<HSLFShape,HSLFTextParagraph>
- Direct Known Subclasses:
HSLFTable
public class HSLFGroupShape
extends HSLFShape
implements HSLFShapeContainer, GroupShape<HSLFShape,HSLFTextParagraph>
Represents a group of shapes.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionCreate a new ShapeGroup.protectedHSLFGroupShape(EscherContainerRecord escherRecord, ShapeContainer<HSLFShape, HSLFTextParagraph> parent) Create a ShapeGroup object and initialize it from the supplied Record container.Create a new ShapeGroup. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a shape to this group.create a new shape with a predefined geometry and add it to this shape containercreate a connectorcreate a new shape with a custom geometrycreate a group of shapes belonging to this containercreateOleShape(PictureData pictureData) Create a new OLE object shape with the given pictureData as preview imagecreatePicture(PictureData pictureData) create a picture belonging to this containerprotected EscherContainerRecordcreateSpContainer(boolean isChild) Create a new ShapeGroup and create an instance ofEscherSpgrContainerwhich represents a group of shapescreateTable(int numRows, int numCols) Create a new Table of the given number of rows and columnscreate a text boxReturns the anchor (the bounding box rectangle) of this shape group.<T extends EscherRecord>
TgetEscherChild(int recordId) Returnsnull- shape groups can't have hyperlinksGets the coordinate space of this group.Returns an list containing all of the elements in this container in proper sequence (from first to last element).Return type of the shape.iterator()protected voidmoveAndScale(Rectangle2D anchorDest) Moves and scales thisShapeGroupto the specified anchor.booleanremoveShape(HSLFShape shape) Removes the specified shape from this sheet, if it is present (optional operation).voidsetAnchor(Rectangle2D anchor) Sets the anchor (the bounding box rectangle) of this shape.protected voidsetExteriorAnchor(Rectangle2D anchor) voidsetInteriorAnchor(Rectangle2D anchor) Sets the coordinate space of this group.Methods inherited from class org.apache.poi.hslf.usermodel.HSLFShape
afterInsert, draw, getClientData, getClientDataRecord, getClientRecords, getEscherChild, getEscherChild, getEscherChild, getEscherOptRecord, getEscherProperty, getEscherProperty, getEscherProperty, getFill, getFillStyle, getFlipHorizontal, getFlipVertical, getParent, getRotation, getShapeId, getShapeName, getSheet, getSpContainer, isPlaceholder, moveTo, setEscherProperty, setEscherProperty, setFlipHorizontal, setFlipVertical, setRotation, setShapeId, setShapeType, setSheetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface org.apache.poi.sl.usermodel.PlaceableShape
getFlipHorizontal, getFlipVertical, getParent, getRotation, getSheet, setFlipHorizontal, setFlipVertical, setRotationMethods inherited from interface org.apache.poi.sl.usermodel.Shape
draw, getParent, getShapeId, getShapeName, getSheet
-
Constructor Details
-
HSLFGroupShape
public HSLFGroupShape()Create a new ShapeGroup. This constructor is used when a new shape is created. -
HSLFGroupShape
Create a new ShapeGroup. This constructor is used when a new shape is created.- Parameters:
parent- the parent of the shape
-
HSLFGroupShape
protected HSLFGroupShape(EscherContainerRecord escherRecord, ShapeContainer<HSLFShape, HSLFTextParagraph> parent) Create a ShapeGroup object and initialize it from the supplied Record container.- Parameters:
escherRecord-EscherSpContainercontainer which holds information about this shapeparent- the parent of the shape
-
-
Method Details
-
setAnchor
Description copied from class:HSLFShapeSets the anchor (the bounding box rectangle) of this shape. All coordinates should be expressed in points (72 dpi).- Specified by:
setAnchorin interfacePlaceableShape<HSLFShape,HSLFTextParagraph> - Overrides:
setAnchorin classHSLFShape- Parameters:
anchor- new anchor
-
setInteriorAnchor
Description copied from interface:GroupShapeSets the coordinate space of this group. All children are constrained to these coordinates.- Specified by:
setInteriorAnchorin interfaceGroupShape<HSLFShape,HSLFTextParagraph> - Parameters:
anchor- the coordinate space of this group
-
getInteriorAnchor
Description copied from interface:GroupShapeGets the coordinate space of this group. All children are constrained to these coordinates.- Specified by:
getInteriorAnchorin interfaceGroupShape<HSLFShape,HSLFTextParagraph> - Returns:
- the coordinate space of this group
-
setExteriorAnchor
-
createSpContainer
Create a new ShapeGroup and create an instance ofEscherSpgrContainerwhich represents a group of shapes- Overrides:
createSpContainerin classHSLFShape
-
addShape
Add a shape to this group.- Specified by:
addShapein interfaceShapeContainer<HSLFShape,HSLFTextParagraph> - Parameters:
shape- - the Shape to add
-
moveAndScale
Moves and scales thisShapeGroupto the specified anchor. -
getAnchor
Returns the anchor (the bounding box rectangle) of this shape group. All coordinates are expressed in points (72 dpi).- Specified by:
getAnchorin interfacePlaceableShape<HSLFShape,HSLFTextParagraph> - Specified by:
getAnchorin interfaceShape<HSLFShape,HSLFTextParagraph> - Overrides:
getAnchorin classHSLFShape- Returns:
- the anchor of this shape group
-
getShapeType
Return type of the shape. In most cases shape group type isShapeType.NOT_PRIMITIVE- Overrides:
getShapeTypein classHSLFShape- Returns:
- type of the shape.
-
getHyperlink
Returnsnull- shape groups can't have hyperlinks- Returns:
null.
-
getEscherChild
- Overrides:
getEscherChildin classHSLFShape
-
iterator
-
removeShape
Description copied from interface:ShapeContainerRemoves the specified shape from this sheet, if it is present (optional operation). If this sheet does not contain the element, it is unchanged.- Specified by:
removeShapein interfaceShapeContainer<HSLFShape,HSLFTextParagraph> - Parameters:
shape- the shape to be removed from this sheet, if present- Returns:
- true if this sheet contained the specified element
-
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<HSLFShape,HSLFTextParagraph> - Returns:
- an list containing all of the elements in this container in proper sequence
-
createTextBox
Description copied from interface:ShapeContainercreate a text box- Specified by:
createTextBoxin interfaceHSLFShapeContainer- Specified by:
createTextBoxin interfaceShapeContainer<HSLFShape,HSLFTextParagraph>
-
createAutoShape
Description copied from interface:ShapeContainercreate a new shape with a predefined geometry and add it to this shape container- Specified by:
createAutoShapein interfaceHSLFShapeContainer- Specified by:
createAutoShapein interfaceShapeContainer<HSLFShape,HSLFTextParagraph>
-
createFreeform
Description copied from interface:ShapeContainercreate a new shape with a custom geometry- Specified by:
createFreeformin interfaceHSLFShapeContainer- Specified by:
createFreeformin interfaceShapeContainer<HSLFShape,HSLFTextParagraph>
-
createConnector
Description copied from interface:ShapeContainercreate a connector- Specified by:
createConnectorin interfaceHSLFShapeContainer- Specified by:
createConnectorin interfaceShapeContainer<HSLFShape,HSLFTextParagraph>
-
createGroup
Description copied from interface:ShapeContainercreate a group of shapes belonging to this container- Specified by:
createGroupin interfaceHSLFShapeContainer- Specified by:
createGroupin interfaceShapeContainer<HSLFShape,HSLFTextParagraph>
-
createPicture
Description copied from interface:ShapeContainercreate a picture belonging to this container- Specified by:
createPicturein interfaceHSLFShapeContainer- Specified by:
createPicturein interfaceShapeContainer<HSLFShape,HSLFTextParagraph>
-
createTable
Description copied from interface:ShapeContainerCreate a new Table of the given number of rows and columns- Specified by:
createTablein interfaceShapeContainer<HSLFShape,HSLFTextParagraph> - Parameters:
numRows- the number of rowsnumCols- the number of columns
-
createOleShape
Description copied from interface:ShapeContainerCreate a new OLE object shape with the given pictureData as preview image- Specified by:
createOleShapein interfaceHSLFShapeContainer- Specified by:
createOleShapein interfaceShapeContainer<HSLFShape,HSLFTextParagraph> - Parameters:
pictureData- the preview image
-