Example usage for org.apache.poi.hssf.usermodel HSSFPatriarch getChildren

List of usage examples for org.apache.poi.hssf.usermodel HSSFPatriarch getChildren

Introduction

In this page you can find the example usage for org.apache.poi.hssf.usermodel HSSFPatriarch getChildren.

Prototype

@Override
public List<HSSFShape> getChildren() 

Source Link

Document

Returns a unmodifiable list of all shapes contained by the patriarch.

Usage

From source file:org.jxstar.report.util.ReportXlsUtil.java

/**
 * ??//from  ww w.  j  a va 2  s.  c o  m
 * @param sheet -- ?
 * @return
 */
private static List<HSSFPicture> getAllPicture(HSSFSheet sheet) {
    List<HSSFPicture> lsPicture = FactoryUtil.newList();

    HSSFPatriarch draw = sheet.getDrawingPatriarch();
    if (draw == null)
        return lsPicture;

    //???
    List<HSSFShape> lsShape = draw.getChildren();
    if (lsShape == null || lsShape.isEmpty())
        return lsPicture;

    for (int i = 0, n = lsShape.size(); i < n; i++) {
        HSSFShape shape = lsShape.get(i);
        if (shape instanceof HSSFPicture) {
            lsPicture.add((HSSFPicture) shape);
        }
    }
    return lsPicture;
}