Examples of CTShapeProperties


Examples of org.docx4j.dml.CTShapeProperties

    List<Object> results = slide.getJAXBNodesViaXPath("//p:spPr", false);
   
    for(Object o: results) {
     
      //System.out.println(o.getClass().getName());
      CTShapeProperties spPr = (CTShapeProperties)o;
     
      if (spPr.getPrstGeom()==null) {
        System.out.println("- this shape not preset");
      } else {
        STShapeType shapeType = spPr.getPrstGeom().getPrst();
       
        CTCustomGeometry2D customGeo = PresetGeometries.getInstance().get(shapeType.value());
       
        if (customGeo==null) {
          System.out.println("- definition MISSING for " + shapeType.value() )
        } else if (shapeType.value().equals("leftArrow") ) {
          System.out.println("- skipping " + shapeType.value() + " (corrupts pptx)")// tested 2010 x64; I wonder why                 
        } else {
          // really should clone here
          spPr.setCustGeom(customGeo);
         
          spPr.setPrstGeom(null);
          System.out.println("- " + shapeType.value() + " processed");         
         
        }
       
      }
View Full Code Here

Examples of org.docx4j.dml.CTShapeProperties

                            relativerect.setR( new Integer(0) );
                            relativerect.setT( new Integer(0) );
                            relativerect.setL( new Integer(0) );
                            relativerect.setB( new Integer(0) );
                // Create object for spPr
                CTShapeProperties shapeproperties = dmlObjectFactory.createCTShapeProperties();
                picture.setSpPr(shapeproperties);
                    // Create object for xfrm
                    CTTransform2D transform2d = dmlObjectFactory.createCTTransform2D();
                    shapeproperties.setXfrm(transform2d);
                        transform2d.setRot( new Integer(0) );
                        // Create object for off
                        CTPoint2D point2d = dmlObjectFactory.createCTPoint2D();
                        transform2d.setOff(point2d);
                            point2d.setY( 0 );
                            point2d.setX( 0 );
                        // Create object for ext
                        CTPositiveSize2D positivesize2d = dmlObjectFactory.createCTPositiveSize2D();
                        transform2d.setExt(positivesize2d);
                            positivesize2d.setCx( 714375 );
                            positivesize2d.setCy( 714375 );
                    // Create object for prstGeom
                    CTPresetGeometry2D presetgeometry2d = dmlObjectFactory.createCTPresetGeometry2D();
                    shapeproperties.setPrstGeom(presetgeometry2d);
                        // Create object for avLst
                        CTGeomGuideList geomguidelist = dmlObjectFactory.createCTGeomGuideList();
                        presetgeometry2d.setAvLst(geomguidelist);
                        presetgeometry2d.setPrst(org.docx4j.dml.STShapeType.RECT);
                // Create object for nvPicPr
View Full Code Here

Examples of org.openxmlformats.schemas.drawingml.x2006.main.CTShapeProperties

          CTBlipFillProperties blipFill = pic.addNewBlipFill();
          CTBlip blip = blipFill.addNewBlip();
          blip.setEmbed( picData.getPackageRelationship().getId() );
          blipFill.addNewStretch().addNewFillRect();
         
          CTShapeProperties spPr = pic.addNewSpPr();
          CTTransform2D xfrm = spPr.addNewXfrm();
         
          CTPoint2D off = xfrm.addNewOff();
          off.setX(0);
          off.setY(0);
         
          CTPositiveSize2D ext = xfrm.addNewExt();
          ext.setCx(width);
          ext.setCy(height);
         
          CTPresetGeometry2D prstGeom = spPr.addNewPrstGeom();
          prstGeom.setPrst(STShapeType.RECT);
          prstGeom.addNewAvLst();
         
          // Finish up
          XWPFPicture xwpfPicture = new XWPFPicture(pic, paragraph);
View Full Code Here

Examples of org.openxmlformats.schemas.drawingml.x2006.main.CTShapeProperties

            CTBlipFillProperties blip = pic.addNewBlipFill();
            blip.addNewBlip().setEmbed("");
            blip.addNewStretch().addNewFillRect();

            CTShapeProperties sppr = pic.addNewSpPr();
            CTTransform2D t2d = sppr.addNewXfrm();
            CTPositiveSize2D ext = t2d.addNewExt();
            //should be original picture width and height expressed in EMUs
            ext.setCx(0);
            ext.setCy(0);

            CTPoint2D off = t2d.addNewOff();
            off.setX(0);
            off.setY(0);

            CTPresetGeometry2D prstGeom = sppr.addNewPrstGeom();
            prstGeom.setPrst(STShapeType.RECT);
            prstGeom.addNewAvLst();

            prototype = pic;
        }
View Full Code Here

Examples of org.openxmlformats.schemas.drawingml.x2006.main.CTShapeProperties

            CTBlipFillProperties blip = pic.addNewBlipFill();
            blip.addNewBlip().setEmbed("");
            blip.addNewStretch().addNewFillRect();

            CTShapeProperties sppr = pic.addNewSpPr();
            CTTransform2D t2d = sppr.addNewXfrm();
            CTPositiveSize2D ext = t2d.addNewExt();
            //should be original picture width and height expressed in EMUs
            ext.setCx(0);
            ext.setCy(0);

            CTPoint2D off = t2d.addNewOff();
            off.setX(0);
            off.setY(0);

            CTPresetGeometry2D prstGeom = sppr.addNewPrstGeom();
            prstGeom.setPrst(STShapeType.RECT);
            prstGeom.addNewAvLst();

            prototype = pic;
        }
View Full Code Here

Examples of org.openxmlformats.schemas.drawingml.x2006.main.CTShapeProperties

            CTBlipFillProperties blipFill = pic.addNewBlipFill();
            CTBlip blip = blipFill.addNewBlip();
            blip.setEmbed( picData.getPackageRelationship().getId() );
            blipFill.addNewStretch().addNewFillRect();

            CTShapeProperties spPr = pic.addNewSpPr();
            CTTransform2D xfrm = spPr.addNewXfrm();

            CTPoint2D off = xfrm.addNewOff();
            off.setX(0);
            off.setY(0);

            CTPositiveSize2D ext = xfrm.addNewExt();
            ext.setCx(width);
            ext.setCy(height);

            CTPresetGeometry2D prstGeom = spPr.addNewPrstGeom();
            prstGeom.setPrst(STShapeType.RECT);
            prstGeom.addNewAvLst();

            // Finish up
            XWPFPicture xwpfPicture = new XWPFPicture(pic, this);
View Full Code Here

Examples of org.openxmlformats.schemas.drawingml.x2006.main.CTShapeProperties

        CTBlipFillProperties blipFill = ct.addNewBlipFill();
        CTBlip blip = blipFill.addNewBlip();
        blip.setEmbed(rel);
        blipFill.addNewStretch().addNewFillRect();

        CTShapeProperties spPr = ct.addNewSpPr();
        CTPresetGeometry2D prst = spPr.addNewPrstGeom();
        prst.setPrst(STShapeType.RECT);
        prst.addNewAvLst();
        return ct;
    }
View Full Code Here

Examples of org.openxmlformats.schemas.drawingml.x2006.main.CTShapeProperties

            CTBlipFillProperties blipFill = pic.addNewBlipFill();
            CTBlip blip = blipFill.addNewBlip();
            blip.setEmbed( picData.getPackageRelationship().getId() );
            blipFill.addNewStretch().addNewFillRect();

            CTShapeProperties spPr = pic.addNewSpPr();
            CTTransform2D xfrm = spPr.addNewXfrm();

            CTPoint2D off = xfrm.addNewOff();
            off.setX(0);
            off.setY(0);

            CTPositiveSize2D ext = xfrm.addNewExt();
            ext.setCx(width);
            ext.setCy(height);

            CTPresetGeometry2D prstGeom = spPr.addNewPrstGeom();
            prstGeom.setPrst(STShapeType.RECT);
            prstGeom.addNewAvLst();

            // Finish up
            XWPFPicture xwpfPicture = new XWPFPicture(pic, this);
View Full Code Here

Examples of org.openxmlformats.schemas.drawingml.x2006.main.CTShapeProperties

            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();
View Full Code Here

Examples of org.openxmlformats.schemas.drawingml.x2006.main.CTShapeProperties

     * @return either Color or GradientPaint or TexturePaint or null
     */
    Paint getFillPaint(final Graphics2D graphics) {
        PropertyFetcher<Paint> fetcher = new PropertyFetcher<Paint>() {
            public boolean fetch(XSLFSimpleShape shape) {
                CTShapeProperties spPr = shape.getSpPr();
                if (spPr.isSetNoFill()) {
                    setValue(RenderableShape.NO_PAINT); // use it as 'nofill' value
                    return true;
                }
                Paint paint = getPaint(graphics, spPr, null);
                if (paint != null) {
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.