Examples of CTShape


Examples of org.docx4j.dml.diagram2008.CTShape

        @Override
        public List<Object> apply(Object o) {
         
          if (o instanceof org.docx4j.dml.diagram2008.CTShape) {
           
            CTShape sp = (CTShape)o;
            if (sp.getModelId()!=null) {
              sp.setModelId(
                map.get(sp.getModelId() ));
            }           
          }
         
          return null;
        }
View Full Code Here

Examples of org.docx4j.vml.CTShape

            shapetype.setVmlId( "_x0000_t202");
            shapetype.setHralign(org.docx4j.vml.officedrawing.STHrAlign.LEFT);
            shapetype.setPath( "m,l,21600r21600,l21600,xe");
           
        // Create object for shape (wrapped in JAXBElement)
        CTShape shape = vmlObjectFactory.createCTShape();
        JAXBElement<org.docx4j.vml.CTShape> shapeWrapped = vmlObjectFactory.createShape(shape);
       
        pict.getAnyAndAny().add( shapeWrapped);
       
            shape.setStyle( style);
            shape.setSpid( "_x0000_s1026");
            shape.setInsetmode(org.docx4j.vml.officedrawing.STInsetMode.CUSTOM);
            shape.setConnectortype(org.docx4j.vml.officedrawing.STConnectorType.STRAIGHT);
           
            // Create object for textbox (wrapped in JAXBElement)
            CTTextbox textbox = vmlObjectFactory.createCTTextbox();
            JAXBElement<org.docx4j.vml.CTTextbox> textboxWrapped = vmlObjectFactory.createTextbox(textbox);
            shape.getPathOrFormulasOrHandles().add( textboxWrapped);
                textbox.setStyle( "mso-fit-shape-to-text:t");
                textbox.setInsetmode(org.docx4j.vml.officedrawing.STInsetMode.CUSTOM);
                // Create object for txbxContent
                CTTxbxContent txbxcontent = wmlObjectFactory.createCTTxbxContent();
                textbox.setTxbxContent(txbxcontent);
               
                    txbxcontent.getContent().add( textboxContent);
                   
            if (w10WrapEl) {
              // Add <w10:wrap type="square"/>

//            org.docx4j.vml.wordprocessingDrawing.CTWrap w10CTWrap = w10ObjectFactory.createCTWrap();
//            w10CTWrap.setType(STWrapType.SQUARE);
//          JAXBElement<org.docx4j.vml.wordprocessingDrawing.CTWrap> w10Wrap = w10ObjectFactory.createWrap(w10CTWrap);
//          shape.getPathOrFormulasOrHandles().add( w10Wrap);
         
                  org.docx4j.vml.wordprocessingDrawing.ObjectFactory vmlwordprocessingDrawingObjectFactory = new org.docx4j.vml.wordprocessingDrawing.ObjectFactory();
              // Create object for wrap (wrapped in JAXBElement)
              CTWrap wrap = vmlwordprocessingDrawingObjectFactory.createCTWrap();
              JAXBElement<org.docx4j.vml.wordprocessingDrawing.CTWrap> wrapWrapped = vmlwordprocessingDrawingObjectFactory.createWrap(wrap);
              shape.getPathOrFormulasOrHandles().add( wrapWrapped);
              wrap.setType(org.docx4j.vml.wordprocessingDrawing.STWrapType.TOP_AND_BOTTOM);         
            }


            shape.setVmlId( "Text Box 2");
            shape.setHralign(org.docx4j.vml.officedrawing.STHrAlign.LEFT);
            shape.setType( "#_x0000_t202");
            // <w10:wrap type="topAndBottom"/>
    return pictWrapped;
    }
View Full Code Here

Examples of org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTShape

     *                  to the sheet.
     * @return      the newly created textbox.
     */
    public XSSFTextBox createTextbox(XSSFClientAnchor anchor){
        CTTwoCellAnchor ctAnchor = createTwoCellAnchor(anchor);
        CTShape ctShape = ctAnchor.addNewSp();
        ctShape.set(XSSFSimpleShape.prototype());
        XSSFTextBox shape = new XSSFTextBox(this, ctShape);
        shape.anchor = anchor;
        return shape;

    }
View Full Code Here

Examples of org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTShape

     * @return  the newly created shape.
     */
    public XSSFSimpleShape createSimpleShape(XSSFClientAnchor anchor)
    {
        CTTwoCellAnchor ctAnchor = createTwoCellAnchor(anchor);
        CTShape ctShape = ctAnchor.addNewSp();
        ctShape.set(XSSFSimpleShape.prototype());
        XSSFSimpleShape shape = new XSSFSimpleShape(this, ctShape);
        shape.anchor = anchor;
        return shape;
    }
View Full Code Here

Examples of org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTShape

    /**
     * Prototype with the default structure of a new auto-shape.
     */
    protected static CTShape prototype() {
        if(prototype == null) {
            CTShape shape = CTShape.Factory.newInstance();

            CTShapeNonVisual nv = shape.addNewNvSpPr();
            CTNonVisualDrawingProps nvp = nv.addNewCNvPr();
            nvp.setId(1);
            nvp.setName("Shape 1");
            nv.addNewCNvSpPr();

            CTShapeProperties sp = shape.addNewSpPr();
            CTTransform2D t2d = sp.addNewXfrm();
            CTPositiveSize2D p1 = t2d.addNewExt();
            p1.setCx(0);
            p1.setCy(0);
            CTPoint2D p2 = t2d.addNewOff();
            p2.setX(0);
            p2.setY(0);

            CTPresetGeometry2D geom = sp.addNewPrstGeom();
            geom.setPrst(STShapeType.RECT);
            geom.addNewAvLst();

            CTTextBody body = shape.addNewTxBody();
            CTTextBodyProperties bodypr = body.addNewBodyPr();
            bodypr.setAnchor(STTextAnchoringType.T);
            bodypr.setRtlCol(false);
            CTTextParagraph p = body.addNewP();
            p.addNewPPr().setAlgn(STTextAlignType.L);
View Full Code Here

Examples of org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTShape

    /**
     * Prototype with the default structure of a new auto-shape.
     */
    protected static CTShape prototype() {
        if(prototype == null) {
            CTShape shape = CTShape.Factory.newInstance();

            CTShapeNonVisual nv = shape.addNewNvSpPr();
            CTNonVisualDrawingProps nvp = nv.addNewCNvPr();
            nvp.setId(1);
            nvp.setName("Shape 1");
            nv.addNewCNvSpPr();

            CTShapeProperties sp = shape.addNewSpPr();
            CTTransform2D t2d = sp.addNewXfrm();
            CTPositiveSize2D p1 = t2d.addNewExt();
            p1.setCx(0);
            p1.setCy(0);
            CTPoint2D p2 = t2d.addNewOff();
            p2.setX(0);
            p2.setY(0);

            CTPresetGeometry2D geom = sp.addNewPrstGeom();
            geom.setPrst(STShapeType.RECT);
            geom.addNewAvLst();

            CTTextBody body = shape.addNewTxBody();
            CTTextBodyProperties bodypr = body.addNewBodyPr();
            bodypr.setAnchor(STTextAnchoringType.T);
            bodypr.setRtlCol(false);
            CTTextParagraph p = body.addNewP();
            p.addNewPPr().setAlgn(STTextAlignType.L);
View Full Code Here

Examples of org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTShape

    /**
     * Prototype with the default structure of a new auto-shape.
     */
    protected static CTShape prototype() {
        if(prototype == null) {
            CTShape shape = CTShape.Factory.newInstance();

            CTShapeNonVisual nv = shape.addNewNvSpPr();
            CTNonVisualDrawingProps nvp = nv.addNewCNvPr();
            nvp.setId(1);
            nvp.setName("Shape 1");
            nv.addNewCNvSpPr();

            CTShapeProperties sp = shape.addNewSpPr();
            CTTransform2D t2d = sp.addNewXfrm();
            CTPositiveSize2D p1 = t2d.addNewExt();
            p1.setCx(0);
            p1.setCy(0);
            CTPoint2D p2 = t2d.addNewOff();
            p2.setX(0);
            p2.setY(0);

            CTPresetGeometry2D geom = sp.addNewPrstGeom();
            geom.setPrst(STShapeType.RECT);
            geom.addNewAvLst();

            CTShapeStyle style = shape.addNewStyle();
            CTSchemeColor scheme = style.addNewLnRef().addNewSchemeClr();
            scheme.setVal(STSchemeColorVal.ACCENT_1);
            scheme.addNewShade().setVal(50000);
            style.getLnRef().setIdx(2);

            CTStyleMatrixReference fillref = style.addNewFillRef();
            fillref.setIdx(1);
            fillref.addNewSchemeClr().setVal(STSchemeColorVal.ACCENT_1);

            CTStyleMatrixReference effectRef = style.addNewEffectRef();
            effectRef.setIdx(0);
            effectRef.addNewSchemeClr().setVal(STSchemeColorVal.ACCENT_1);

            CTFontReference fontRef = style.addNewFontRef();
            fontRef.setIdx(STFontCollectionIndex.MINOR);
            fontRef.addNewSchemeClr().setVal(STSchemeColorVal.LT_1);

            CTTextBody body = shape.addNewTxBody();
            CTTextBodyProperties bodypr = body.addNewBodyPr();
            bodypr.setAnchor(STTextAnchoringType.CTR);
            bodypr.setRtlCol(false);
            CTTextParagraph p = body.addNewP();
            p.addNewPPr().setAlgn(STTextAlignType.CTR);
View Full Code Here

Examples of org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTShape

    /**
     * Prototype with the default structure of a new auto-shape.
     */
    protected static CTShape prototype() {
        if(prototype == null) {
            CTShape shape = CTShape.Factory.newInstance();

            CTShapeNonVisual nv = shape.addNewNvSpPr();
            CTNonVisualDrawingProps nvp = nv.addNewCNvPr();
            nvp.setId(1);
            nvp.setName("Shape 1");
            nv.addNewCNvSpPr();

            CTShapeProperties sp = shape.addNewSpPr();
            CTTransform2D t2d = sp.addNewXfrm();
            CTPositiveSize2D p1 = t2d.addNewExt();
            p1.setCx(0);
            p1.setCy(0);
            CTPoint2D p2 = t2d.addNewOff();
            p2.setX(0);
            p2.setY(0);

            CTPresetGeometry2D geom = sp.addNewPrstGeom();
            geom.setPrst(STShapeType.RECT);
            geom.addNewAvLst();

            CTShapeStyle style = shape.addNewStyle();
            CTSchemeColor scheme = style.addNewLnRef().addNewSchemeClr();
            scheme.setVal(STSchemeColorVal.ACCENT_1);
            scheme.addNewShade().setVal(50000);
            style.getLnRef().setIdx(2);

            CTStyleMatrixReference fillref = style.addNewFillRef();
            fillref.setIdx(1);
            fillref.addNewSchemeClr().setVal(STSchemeColorVal.ACCENT_1);

            CTStyleMatrixReference effectRef = style.addNewEffectRef();
            effectRef.setIdx(0);
            effectRef.addNewSchemeClr().setVal(STSchemeColorVal.ACCENT_1);

            CTFontReference fontRef = style.addNewFontRef();
            fontRef.setIdx(STFontCollectionIndex.MINOR);
            fontRef.addNewSchemeClr().setVal(STSchemeColorVal.LT_1);

            CTTextBody body = shape.addNewTxBody();
            CTTextBodyProperties bodypr = body.addNewBodyPr();
            bodypr.setAnchor(STTextAnchoringType.CTR);
            bodypr.setRtlCol(false);
            CTTextParagraph p = body.addNewP();
            p.addNewPPr().setAlgn(STTextAlignType.CTR);
View Full Code Here

Examples of org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTShape

     *                  to the sheet.
     * @return      the newly created textbox.
     */
    public XSSFTextBox createTextbox(XSSFClientAnchor anchor){
        CTTwoCellAnchor ctAnchor = createTwoCellAnchor(anchor);
        CTShape ctShape = ctAnchor.addNewSp();
        ctShape.set(XSSFSimpleShape.prototype());
        XSSFTextBox shape = new XSSFTextBox(this, ctShape);
        shape.anchor = anchor;
        return shape;

    }
View Full Code Here

Examples of org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTShape

     * @return  the newly created shape.
     */
    public XSSFSimpleShape createSimpleShape(XSSFClientAnchor anchor)
    {
        CTTwoCellAnchor ctAnchor = createTwoCellAnchor(anchor);
        CTShape ctShape = ctAnchor.addNewSp();
        ctShape.set(XSSFSimpleShape.prototype());
        XSSFSimpleShape shape = new XSSFSimpleShape(this, ctShape);
        shape.anchor = anchor;
        return shape;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.