Search in sources :

Example 1 with CTGraphicalObjectFrameNonVisual

use of org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.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)

Example 2 with CTGraphicalObjectFrameNonVisual

use of org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTGraphicalObjectFrameNonVisual in project poi by apache.

the class XSSFGraphicFrame method prototype.

/**
	 * Initialize default structure of a new graphic frame
	 */
protected static CTGraphicalObjectFrame prototype() {
    if (prototype == null) {
        CTGraphicalObjectFrame graphicFrame = CTGraphicalObjectFrame.Factory.newInstance();
        CTGraphicalObjectFrameNonVisual nvGraphic = graphicFrame.addNewNvGraphicFramePr();
        CTNonVisualDrawingProps props = nvGraphic.addNewCNvPr();
        props.setId(0);
        props.setName("Diagramm 1");
        nvGraphic.addNewCNvGraphicFramePr();
        CTTransform2D transform = graphicFrame.addNewXfrm();
        CTPositiveSize2D extPoint = transform.addNewExt();
        CTPoint2D offPoint = transform.addNewOff();
        extPoint.setCx(0);
        extPoint.setCy(0);
        offPoint.setX(0);
        offPoint.setY(0);
        /* CTGraphicalObject graphic = */
        graphicFrame.addNewGraphic();
        prototype = graphicFrame;
    }
    return prototype;
}
Also used : CTTransform2D(org.openxmlformats.schemas.drawingml.x2006.main.CTTransform2D) CTPoint2D(org.openxmlformats.schemas.drawingml.x2006.main.CTPoint2D) CTGraphicalObjectFrame(org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTGraphicalObjectFrame) CTNonVisualDrawingProps(org.openxmlformats.schemas.drawingml.x2006.main.CTNonVisualDrawingProps) CTGraphicalObjectFrameNonVisual(org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTGraphicalObjectFrameNonVisual) CTPositiveSize2D(org.openxmlformats.schemas.drawingml.x2006.main.CTPositiveSize2D)

Aggregations

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