/** * YK: used to create autofilters * * @see org.apache.poi.hssf.usermodel.HSSFSheet#setAutoFilter(org.apache.poi.ss.util.CellRangeAddress) */ HSSFSimpleShape createComboBox(HSSFAnchor anchor) { HSSFCombobox shape = new HSSFCombobox(null, anchor); addShape(shape); onCreate(shape); return shape; }
/** * 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. */ public HSSFTextbox createTextbox(HSSFClientAnchor anchor) { HSSFTextbox shape = new HSSFTextbox(null, anchor); addShape(shape); onCreate(shape); return shape; }
/** * 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. */ public HSSFShapeGroup createGroup(HSSFClientAnchor anchor) { HSSFShapeGroup group = new HSSFShapeGroup(null, anchor); addShape(group); onCreate(group); return group; }
/** * Creates a polygon * * @param anchor the client anchor describes how this group is attached * to the sheet. * @return the newly created shape. */ public HSSFPolygon createPolygon(HSSFClientAnchor anchor) { HSSFPolygon shape = new HSSFPolygon(null, anchor); addShape(shape); onCreate(shape); return shape; }
/** * Constructs a cell comment. * * @param anchor the client anchor describes how this comment is attached * to the sheet. * @return the newly created comment. */ public HSSFComment createComment(HSSFAnchor anchor) { HSSFComment shape = new HSSFComment(null, anchor); addShape(shape); onCreate(shape); return shape; }
/** * Creates a simple shape. This includes such shapes as lines, rectangles, * and ovals. * * Note: Microsoft Excel seems to sometimes disallow * higher y1 than y2 or higher x1 than x2 in the anchor, you might need to * reverse them and draw shapes vertically or horizontally flipped! * * @param anchor the client anchor describes how this group is attached * to the sheet. * @return the newly created shape. */ public HSSFSimpleShape createSimpleShape(HSSFClientAnchor anchor) { HSSFSimpleShape shape = new HSSFSimpleShape(null, anchor); addShape(shape); //open existing file onCreate(shape); return shape; }
/** * Creates a picture. * * @param anchor the client anchor describes how this group is attached * to the sheet. * @param pictureIndex - pointer to the byte array saved inside workbook in escher bse record * @return the newly created shape. */ public HSSFPicture createPicture(HSSFClientAnchor anchor, int pictureIndex) { HSSFPicture shape = new HSSFPicture(null, anchor); shape.setPictureIndex(pictureIndex); addShape(shape); //open existing file onCreate(shape); return shape; }
/** * used to clone patriarch * * create patriarch from existing one * @param patriarch - copy all the shapes from this patriarch to new one * @param sheet where must be located new patriarch * @return new patriarch with copies of all shapes from the existing patriarch */ static HSSFPatriarch createPatriarch(HSSFPatriarch patriarch, HSSFSheet sheet){ HSSFPatriarch newPatriarch = new HSSFPatriarch(sheet, new EscherAggregate(true)); newPatriarch.afterCreate(); for (HSSFShape shape: patriarch.getChildren()){ HSSFShape newShape; if (shape instanceof HSSFShapeGroup){ newShape = ((HSSFShapeGroup)shape).cloneShape(newPatriarch); } else { newShape = shape.cloneShape(); } newPatriarch.onCreate(newShape); newPatriarch.addShape(newShape); } return newPatriarch; }
addShape(oleShape); onCreate(oleShape);
/** * Constructs a cell comment. * * @param anchor the client anchor describes how this comment is attached * to the sheet. * @return the newly created comment. */ public HSSFComment createComment(HSSFAnchor anchor) { HSSFComment shape = new HSSFComment(null, anchor); shape.anchor = anchor; addShape(shape); return shape; }
private static void addToParentOrContainer(HSSFShape shape, HSSFShapeContainer container, HSSFShape parent) { if (parent instanceof HSSFShapeGroup) ((HSSFShapeGroup) parent).addShape(shape); else if (container instanceof HSSFPatriarch) ((HSSFPatriarch) container).addShape(shape); else container.getChildren().add(shape); }
/** * YK: used to create autofilters * * @see org.apache.poi.hssf.usermodel.HSSFSheet#setAutoFilter(org.apache.poi.ss.util.CellRangeAddress) */ HSSFSimpleShape createComboBox(HSSFAnchor anchor) { HSSFCombobox shape = new HSSFCombobox(null, anchor); addShape(shape); onCreate(shape); return shape; }
/** * 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. */ public HSSFShapeGroup createGroup(HSSFClientAnchor anchor) { HSSFShapeGroup group = new HSSFShapeGroup(null, anchor); addShape(group); onCreate(group); return group; }
/** * YK: used to create autofilters * * @see org.apache.poi.hssf.usermodel.HSSFSheet#setAutoFilter(org.apache.poi.ss.util.CellRangeAddress) */ HSSFSimpleShape createComboBox(HSSFAnchor anchor) { HSSFCombobox shape = new HSSFCombobox(null, anchor); addShape(shape); onCreate(shape); return shape; }
/** * Creates a polygon * * @param anchor the client anchor describes how this group is attached * to the sheet. * @return the newly created shape. */ public HSSFPolygon createPolygon(HSSFClientAnchor anchor) { HSSFPolygon shape = new HSSFPolygon(null, anchor); addShape(shape); onCreate(shape); return shape; }
/** * YK: used to create autofilters * * @see org.apache.poi.hssf.usermodel.HSSFSheet#setAutoFilter(org.apache.poi.ss.util.CellRangeAddress) */ HSSFSimpleShape createComboBox(HSSFAnchor anchor) { HSSFSimpleShape shape = new HSSFSimpleShape(null, anchor); shape.setShapeType(HSSFSimpleShape.OBJECT_TYPE_COMBO_BOX); shape.anchor = anchor; addShape(shape); return shape; }
/** * 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. */ public HSSFTextbox createTextbox(HSSFClientAnchor anchor) { HSSFTextbox shape = new HSSFTextbox(null, anchor); addShape(shape); onCreate(shape); return shape; }
/** * 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. */ public HSSFShapeGroup createGroup(HSSFClientAnchor anchor) { HSSFShapeGroup group = new HSSFShapeGroup(null, anchor); addShape(group); onCreate(group); return group; }
/** * Creates a polygon * * @param anchor the client anchor describes how this group is attached * to the sheet. * @return the newly created shape. */ public HSSFPolygon createPolygon(HSSFClientAnchor anchor) { HSSFPolygon shape = new HSSFPolygon(null, anchor); addShape(shape); onCreate(shape); return shape; }
/** * Constructs a cell comment. * * @param anchor the client anchor describes how this comment is attached * to the sheet. * @return the newly created comment. */ public HSSFComment createComment(HSSFAnchor anchor) { HSSFComment shape = new HSSFComment(null, anchor); addShape(shape); onCreate(shape); return shape; }