| Method from org.apache.poi.hssf.usermodel.HSSFPatriarch Detail: |
protected EscherAggregate _getBoundAggregate() {
return boundAggregate;
}
Returns the aggregate escher record we're bound to |
public boolean containsChart() {
// TODO - support charts properly in usermodel
// We're looking for a EscherOptRecord
EscherOptRecord optRecord = (EscherOptRecord)
boundAggregate.findFirstWithId(EscherOptRecord.RECORD_ID);
if(optRecord == null) {
// No opt record, can't have chart
return false;
}
for(Iterator it = optRecord.getEscherProperties().iterator(); it.hasNext();) {
EscherProperty prop = (EscherProperty)it.next();
if(prop.getPropertyNumber() == 896 && prop.isComplex()) {
EscherComplexProperty cp = (EscherComplexProperty)prop;
String str = StringUtil.getFromUnicodeLE(cp.getComplexData());
//System.err.println(str);
if(str.equals("Chart 1\0")) {
return true;
}
}
}
return false;
}
Does this HSSFPatriarch contain a chart?
(Technically a reference to a chart, since they
get stored in a different block of records)
FIXME - detect chart in all cases (only seems
to work on some charts so far) |
public int countOfAllChildren() {
int count = shapes.size();
for ( Iterator iterator = shapes.iterator(); iterator.hasNext(); )
{
HSSFShape shape = (HSSFShape) iterator.next();
count += shape.countOfAllChildren();
}
return count;
}
Total count of all children and their children's children. |
public HSSFComment createComment(HSSFAnchor anchor) {
HSSFComment shape = new HSSFComment(null, anchor);
shape.anchor = anchor;
shapes.add(shape);
return shape;
}
Constructs a cell comment. |
public HSSFShapeGroup createGroup(HSSFClientAnchor anchor) {
HSSFShapeGroup group = new HSSFShapeGroup(null, anchor);
group.anchor = anchor;
shapes.add(group);
return group;
}
Creates a new group record stored under this patriarch. |
public HSSFPicture createPicture(HSSFClientAnchor anchor,
int pictureIndex) {
HSSFPicture shape = new HSSFPicture(null, anchor);
shape.setPictureIndex( pictureIndex );
shape.anchor = anchor;
shape.patriarch = this;
shapes.add(shape);
return shape;
}
|
public HSSFPolygon createPolygon(HSSFClientAnchor anchor) {
HSSFPolygon shape = new HSSFPolygon(null, anchor);
shape.anchor = anchor;
shapes.add(shape);
return shape;
}
|
public HSSFSimpleShape createSimpleShape(HSSFClientAnchor anchor) {
HSSFSimpleShape shape = new HSSFSimpleShape(null, anchor);
shape.anchor = anchor;
shapes.add(shape);
return shape;
}
Creates a simple shape. This includes such shapes as lines, rectangles,
and ovals. |
public HSSFTextbox createTextbox(HSSFClientAnchor anchor) {
HSSFTextbox shape = new HSSFTextbox(null, anchor);
shape.anchor = anchor;
shapes.add(shape);
return shape;
}
Constructs a textbox under the patriarch. |
public List getChildren() {
return shapes;
}
Returns a list of all shapes contained by the patriarch. |
public int getX1() {
return x1;
}
The top left x coordinate of this group. |
public int getX2() {
return x2;
}
The bottom right x coordinate of this group. |
public int getY1() {
return y1;
}
The top left y coordinate of this group. |
public int getY2() {
return y2;
}
The bottom right y coordinate of this group. |
public void setCoordinates(int x1,
int y1,
int x2,
int y2) {
this.x1 = x1;
this.y1 = y1;
this.x2 = x2;
this.y2 = y2;
}
Sets the coordinate space of this group. All children are contrained
to these coordinates. |