Examples of CTShapeProperties


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

        byte[] val = rgb.getVal();
        return new Color(0xFF & val[0], 0xFF & val[1], 0xFF & val[2]);
    }

    public void setLineWidth(double width){
        CTShapeProperties spPr = getSpPr();
        if(width == 0.) {
            if(spPr.isSetLn()) spPr.getLn().unsetW();
        }
        else {
            CTLineProperties ln = spPr.isSetLn() ? spPr.getLn() : spPr.addNewLn();
            ln.setW(Units.toEMU(width));
        }
    }
View Full Code Here

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

            ln.setW(Units.toEMU(width));
        }
    }

    public double getLineWidth(){
        CTShapeProperties spPr = getSpPr();
        CTLineProperties ln = spPr.getLn();
        if(ln == null || !ln.isSetW()) return 0;

        return Units.toPoints(ln.getW());
    }
View Full Code Here

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

        return Units.toPoints(ln.getW());
    }

    public void setLineDash(LineDash dash){
        CTShapeProperties spPr = getSpPr();
        if(dash == null) {
            if(spPr.isSetLn()) spPr.getLn().unsetPrstDash();
        }
        else {
            CTPresetLineDashProperties val = CTPresetLineDashProperties.Factory.newInstance();
            val.setVal(STPresetLineDashVal.Enum.forInt(dash.ordinal() + 1));
            CTLineProperties ln = spPr.isSetLn() ? spPr.getLn() : spPr.addNewLn();
            ln.setPrstDash(val);
        }
    }
View Full Code Here

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

            ln.setPrstDash(val);
        }
    }

    public LineDash getLineDash(){
        CTShapeProperties spPr = getSpPr();
        CTLineProperties ln = spPr.getLn();
        if(ln == null || !ln.isSetPrstDash()) return null;

        CTPresetLineDashProperties dash = ln.getPrstDash();
        return LineDash.values()[dash.getVal().intValue() - 1];
    }
View Full Code Here

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

        CTPresetLineDashProperties dash = ln.getPrstDash();
        return LineDash.values()[dash.getVal().intValue() - 1];
    }

    public void setLineCap(LineCap cap){
        CTShapeProperties spPr = getSpPr();
        if(cap == null) {
            if(spPr.isSetLn()) spPr.getLn().unsetCap();
        }
        else {
            CTLineProperties ln = spPr.isSetLn() ? spPr.getLn() : spPr.addNewLn();
            ln.setCap(STLineCap.Enum.forInt(cap.ordinal() + 1));
        }
    }
View Full Code Here

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

            ln.setCap(STLineCap.Enum.forInt(cap.ordinal() + 1));
        }
    }

    public LineCap getLineCap(){
        CTShapeProperties spPr = getSpPr();
        CTLineProperties ln = spPr.getLn();
        if(ln == null || !ln.isSetCap()) return null;

        return LineCap.values()[ln.getCap().intValue() - 1];
    }
View Full Code Here

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

        CTNonVisualDrawingProps cnv = nvSpPr.addNewCNvPr();
        cnv.setName("Connector " + shapeId);
        cnv.setId(shapeId + 1);
        nvSpPr.addNewCNvCxnSpPr();
        nvSpPr.addNewNvPr();
        CTShapeProperties spPr = ct.addNewSpPr();
        CTPresetGeometry2D prst = spPr.addNewPrstGeom();
        prst.setPrst(STShapeType.LINE);
        prst.addNewAvLst();
        CTLineProperties ln = spPr.addNewLn();
        return ct;
    }
View Full Code Here

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

     *
     * @param color the solid color fill.
     * The value of <code>null</code> unsets the solidFIll attribute from the underlying xml
     */
    public void setFillColor(Color color) {
        CTShapeProperties spPr = getSpPr();
        if (color == null) {
            if(spPr.isSetSolidFill()) spPr.unsetSolidFill();
        }
        else {
            CTSolidColorFillProperties fill = spPr.isSetSolidFill() ? spPr.getSolidFill() : spPr.addNewSolidFill();

            CTSRgbColor rgb = CTSRgbColor.Factory.newInstance();
            rgb.setVal(new byte[]{(byte) color.getRed(), (byte) color.getGreen(), (byte) color.getBlue()});

            fill.setSrgbClr(rgb);
View Full Code Here

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

    /**
     *
     * @return solid fill color of null if not set
     */
    public Color getFillColor(){
        CTShapeProperties spPr = getSpPr();
        if(!spPr.isSetSolidFill() ) return null;

        CTSolidColorFillProperties fill = spPr.getSolidFill();
        if(!fill.isSetSrgbClr()) {
            // TODO for now return null for all colors except explicit RGB
            return null;
        }
        byte[] val = fill.getSrgbClr().getVal();
View Full Code Here

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

        CTNonVisualDrawingProps cnv = nvSpPr.addNewCNvPr();
        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();
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.