Package org.docx4j.dml

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


                            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

                            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

TOP

Related Classes of org.docx4j.dml.CTShapeProperties

Copyright © 2018 www.massapicom. 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.