/** * Creates a picture. * * @param anchor the client anchor describes how this picture is attached to the sheet. * @param pictureIndex the index of the picture in the workbook collection of pictures, * {@link XSSFWorkbook#getAllPictures()} . * @return the newly created picture shape. */ public XSSFPicture createPicture(XSSFClientAnchor anchor, int pictureIndex) { PackageRelationship rel = getDrawing().addPictureReference(pictureIndex); CTPicture ctShape = ctGroup.addNewPic(); ctShape.set(XSSFPicture.prototype()); XSSFPicture shape = new XSSFPicture(getDrawing(), ctShape); shape.parent = this; shape.anchor = anchor; shape.setPictureReference(rel); return shape; }
/** * Creates a picture. * * @param anchor * the client anchor describes how this picture is attached to * the sheet. * @param pictureIndex * the index of the picture in the workbook collection of * pictures, * {@link org.apache.poi.xssf.usermodel.XSSFWorkbook#getAllPictures()} * . * * @return the newly created picture shape. */ public XSSFPicture createPicture(XSSFClientAnchor anchor, int pictureIndex) { PackageRelationship rel = addPictureReference(pictureIndex); long shapeId = newShapeId(); CTTwoCellAnchor ctAnchor = createTwoCellAnchor(anchor); CTPicture ctShape = ctAnchor.addNewPic(); ctShape.set(XSSFPicture.prototype()); ctShape.getNvPicPr().getCNvPr().setId(shapeId); XSSFPicture shape = new XSSFPicture(this, ctShape); shape.anchor = anchor; shape.setPictureReference(rel); ctShape.getSpPr().setXfrm(createXfrm(anchor)); return shape; }
shape = new XSSFPicture(this, (CTPicture) obj); } else if (obj instanceof CTConnector) { shape = new XSSFConnector(this, (CTConnector) obj);
/** * * @return list of shapes in this drawing */ public List<XSSFShape> getShapes(){ List<XSSFShape> lst = new ArrayList<XSSFShape>(); for(XmlObject obj : drawing.selectPath("./*/*")) { if(obj instanceof CTPicture) lst.add(new XSSFPicture(this, (CTPicture)obj)) ; else if(obj instanceof CTConnector) lst.add(new XSSFConnector(this, (CTConnector)obj)) ; else if(obj instanceof CTShape) lst.add(new XSSFSimpleShape(this, (CTShape)obj)) ; else if(obj instanceof CTGraphicalObjectFrame) lst.add(new XSSFGraphicFrame(this, (CTGraphicalObjectFrame)obj)) ; else if(obj instanceof CTGroupShape) lst.add(new XSSFShapeGroup(this, (CTGroupShape)obj)) ; } return lst; } }
/** * Creates a picture. * * @param anchor the client anchor describes how this picture is attached to the sheet. * @param pictureIndex the index of the picture in the workbook collection of pictures, * {@link XSSFWorkbook#getAllPictures()} . * @return the newly created picture shape. */ public XSSFPicture createPicture(XSSFClientAnchor anchor, int pictureIndex) { PackageRelationship rel = getDrawing().addPictureReference(pictureIndex); CTPicture ctShape = ctGroup.addNewPic(); ctShape.set(XSSFPicture.prototype()); XSSFPicture shape = new XSSFPicture(getDrawing(), ctShape); shape.parent = this; shape.anchor = anchor; shape.setPictureReference(rel); return shape; }
/** * Creates a picture. * * @param anchor the client anchor describes how this picture is attached to the sheet. * @param pictureIndex the index of the picture in the workbook collection of pictures, * {@link XSSFWorkbook#getAllPictures()} . * @return the newly created picture shape. */ public XSSFPicture createPicture(XSSFClientAnchor anchor, int pictureIndex) { PackageRelationship rel = getDrawing().addPictureReference(pictureIndex); CTPicture ctShape = ctGroup.addNewPic(); ctShape.set(XSSFPicture.prototype()); XSSFPicture shape = new XSSFPicture(getDrawing(), ctShape); shape.parent = this; shape.anchor = anchor; shape.setPictureReference(rel); return shape; }
/** * Creates a picture. * * @param anchor the client anchor describes how this picture is attached to the sheet. * @param pictureIndex the index of the picture in the workbook collection of pictures, * {@link org.apache.poi.xssf.usermodel.XSSFWorkbook#getAllPictures()} . * * @return the newly created picture shape. */ public XSSFPicture createPicture(XSSFClientAnchor anchor, int pictureIndex) { PackageRelationship rel = addPictureReference(pictureIndex); long shapeId = newShapeId(); CTTwoCellAnchor ctAnchor = createTwoCellAnchor(anchor); CTPicture ctShape = ctAnchor.addNewPic(); ctShape.set(XSSFPicture.prototype()); ctShape.getNvPicPr().getCNvPr().setId(shapeId); XSSFPicture shape = new XSSFPicture(this, ctShape); shape.anchor = anchor; shape.setPictureReference(rel); return shape; }
/** * Creates a picture. * * @param anchor * the client anchor describes how this picture is attached to * the sheet. * @param pictureIndex * the index of the picture in the workbook collection of * pictures, * {@link org.apache.poi.xssf.usermodel.XSSFWorkbook#getAllPictures()} * . * * @return the newly created picture shape. */ public XSSFPicture createPicture(XSSFClientAnchor anchor, int pictureIndex) { PackageRelationship rel = addPictureReference(pictureIndex); long shapeId = newShapeId(); CTTwoCellAnchor ctAnchor = createTwoCellAnchor(anchor); CTPicture ctShape = ctAnchor.addNewPic(); ctShape.set(XSSFPicture.prototype()); ctShape.getNvPicPr().getCNvPr().setId(shapeId); XSSFPicture shape = new XSSFPicture(this, ctShape); shape.anchor = anchor; shape.setPictureReference(rel); ctShape.getSpPr().setXfrm(createXfrm(anchor)); return shape; }
shape = new XSSFPicture(this, (CTPicture) obj); } else if (obj instanceof CTConnector) { shape = new XSSFConnector(this, (CTConnector) obj);