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 Constructor Description HSLFGroupShape()
Create a new ShapeGroup.HSLFGroupShape(ShapeContainer<HSLFShape,HSLFTextParagraph> parent)
Create a new ShapeGroup.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addShape(HSLFShape shape)
Add a shape to this group.HSLFAutoShape
createAutoShape()
create a new shape with a predefined geometry and add it to this shape containerHSLFConnectorShape
createConnector()
create a connectorHSLFFreeformShape
createFreeform()
create a new shape with a custom geometryHSLFGroupShape
createGroup()
create a group of shapes belonging to this containerHSLFObjectShape
createOleShape(PictureData pictureData)
Create a new OLE object shape with the given pictureData as preview imageHSLFPictureShape
createPicture(PictureData pictureData)
create a picture belonging to this containerHSLFTable
createTable(int numRows, int numCols)
Create a new Table of the given number of rows and columnsHSLFTextBox
createTextBox()
create a text boxRectangle2D
getAnchor()
Returns the anchor (the bounding box rectangle) of this shape group.<T extends EscherRecord>
TgetEscherChild(int recordId)
HSLFHyperlink
getHyperlink()
Returnsnull
- shape groups can't have hyperlinksRectangle2D
getInteriorAnchor()
Gets the coordinate space of this group.List<HSLFShape>
getShapes()
Returns an list containing all of the elements in this container in proper sequence (from first to last element).ShapeType
getShapeType()
Return type of the shape.Iterator<HSLFShape>
iterator()
boolean
removeShape(HSLFShape shape)
Removes the specified shape from this sheet, if it is present (optional operation).void
setAnchor(Rectangle2D anchor)
Sets the anchor (the bounding box rectangle) of this shape.void
setInteriorAnchor(Rectangle2D anchor)
Sets the coordinate space of this group.-
Methods inherited from class org.apache.poi.hslf.usermodel.HSLFShape
draw, getClientDataRecord, 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, setSheet
-
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
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
-
-
Method Detail
-
setAnchor
public void setAnchor(Rectangle2D anchor)
Description copied from class:HSLFShape
Sets the anchor (the bounding box rectangle) of this shape. All coordinates should be expressed in points (72 dpi).- Specified by:
setAnchor
in interfacePlaceableShape<HSLFShape,HSLFTextParagraph>
- Overrides:
setAnchor
in classHSLFShape
- Parameters:
anchor
- new anchor
-
setInteriorAnchor
public void setInteriorAnchor(Rectangle2D anchor)
Description copied from interface:GroupShape
Sets the coordinate space of this group. All children are constrained to these coordinates.- Specified by:
setInteriorAnchor
in interfaceGroupShape<HSLFShape,HSLFTextParagraph>
- Parameters:
anchor
- the coordinate space of this group
-
getInteriorAnchor
public Rectangle2D getInteriorAnchor()
Description copied from interface:GroupShape
Gets the coordinate space of this group. All children are constrained to these coordinates.- Specified by:
getInteriorAnchor
in interfaceGroupShape<HSLFShape,HSLFTextParagraph>
- Returns:
- the coordinate space of this group
-
addShape
public void addShape(HSLFShape shape)
Add a shape to this group.- Specified by:
addShape
in interfaceShapeContainer<HSLFShape,HSLFTextParagraph>
- Parameters:
shape
- - the Shape to add
-
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:
getAnchor
in interfacePlaceableShape<HSLFShape,HSLFTextParagraph>
- Specified by:
getAnchor
in interfaceShape<HSLFShape,HSLFTextParagraph>
- Overrides:
getAnchor
in 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:
getShapeType
in 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:
getEscherChild
in classHSLFShape
-
removeShape
public boolean removeShape(HSLFShape shape)
Description copied from interface:ShapeContainer
Removes 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:
removeShape
in 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
public List<HSLFShape> getShapes()
Description copied from interface:ShapeContainer
Returns an list containing all of the elements in this container in proper sequence (from first to last element).- Specified by:
getShapes
in interfaceShapeContainer<HSLFShape,HSLFTextParagraph>
- Returns:
- an list containing all of the elements in this container in proper sequence
-
createTextBox
public HSLFTextBox createTextBox()
Description copied from interface:ShapeContainer
create a text box- Specified by:
createTextBox
in interfaceHSLFShapeContainer
- Specified by:
createTextBox
in interfaceShapeContainer<HSLFShape,HSLFTextParagraph>
-
createAutoShape
public HSLFAutoShape createAutoShape()
Description copied from interface:ShapeContainer
create a new shape with a predefined geometry and add it to this shape container- Specified by:
createAutoShape
in interfaceHSLFShapeContainer
- Specified by:
createAutoShape
in interfaceShapeContainer<HSLFShape,HSLFTextParagraph>
-
createFreeform
public HSLFFreeformShape createFreeform()
Description copied from interface:ShapeContainer
create a new shape with a custom geometry- Specified by:
createFreeform
in interfaceHSLFShapeContainer
- Specified by:
createFreeform
in interfaceShapeContainer<HSLFShape,HSLFTextParagraph>
-
createConnector
public HSLFConnectorShape createConnector()
Description copied from interface:ShapeContainer
create a connector- Specified by:
createConnector
in interfaceHSLFShapeContainer
- Specified by:
createConnector
in interfaceShapeContainer<HSLFShape,HSLFTextParagraph>
-
createGroup
public HSLFGroupShape createGroup()
Description copied from interface:ShapeContainer
create a group of shapes belonging to this container- Specified by:
createGroup
in interfaceHSLFShapeContainer
- Specified by:
createGroup
in interfaceShapeContainer<HSLFShape,HSLFTextParagraph>
-
createPicture
public HSLFPictureShape createPicture(PictureData pictureData)
Description copied from interface:ShapeContainer
create a picture belonging to this container- Specified by:
createPicture
in interfaceHSLFShapeContainer
- Specified by:
createPicture
in interfaceShapeContainer<HSLFShape,HSLFTextParagraph>
-
createTable
public HSLFTable createTable(int numRows, int numCols)
Description copied from interface:ShapeContainer
Create a new Table of the given number of rows and columns- Specified by:
createTable
in interfaceShapeContainer<HSLFShape,HSLFTextParagraph>
- Parameters:
numRows
- the number of rowsnumCols
- the number of columns
-
createOleShape
public HSLFObjectShape createOleShape(PictureData pictureData)
Description copied from interface:ShapeContainer
Create a new OLE object shape with the given pictureData as preview image- Specified by:
createOleShape
in interfaceHSLFShapeContainer
- Specified by:
createOleShape
in interfaceShapeContainer<HSLFShape,HSLFTextParagraph>
- Parameters:
pictureData
- the preview image
-
-