Example usage for org.apache.poi.xssf.usermodel XSSFGraphicFrame getCTGraphicalObjectFrame

List of usage examples for org.apache.poi.xssf.usermodel XSSFGraphicFrame getCTGraphicalObjectFrame

Introduction

In this page you can find the example usage for org.apache.poi.xssf.usermodel XSSFGraphicFrame getCTGraphicalObjectFrame.

Prototype

@Internal
    public CTGraphicalObjectFrame getCTGraphicalObjectFrame() 

Source Link

Usage

From source file:com.vaadin.addon.spreadsheet.SpreadsheetFactory.java

License:Open Source License

/**
 * Returns a chart wrapper if this drawing has a chart, otherwise null.
 *//*from  ww w  . j a v a2 s. c  om*/
private static SheetChartWrapper tryLoadChart(final Spreadsheet spreadsheet, final Drawing drawing,
        final XSSFGraphicFrame frame) {
    try {
        XSSFChart chartXml = getChartForFrame((XSSFDrawing) drawing, frame);

        if (chartXml != null) {
            XSSFClientAnchor anchor = getAnchorFromParent(frame.getCTGraphicalObjectFrame());

            return new SheetChartWrapper(anchor, chartXml, spreadsheet);
        }
    } catch (NullPointerException e) {
        // means we did not find any chart for this drawing (not an error,
        // normal situation) or we could not load it (corrupt file?
        // unrecognized format?), nothing to do.
    }

    return null;
}

From source file:com.vaadin.addon.spreadsheet.SpreadsheetFactory.java

License:Open Source License

private static String getChartId(XSSFGraphicFrame frame) {
    return frame.getCTGraphicalObjectFrame().getGraphic().getGraphicData().getDomNode().getChildNodes().item(0)
            .getAttributes().getNamedItem("r:id").getNodeValue();
}