FileDocCategorySizeDatePackage
HSSFPatriarch.javaAPI DocApache Poi 3.0.15719Mon Jan 01 18:59:10 GMT 2007org.apache.poi.hssf.usermodel

HSSFPatriarch

public class HSSFPatriarch extends Object implements HSSFShapeContainer
The patriarch is the toplevel container for shapes in a sheet. It does little other than act as a container for other shapes and groups.
author
Glen Stampoultzis (glens at apache.org)

Fields Summary
List
shapes
HSSFSheet
sheet
int
x1
int
y1
int
x2
int
y2
Constructors Summary
HSSFPatriarch(HSSFSheet sheet)
Creates the patriarch.

param
sheet the sheet this patriarch is stored in.


                         
     
    
        this.sheet = sheet;
    
Methods Summary
public intcountOfAllChildren()
Total count of all children and their children's 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.HSSFCommentcreateComment(org.apache.poi.hssf.usermodel.HSSFAnchor anchor)
Constructs a cell comment.

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

        HSSFComment shape = new HSSFComment(null, anchor);
        shape.anchor = anchor;
        shapes.add(shape);
        return shape;
    
public org.apache.poi.hssf.usermodel.HSSFShapeGroupcreateGroup(org.apache.poi.hssf.usermodel.HSSFClientAnchor anchor)
Creates a new group record stored under this patriarch.

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

        HSSFShapeGroup group = new HSSFShapeGroup(null, anchor);
        group.anchor = anchor;
        shapes.add(group);
        return group;
    
public org.apache.poi.hssf.usermodel.HSSFPicturecreatePicture(org.apache.poi.hssf.usermodel.HSSFClientAnchor 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.

        HSSFPicture shape = new HSSFPicture(null, anchor);
        shape.setPictureIndex( pictureIndex );
        shape.anchor = anchor;
        shapes.add(shape);
        return shape;
    
public org.apache.poi.hssf.usermodel.HSSFPolygoncreatePolygon(org.apache.poi.hssf.usermodel.HSSFClientAnchor 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(null, anchor);
        shape.anchor = anchor;
        shapes.add(shape);
        return shape;
    
public org.apache.poi.hssf.usermodel.HSSFSimpleShapecreateSimpleShape(org.apache.poi.hssf.usermodel.HSSFClientAnchor anchor)
Creates a simple shape. This includes such shapes as lines, rectangles, and ovals.

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

        HSSFSimpleShape shape = new HSSFSimpleShape(null, anchor);
        shape.anchor = anchor;
        shapes.add(shape);
        return shape;
    
public org.apache.poi.hssf.usermodel.HSSFTextboxcreateTextbox(org.apache.poi.hssf.usermodel.HSSFClientAnchor anchor)
Constructs a textbox under the patriarch.

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

        HSSFTextbox shape = new HSSFTextbox(null, anchor);
        shape.anchor = anchor;
        shapes.add(shape);
        return shape;
    
public java.util.ListgetChildren()
Returns a list of all shapes contained by the patriarch.

        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;