Examples of CTCustomGeometry2D


Examples of org.docx4j.dml.CTCustomGeometry2D

           Node node = nodes.item(i);
          
           if (!(node instanceof Element)) continue;
          
           String name = node.getLocalName();
           CTCustomGeometry2D geom = (CTCustomGeometry2D)XmlUtils.unmarshal(node, Context.jc, CTCustomGeometry2D.class);

           if(containsKey(name)) {
               log.warn("Duplicate definition of " + name) // happened for upDownArrow; that dupe now commented out
           }
           put(name, geom);
View Full Code Here

Examples of org.docx4j.dml.CTCustomGeometry2D

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

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

    private void read(InputStream is) throws Exception {
        XmlObject obj = XmlObject.Factory.parse(is);
        for (XmlObject def : obj.selectPath("*/*")) {

            String name = def.getDomNode().getLocalName();
            CTCustomGeometry2D geom = CTCustomGeometry2D.Factory.parse(def.toString());

            if(containsKey(name)) {
                System.out.println("Duplicate definoition of " + name) ;
            }
            put(name, new CustomGeometry(geom));
View Full Code Here

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

     */
    public GeneralPath getPath() {
        GeneralPath path = new GeneralPath();
        Rectangle2D bounds = getAnchor();

        CTCustomGeometry2D geom = getSpPr().getCustGeom();
        for(CTPath2D spPath : geom.getPathLst().getPathList()){
            double scaleW = bounds.getWidth() / Units.toPoints(spPath.getW());
            double scaleH = bounds.getHeight() / Units.toPoints(spPath.getH());
            for(XmlObject ch : spPath.selectPath("*")){
                if(ch instanceof CTPath2DMoveTo){
                    CTAdjPoint2D pt = ((CTPath2DMoveTo)ch).getPt();
View Full Code Here

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

        cnv.setName("Freeform " + shapeId);
        cnv.setId(shapeId + 1);
        nvSpPr.addNewCNvSpPr();
        nvSpPr.addNewNvPr();
        CTShapeProperties spPr = ct.addNewSpPr();
        CTCustomGeometry2D geom = spPr.addNewCustGeom();
        geom.addNewAvLst();
        geom.addNewGdLst();
        geom.addNewAhLst();
        geom.addNewCxnLst();
        CTGeomRect rect = geom.addNewRect();
        rect.setR("r");
        rect.setB("b");
        rect.setT("t");
        rect.setL("l");
        geom.addNewPathLst();
        return ct;
    }
View Full Code Here

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

    @SuppressWarnings("deprecation")
    public GeneralPath getPath() {
        GeneralPath path = new GeneralPath();
        Rectangle2D bounds = getAnchor();

        CTCustomGeometry2D geom = getSpPr().getCustGeom();
        for(CTPath2D spPath : geom.getPathLst().getPathArray()){
            double scaleW = bounds.getWidth() / Units.toPoints(spPath.getW());
            double scaleH = bounds.getHeight() / Units.toPoints(spPath.getH());
            for(XmlObject ch : spPath.selectPath("*")){
                if(ch instanceof CTPath2DMoveTo){
                    CTAdjPoint2D pt = ((CTPath2DMoveTo)ch).getPt();
View Full Code Here

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

        cnv.setName("Freeform " + shapeId);
        cnv.setId(shapeId + 1);
        nvSpPr.addNewCNvSpPr();
        nvSpPr.addNewNvPr();
        CTShapeProperties spPr = ct.addNewSpPr();
        CTCustomGeometry2D geom = spPr.addNewCustGeom();
        geom.addNewAvLst();
        geom.addNewGdLst();
        geom.addNewAhLst();
        geom.addNewCxnLst();
        CTGeomRect rect = geom.addNewRect();
        rect.setR("r");
        rect.setB("b");
        rect.setT("t");
        rect.setL("l");
        geom.addNewPathLst();
        return ct;
    }
View Full Code Here

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

    public GeneralPath getPath() {
        GeneralPath path = new GeneralPath();
        Rectangle2D bounds = getAnchor();
        int x0 = Units.toEMU(bounds.getX());
        int y0 = Units.toEMU(bounds.getY());
        CTCustomGeometry2D geom = getSpPr().getCustGeom();
        for(CTPath2D spPath : geom.getPathLst().getPathList()){
            for(XmlObject ch : spPath.selectPath("*")){
                if(ch instanceof CTPath2DMoveTo){
                    CTAdjPoint2D pt = ((CTPath2DMoveTo)ch).getPt();
                    path.moveTo((float)Units.toPoints((Long)pt.getX() + x0),
                                (float)Units.toPoints((Long)pt.getY() + y0));
View Full Code Here

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

        cnv.setName("Freeform " + shapeId);
        cnv.setId(shapeId + 1);
        nvSpPr.addNewCNvSpPr();
        nvSpPr.addNewNvPr();
        CTShapeProperties spPr = ct.addNewSpPr();
        CTCustomGeometry2D geom = spPr.addNewCustGeom();
        geom.addNewAvLst();
        geom.addNewGdLst();
        geom.addNewAhLst();
        geom.addNewCxnLst();
        CTGeomRect rect = geom.addNewRect();
        rect.setR("r");
        rect.setB("b");
        rect.setT("t");
        rect.setL("l");
        geom.addNewPathLst();
        return ct;
    }
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.