Package org.apache.poi.hssf.usermodel
Class HSSFShapeGroup
- java.lang.Object
-
- org.apache.poi.hssf.usermodel.HSSFShape
-
- org.apache.poi.hssf.usermodel.HSSFShapeGroup
-
- All Implemented Interfaces:
Iterable<HSSFShape>
,HSSFShapeContainer
,Shape
,ShapeContainer<HSSFShape>
public class HSSFShapeGroup extends HSSFShape implements HSSFShapeContainer
A shape group may contain other shapes. It was no actual form on the sheet.
-
-
Field Summary
-
Fields inherited from class org.apache.poi.hssf.usermodel.HSSFShape
FILL__FILLCOLOR_DEFAULT, LINESTYLE__COLOR_DEFAULT, LINESTYLE_DASHDOTDOTSYS, LINESTYLE_DASHDOTGEL, LINESTYLE_DASHDOTSYS, LINESTYLE_DASHGEL, LINESTYLE_DASHSYS, LINESTYLE_DEFAULT, LINESTYLE_DOTGEL, LINESTYLE_DOTSYS, LINESTYLE_LONGDASHDOTDOTGEL, LINESTYLE_LONGDASHDOTGEL, LINESTYLE_LONGDASHGEL, LINESTYLE_NONE, LINESTYLE_SOLID, LINEWIDTH_DEFAULT, LINEWIDTH_ONE_PT, NO_FILL_DEFAULT, NO_FILLHITTEST_FALSE, NO_FILLHITTEST_TRUE
-
-
Constructor Summary
Constructors Constructor Description HSSFShapeGroup(EscherContainerRecord spgrContainer, ObjRecord objRecord)
HSSFShapeGroup(HSSFShape parent, HSSFAnchor anchor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addShape(HSSFShape shape)
add shape to the list of child recordsprotected void
afterRemove(HSSFPatriarch patriarch)
remove escher container from the patriarch.escherAggregate remove obj, textObj and note records if it's necessary in case of ShapeGroup remove all contained shapesvoid
clear()
protected HSSFShape
cloneShape()
protected HSSFShape
cloneShape(HSSFPatriarch patriarch)
int
countOfAllChildren()
Count of all children and their childrens children.HSSFShapeGroup
createGroup(HSSFChildAnchor anchor)
Create another group under this group.protected ObjRecord
createObjRecord()
HSSFPicture
createPicture(HSSFChildAnchor anchor, int pictureIndex)
Creates a picture.HSSFPolygon
createPolygon(HSSFChildAnchor anchor)
Creates a polygonHSSFSimpleShape
createShape(HSSFChildAnchor anchor)
Create a new simple shape under this group.protected EscherContainerRecord
createSpContainer()
HSSFTextbox
createTextbox(HSSFChildAnchor anchor)
Create a new textbox under this group.List<HSSFShape>
getChildren()
Return all children contained by this shape.int
getX1()
The top left x coordinate of this group.int
getX2()
The bottom right x coordinate of this group.int
getY1()
The top left y coordinate of this group.int
getY2()
The bottom right y coordinate of this group.Iterator<HSSFShape>
iterator()
boolean
removeShape(HSSFShape shape)
remove first level shapesvoid
setCoordinates(int x1, int y1, int x2, int y2)
Sets the coordinate space of this group.Spliterator<HSSFShape>
spliterator()
-
Methods inherited from class org.apache.poi.hssf.usermodel.HSSFShape
getAnchor, getEscherContainer, getFillColor, getLineStyle, getLineStyleColor, getLineWidth, getObjRecord, getOptRecord, getParent, getPatriarch, getRotationDegree, getShapeName, isFlipHorizontal, isFlipVertical, isNoFill, setAnchor, setFillColor, setFillColor, setFlipHorizontal, setFlipVertical, setLineStyle, setLineStyleColor, setLineStyleColor, setLineWidth, setNoFill, setParent, setPatriarch, setPropertyValue, setRotationDegree
-
-
-
-
Constructor Detail
-
HSSFShapeGroup
public HSSFShapeGroup(EscherContainerRecord spgrContainer, ObjRecord objRecord)
-
HSSFShapeGroup
public HSSFShapeGroup(HSSFShape parent, HSSFAnchor anchor)
-
-
Method Detail
-
createSpContainer
protected EscherContainerRecord createSpContainer()
- Specified by:
createSpContainer
in classHSSFShape
-
createObjRecord
protected ObjRecord createObjRecord()
- Specified by:
createObjRecord
in classHSSFShape
-
afterRemove
protected void afterRemove(HSSFPatriarch patriarch)
Description copied from class:HSSFShape
remove escher container from the patriarch.escherAggregate remove obj, textObj and note records if it's necessary in case of ShapeGroup remove all contained shapes- Specified by:
afterRemove
in classHSSFShape
-
createGroup
public HSSFShapeGroup createGroup(HSSFChildAnchor anchor)
Create another group under this group.- Parameters:
anchor
- the position of the new group.- Returns:
- the group
-
addShape
public void addShape(HSSFShape shape)
Description copied from interface:HSSFShapeContainer
add shape to the list of child records- Specified by:
addShape
in interfaceHSSFShapeContainer
-
createShape
public HSSFSimpleShape createShape(HSSFChildAnchor anchor)
Create a new simple shape under this group.- Parameters:
anchor
- the position of the shape.- Returns:
- the shape
-
createTextbox
public HSSFTextbox createTextbox(HSSFChildAnchor anchor)
Create a new textbox under this group.- Parameters:
anchor
- the position of the shape.- Returns:
- the textbox
-
createPolygon
public HSSFPolygon createPolygon(HSSFChildAnchor anchor)
Creates a polygon- Parameters:
anchor
- the client anchor describes how this group is attached to the sheet.- Returns:
- the newly created shape.
-
createPicture
public HSSFPicture createPicture(HSSFChildAnchor anchor, int pictureIndex)
Creates a picture.- Parameters:
anchor
- the client anchor describes how this group is attached to the sheet.- Returns:
- the newly created shape.
-
getChildren
public List<HSSFShape> getChildren()
Return all children contained by this shape.- Specified by:
getChildren
in interfaceHSSFShapeContainer
- Returns:
- Any children contained by this shape.
-
setCoordinates
public void setCoordinates(int x1, int y1, int x2, int y2)
Sets the coordinate space of this group. All children are constrained to these coordinates.- Specified by:
setCoordinates
in interfaceHSSFShapeContainer
-
clear
public void clear()
- Specified by:
clear
in interfaceHSSFShapeContainer
-
getX1
public int getX1()
The top left x coordinate of this group.- Specified by:
getX1
in interfaceHSSFShapeContainer
- Returns:
- The top left x coordinate of this group.
-
getY1
public int getY1()
The top left y coordinate of this group.- Specified by:
getY1
in interfaceHSSFShapeContainer
- Returns:
- The top left y coordinate of this group.
-
getX2
public int getX2()
The bottom right x coordinate of this group.- Specified by:
getX2
in interfaceHSSFShapeContainer
- Returns:
- The bottom right x coordinate of this group.
-
getY2
public int getY2()
The bottom right y coordinate of this group.- Specified by:
getY2
in interfaceHSSFShapeContainer
- Returns:
- The bottom right y coordinate of this group.
-
countOfAllChildren
public int countOfAllChildren()
Count of all children and their childrens children.- Overrides:
countOfAllChildren
in classHSSFShape
-
cloneShape
protected HSSFShape cloneShape()
- Specified by:
cloneShape
in classHSSFShape
-
cloneShape
protected HSSFShape cloneShape(HSSFPatriarch patriarch)
-
removeShape
public boolean removeShape(HSSFShape shape)
Description copied from interface:HSSFShapeContainer
remove first level shapes- Specified by:
removeShape
in interfaceHSSFShapeContainer
- Parameters:
shape
- to be removed- Returns:
- true if shape is removed else return false
-
spliterator
public Spliterator<HSSFShape> spliterator()
- Specified by:
spliterator
in interfaceIterable<HSSFShape>
- Since:
- POI 5.2.0
-
-