FileDocCategorySizeDatePackage
HSSFShapeGroup.javaAPI DocApache Poi 3.0.14805Thu May 31 18:44:06 BST 2007org.apache.poi.hssf.usermodel

HSSFShapeGroup

public class HSSFShapeGroup extends HSSFShape implements HSSFShapeContainer
A shape group may contain other shapes. It was no actual form on the sheet.
author
Glen Stampoultzis (glens at apache.org)

Fields Summary
List
shapes
int
x1
int
y1
int
x2
int
y2
Constructors Summary
public HSSFShapeGroup(HSSFShape parent, HSSFAnchor anchor)



          
    
        super( parent, anchor );
    
Methods Summary
public intcountOfAllChildren()
Count of all children and their childrens children.

        int count = shapes.size();
        for ( Iterator iterator = shapes.iterator(); iterator.hasNext(); )
        {
            HSSFShape shape = (HSSFShape) iterator.next();
            count += shape.countOfAllChildren();
        }
        return count;
    
public org.apache.poi.hssf.usermodel.HSSFShapeGroupcreateGroup(org.apache.poi.hssf.usermodel.HSSFChildAnchor anchor)
Create another group under this group.

param
anchor the position of the new group.
return
the group

        HSSFShapeGroup group = new HSSFShapeGroup(this, anchor);
        group.anchor = anchor;
        shapes.add(group);
        return group;
    
public org.apache.poi.hssf.usermodel.HSSFPicturecreatePicture(org.apache.poi.hssf.usermodel.HSSFChildAnchor anchor, int pictureIndex)
Creates a picture.

param
anchor the client anchor describes how this group is attached to the sheet.
return
the newly created shape.
author
zunker

      HSSFPicture shape = new HSSFPicture(this, anchor);
      shape.anchor = anchor;
      shape.setPictureIndex( pictureIndex );
      shapes.add(shape);
      return shape;
    
public org.apache.poi.hssf.usermodel.HSSFPolygoncreatePolygon(org.apache.poi.hssf.usermodel.HSSFChildAnchor anchor)
Creates a polygon

param
anchor the client anchor describes how this group is attached to the sheet.
return
the newly created shape.

        HSSFPolygon shape = new HSSFPolygon(this, anchor);
        shape.anchor = anchor;
        shapes.add(shape);
        return shape;
    
public org.apache.poi.hssf.usermodel.HSSFSimpleShapecreateShape(org.apache.poi.hssf.usermodel.HSSFChildAnchor anchor)
Create a new simple shape under this group.

param
anchor the position of the shape.
return
the shape

        HSSFSimpleShape shape = new HSSFSimpleShape(this, anchor);
        shape.anchor = anchor;
        shapes.add(shape);
        return shape;
    
public org.apache.poi.hssf.usermodel.HSSFTextboxcreateTextbox(org.apache.poi.hssf.usermodel.HSSFChildAnchor anchor)
Create a new textbox under this group.

param
anchor the position of the shape.
return
the textbox

        HSSFTextbox shape = new HSSFTextbox(this, anchor);
        shape.anchor = anchor;
        shapes.add(shape);
        return shape;
    
public java.util.ListgetChildren()
Return all children contained by this shape.

        return shapes;
    
public intgetX1()
The top left x coordinate of this group.

        return x1;
    
public intgetX2()
The bottom right x coordinate of this group.

        return x2;
    
public intgetY1()
The top left y coordinate of this group.

        return y1;
    
public intgetY2()
The bottom right y coordinate of this group.

        return y2;
    
public voidsetCoordinates(int x1, int y1, int x2, int y2)
Sets the coordinate space of this group. All children are contrained to these coordinates.

        this.x1 = x1;
        this.y1 = y1;
        this.x2 = x2;
        this.y2 = y2;