Examples of CTAdjPoint2D


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

        while (!it.isDone()) {
            double[] vals = new double[6];
            int type = it.currentSegment(vals);
            switch (type) {
                case PathIterator.SEG_MOVETO:
                    CTAdjPoint2D mv = ctPath.addNewMoveTo().addNewPt();
                    mv.setX(Units.toEMU(vals[0]) - x0);
                    mv.setY(Units.toEMU(vals[1]) - y0);
                    numPoints++;
                    break;
                case PathIterator.SEG_LINETO:
                    CTAdjPoint2D ln = ctPath.addNewLnTo().addNewPt();
                    ln.setX(Units.toEMU(vals[0]) - x0);
                    ln.setY(Units.toEMU(vals[1]) - y0);
                    numPoints++;
                    break;
                case PathIterator.SEG_CUBICTO:
                    CTPath2DCubicBezierTo bez = ctPath.addNewCubicBezTo();
                    CTAdjPoint2D p1 = bez.addNewPt();
                    p1.setX(Units.toEMU(vals[0]) - x0);
                    p1.setY(Units.toEMU(vals[1]) - y0);
                    CTAdjPoint2D p2 = bez.addNewPt();
                    p2.setX(Units.toEMU(vals[2]) - x0);
                    p2.setY(Units.toEMU(vals[3]) - y0);
                    CTAdjPoint2D p3 = bez.addNewPt();
                    p3.setX(Units.toEMU(vals[4]) - x0);
                    p3.setY(Units.toEMU(vals[5]) - y0);
                    numPoints += 3;
                    break;
                case PathIterator.SEG_CLOSE:
                    numPoints++;
                    ctPath.addNewClose();
View Full Code Here

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

        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();
                    path.moveTo(
                            (float) (Units.toPoints((Long) pt.getX()) * scaleW),
                            (float) (Units.toPoints((Long) pt.getY()) * scaleH));
                } else if (ch instanceof CTPath2DLineTo){
                    CTAdjPoint2D pt = ((CTPath2DLineTo)ch).getPt();
                    path.lineTo((float)Units.toPoints((Long)pt.getX()),
                                (float)Units.toPoints((Long)pt.getY()));
                } else if (ch instanceof CTPath2DCubicBezierTo){
                    CTPath2DCubicBezierTo bez = ((CTPath2DCubicBezierTo)ch);
                    CTAdjPoint2D pt1 = bez.getPtArray(0);
                    CTAdjPoint2D pt2 = bez.getPtArray(1);
                    CTAdjPoint2D pt3 = bez.getPtArray(2);
                    path.curveTo(
                            (float) (Units.toPoints((Long) pt1.getX()) * scaleW),
                            (float) (Units.toPoints((Long) pt1.getY()) * scaleH),
                            (float) (Units.toPoints((Long) pt2.getX()) * scaleW),
                            (float) (Units.toPoints((Long) pt2.getY()) * scaleH),
                            (float) (Units.toPoints((Long) pt3.getX()) * scaleW),
                            (float) (Units.toPoints((Long) pt3.getY()) * scaleH)                    );

                } else if (ch instanceof CTPath2DClose){
                    path.closePath();
                }
            }
View Full Code Here

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

        while (!it.isDone()) {
            double[] vals = new double[6];
            int type = it.currentSegment(vals);
            switch (type) {
                case PathIterator.SEG_MOVETO:
                    CTAdjPoint2D mv = ctPath.addNewMoveTo().addNewPt();
                    mv.setX(Units.toEMU(vals[0]) - x0);
                    mv.setY(Units.toEMU(vals[1]) - y0);
                    numPoints++;
                    break;
                case PathIterator.SEG_LINETO:
                    CTAdjPoint2D ln = ctPath.addNewLnTo().addNewPt();
                    ln.setX(Units.toEMU(vals[0]) - x0);
                    ln.setY(Units.toEMU(vals[1]) - y0);
                    numPoints++;
                    break;
                case PathIterator.SEG_CUBICTO:
                    CTPath2DCubicBezierTo bez = ctPath.addNewCubicBezTo();
                    CTAdjPoint2D p1 = bez.addNewPt();
                    p1.setX(Units.toEMU(vals[0]) - x0);
                    p1.setY(Units.toEMU(vals[1]) - y0);
                    CTAdjPoint2D p2 = bez.addNewPt();
                    p2.setX(Units.toEMU(vals[2]) - x0);
                    p2.setY(Units.toEMU(vals[3]) - y0);
                    CTAdjPoint2D p3 = bez.addNewPt();
                    p3.setX(Units.toEMU(vals[4]) - x0);
                    p3.setY(Units.toEMU(vals[5]) - y0);
                    numPoints += 3;
                    break;
                case PathIterator.SEG_CLOSE:
                    numPoints++;
                    ctPath.addNewClose();
View Full Code Here

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

        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();
                    path.moveTo(
                            (float) (Units.toPoints((Long) pt.getX()) * scaleW),
                            (float) (Units.toPoints((Long) pt.getY()) * scaleH));
                } else if (ch instanceof CTPath2DLineTo){
                    CTAdjPoint2D pt = ((CTPath2DLineTo)ch).getPt();
                    path.lineTo((float)Units.toPoints((Long)pt.getX()),
                                (float)Units.toPoints((Long)pt.getY()));
                } else if (ch instanceof CTPath2DCubicBezierTo){
                    CTPath2DCubicBezierTo bez = ((CTPath2DCubicBezierTo)ch);
                    CTAdjPoint2D pt1 = bez.getPtArray(0);
                    CTAdjPoint2D pt2 = bez.getPtArray(1);
                    CTAdjPoint2D pt3 = bez.getPtArray(2);
                    path.curveTo(
                            (float) (Units.toPoints((Long) pt1.getX()) * scaleW),
                            (float) (Units.toPoints((Long) pt1.getY()) * scaleH),
                            (float) (Units.toPoints((Long) pt2.getX()) * scaleW),
                            (float) (Units.toPoints((Long) pt2.getY()) * scaleH),
                            (float) (Units.toPoints((Long) pt3.getX()) * scaleW),
                            (float) (Units.toPoints((Long) pt3.getY()) * scaleH)                    );

                } else if (ch instanceof CTPath2DClose){
                    path.closePath();
                }
            }
View Full Code Here

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

        while (!it.isDone()) {
            double[] vals = new double[6];
            int type = it.currentSegment(vals);
            switch (type) {
                case PathIterator.SEG_MOVETO:
                    CTAdjPoint2D mv = ctPath.addNewMoveTo().addNewPt();
                    mv.setX(Units.toEMU(vals[0]) - x0);
                    mv.setY(Units.toEMU(vals[1]) - y0);
                    numPoints++;
                    break;
                case PathIterator.SEG_LINETO:
                    CTAdjPoint2D ln = ctPath.addNewLnTo().addNewPt();
                    ln.setX(Units.toEMU(vals[0]) - x0);
                    ln.setY(Units.toEMU(vals[1]) - y0);
                    numPoints++;
                    break;
                case PathIterator.SEG_CUBICTO:
                    CTPath2DCubicBezierTo bez = ctPath.addNewCubicBezTo();
                    CTAdjPoint2D p1 = bez.addNewPt();
                    p1.setX(Units.toEMU(vals[0]) - x0);
                    p1.setY(Units.toEMU(vals[1]) - y0);
                    CTAdjPoint2D p2 = bez.addNewPt();
                    p2.setX(Units.toEMU(vals[2]) - x0);
                    p2.setY(Units.toEMU(vals[3]) - y0);
                    CTAdjPoint2D p3 = bez.addNewPt();
                    p3.setX(Units.toEMU(vals[4]) - x0);
                    p3.setY(Units.toEMU(vals[5]) - y0);
                    numPoints += 3;
                    break;
                case PathIterator.SEG_CLOSE:
                    numPoints++;
                    ctPath.addNewClose();
View Full Code Here

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

        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));
                } else if (ch instanceof CTPath2DLineTo){
                    CTAdjPoint2D pt = ((CTPath2DLineTo)ch).getPt();
                    path.lineTo((float)Units.toPoints((Long)pt.getX() + x0),
                                (float)Units.toPoints((Long)pt.getY() + y0));
                } else if (ch instanceof CTPath2DCubicBezierTo){
                    CTPath2DCubicBezierTo bez = ((CTPath2DCubicBezierTo)ch);
                    CTAdjPoint2D pt1 = bez.getPtArray(0);
                    CTAdjPoint2D pt2 = bez.getPtArray(1);
                    CTAdjPoint2D pt3 = bez.getPtArray(2);
                    path.curveTo(
                            (float)Units.toPoints((Long) pt1.getX() + x0),
                            (float)Units.toPoints((Long) pt1.getY() + y0),
                            (float)Units.toPoints((Long) pt2.getX() + x0),
                            (float)Units.toPoints((Long) pt2.getY() + y0),
                            (float)Units.toPoints((Long) pt3.getX() + x0),
                            (float)Units.toPoints((Long) pt3.getY() + y0)
                    );

                } else if (ch instanceof CTPath2DClose){
                    path.closePath();
                }
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.