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
Constructors Modifier Constructor Description HSLFGroupShape()Create a new ShapeGroup.protectedHSLFGroupShape(EscherContainerRecord escherRecord, ShapeContainer<HSLFShape,HSLFTextParagraph> parent)Create a ShapeGroup object and initialize it from the supplied Record container.HSLFGroupShape(ShapeContainer<HSLFShape,HSLFTextParagraph> parent)Create a new ShapeGroup.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddShape(HSLFShape shape)Add a shape to this group.HSLFAutoShapecreateAutoShape()HSLFConnectorShapecreateConnector()HSLFFreeformShapecreateFreeform()HSLFGroupShapecreateGroup()HSLFObjectShapecreateOleShape(PictureData pictureData)HSLFPictureShapecreatePicture(PictureData pictureData)protected EscherContainerRecordcreateSpContainer(boolean isChild)Create a new ShapeGroup and create an instance ofEscherSpgrContainerwhich represents a group of shapesHSLFTablecreateTable(int numRows, int numCols)HSLFTextBoxcreateTextBox()Rectangle2DgetAnchor()Returns the anchor (the bounding box rectangle) of this shape group.<T extends EscherRecord>
TgetEscherChild(int recordId)HSLFHyperlinkgetHyperlink()Returnsnull- shape groups can't have hyperlinksRectangle2DgetInteriorAnchor()List<HSLFShape>getShapes()ShapeTypegetShapeType()Return type of the shape.Iterator<HSLFShape>iterator()protected voidmoveAndScale(Rectangle2D anchorDest)Moves and scales thisShapeGroupto the specified anchor.booleanremoveShape(HSLFShape shape)voidsetAnchor(Rectangle2D anchor)Sets the anchor (the bounding box rectangle) of this shape.protected voidsetExteriorAnchor(Rectangle2D anchor)voidsetInteriorAnchor(Rectangle2D anchor)Spliterator<HSLFShape>spliterator()-
Methods inherited from class org.apache.poi.hslf.usermodel.HSLFShape
afterInsert, draw, getClientData, getClientDataRecord, getClientRecords, getEscherChild, getEscherChild, getEscherChild, getEscherOptRecord, getEscherProperty, getEscherProperty, getEscherProperty, getEscherProperty, getEscherProperty, getEscherProperty, getFill, getFillStyle, getFlipHorizontal, getFlipVertical, getParent, getRotation, getShapeId, getShapeName, getSheet, getSpContainer, isPlaceholder, moveTo, setEscherProperty, setEscherProperty, setEscherProperty, setEscherProperty, setEscherProperty, setFlipHorizontal, setFlipVertical, setRotation, setShapeId, setShapeType, setSheet
-
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
getFlipHorizontal, getFlipVertical, getParent, getRotation, getSheet, setFlipHorizontal, setFlipVertical, setRotation
-
Methods inherited from interface org.apache.poi.sl.usermodel.Shape
draw, getParent, getShapeId, getShapeName, getSheet
-
-
-
-
Constructor Detail
-
HSLFGroupShape
public HSLFGroupShape()
Create a new ShapeGroup. This constructor is used when a new shape is created.
-
HSLFGroupShape
public HSLFGroupShape(ShapeContainer<HSLFShape,HSLFTextParagraph> parent)
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 Detail
-
setAnchor
public void setAnchor(Rectangle2D anchor)
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
public void setInteriorAnchor(Rectangle2D anchor)
- Specified by:
setInteriorAnchorin interfaceGroupShape<HSLFShape,HSLFTextParagraph>
-
getInteriorAnchor
public Rectangle2D getInteriorAnchor()
- Specified by:
getInteriorAnchorin interfaceGroupShape<HSLFShape,HSLFTextParagraph>
-
setExteriorAnchor
protected void setExteriorAnchor(Rectangle2D anchor)
-
createSpContainer
protected EscherContainerRecord createSpContainer(boolean isChild)
Create a new ShapeGroup and create an instance ofEscherSpgrContainerwhich represents a group of shapes- Overrides:
createSpContainerin classHSLFShape
-
addShape
public void addShape(HSLFShape shape)
Add a shape to this group.- Specified by:
addShapein interfaceShapeContainer<HSLFShape,HSLFTextParagraph>- Parameters:
shape- - the Shape to add
-
moveAndScale
protected void moveAndScale(Rectangle2D anchorDest)
Moves and scales thisShapeGroupto the specified anchor.
-
getAnchor
public Rectangle2D 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
public ShapeType getShapeType()
Return type of the shape. In most cases shape group type isShapeType.NOT_PRIMITIVE- Overrides:
getShapeTypein classHSLFShape- Returns:
- type of the shape.
-
getHyperlink
public HSLFHyperlink getHyperlink()
Returnsnull- shape groups can't have hyperlinks- Returns:
null.
-
getEscherChild
public <T extends EscherRecord> T getEscherChild(int recordId)
- Overrides:
getEscherChildin classHSLFShape
-
spliterator
public Spliterator<HSLFShape> spliterator()
- Specified by:
spliteratorin interfaceIterable<HSLFShape>- Since:
- POI 5.2.0
-
removeShape
public boolean removeShape(HSLFShape shape)
- Specified by:
removeShapein interfaceShapeContainer<HSLFShape,HSLFTextParagraph>
-
getShapes
public List<HSLFShape> getShapes()
- Specified by:
getShapesin interfaceShapeContainer<HSLFShape,HSLFTextParagraph>
-
createTextBox
public HSLFTextBox createTextBox()
- Specified by:
createTextBoxin interfaceHSLFShapeContainer- Specified by:
createTextBoxin interfaceShapeContainer<HSLFShape,HSLFTextParagraph>
-
createAutoShape
public HSLFAutoShape createAutoShape()
- Specified by:
createAutoShapein interfaceHSLFShapeContainer- Specified by:
createAutoShapein interfaceShapeContainer<HSLFShape,HSLFTextParagraph>
-
createFreeform
public HSLFFreeformShape createFreeform()
- Specified by:
createFreeformin interfaceHSLFShapeContainer- Specified by:
createFreeformin interfaceShapeContainer<HSLFShape,HSLFTextParagraph>
-
createConnector
public HSLFConnectorShape createConnector()
- Specified by:
createConnectorin interfaceHSLFShapeContainer- Specified by:
createConnectorin interfaceShapeContainer<HSLFShape,HSLFTextParagraph>
-
createGroup
public HSLFGroupShape createGroup()
- Specified by:
createGroupin interfaceHSLFShapeContainer- Specified by:
createGroupin interfaceShapeContainer<HSLFShape,HSLFTextParagraph>
-
createPicture
public HSLFPictureShape createPicture(PictureData pictureData)
- Specified by:
createPicturein interfaceHSLFShapeContainer- Specified by:
createPicturein interfaceShapeContainer<HSLFShape,HSLFTextParagraph>
-
createTable
public HSLFTable createTable(int numRows, int numCols)
- Specified by:
createTablein interfaceShapeContainer<HSLFShape,HSLFTextParagraph>
-
createOleShape
public HSLFObjectShape createOleShape(PictureData pictureData)
- Specified by:
createOleShapein interfaceHSLFShapeContainer- Specified by:
createOleShapein interfaceShapeContainer<HSLFShape,HSLFTextParagraph>
-
-