Search in sources :

Example 1 with CTGraphicalObjectFrameNonVisual

use of org.openxmlformats.schemas.presentationml.x2006.main.CTGraphicalObjectFrameNonVisual in project poi by apache.

the class XSLFTable method prototype.

static CTGraphicalObjectFrame prototype(int shapeId) {
    CTGraphicalObjectFrame frame = CTGraphicalObjectFrame.Factory.newInstance();
    CTGraphicalObjectFrameNonVisual nvGr = frame.addNewNvGraphicFramePr();
    CTNonVisualDrawingProps cnv = nvGr.addNewCNvPr();
    cnv.setName("Table " + shapeId);
    cnv.setId(shapeId + 1);
    nvGr.addNewCNvGraphicFramePr().addNewGraphicFrameLocks().setNoGrp(true);
    nvGr.addNewNvPr();
    frame.addNewXfrm();
    CTGraphicalObjectData gr = frame.addNewGraphic().addNewGraphicData();
    XmlCursor grCur = gr.newCursor();
    grCur.toNextToken();
    grCur.beginElement(new QName(DRAWINGML_URI, "tbl"));
    CTTable tbl = CTTable.Factory.newInstance();
    tbl.addNewTblPr();
    tbl.addNewTblGrid();
    XmlCursor tblCur = tbl.newCursor();
    tblCur.moveXmlContents(grCur);
    tblCur.dispose();
    grCur.dispose();
    gr.setUri(TABLE_URI);
    return frame;
}
Also used : CTGraphicalObjectData(org.openxmlformats.schemas.drawingml.x2006.main.CTGraphicalObjectData) CTGraphicalObjectFrame(org.openxmlformats.schemas.presentationml.x2006.main.CTGraphicalObjectFrame) QName(javax.xml.namespace.QName) CTNonVisualDrawingProps(org.openxmlformats.schemas.drawingml.x2006.main.CTNonVisualDrawingProps) CTTable(org.openxmlformats.schemas.drawingml.x2006.main.CTTable) CTGraphicalObjectFrameNonVisual(org.openxmlformats.schemas.presentationml.x2006.main.CTGraphicalObjectFrameNonVisual) XmlCursor(org.apache.xmlbeans.XmlCursor)

Aggregations

QName (javax.xml.namespace.QName)1 XmlCursor (org.apache.xmlbeans.XmlCursor)1 CTGraphicalObjectData (org.openxmlformats.schemas.drawingml.x2006.main.CTGraphicalObjectData)1 CTNonVisualDrawingProps (org.openxmlformats.schemas.drawingml.x2006.main.CTNonVisualDrawingProps)1 CTTable (org.openxmlformats.schemas.drawingml.x2006.main.CTTable)1 CTGraphicalObjectFrame (org.openxmlformats.schemas.presentationml.x2006.main.CTGraphicalObjectFrame)1 CTGraphicalObjectFrameNonVisual (org.openxmlformats.schemas.presentationml.x2006.main.CTGraphicalObjectFrameNonVisual)1