Examples of CTSolidColorFillProperties


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

        return _r;
    }

    public void setFontColor(Color color){
        CTTextCharacterProperties rPr = getRpR();
        CTSolidColorFillProperties fill = rPr.isSetSolidFill() ? rPr.getSolidFill() : rPr.addNewSolidFill();
        CTSRgbColor clr = fill.isSetSrgbClr() ? fill.getSrgbClr() : fill.addNewSrgbClr();
        clr.setVal(new byte[]{(byte)color.getRed(), (byte)color.getGreen(), (byte)color.getBlue()});

        if(fill.isSetHslClr()) fill.unsetHslClr();
        if(fill.isSetPrstClr()) fill.unsetPrstClr();
        if(fill.isSetSchemeClr()) fill.unsetSchemeClr();
        if(fill.isSetScrgbClr()) fill.unsetScrgbClr();
        if(fill.isSetSysClr()) fill.unsetSysClr();

    }
View Full Code Here

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

        CTShapeStyle style = _p.getParentShape().getSpStyle();
        final CTSchemeColor phClr = style == null ? null : style.getFontRef().getSchemeClr();

        CharacterPropertyFetcher<Color> fetcher = new CharacterPropertyFetcher<Color>(_p.getLevel()){
            public boolean fetch(CTTextCharacterProperties props){
                CTSolidColorFillProperties solidFill = props.getSolidFill();
                if(solidFill != null) {
                    boolean useCtxColor =
                            (solidFill.isSetSchemeClr() && solidFill.getSchemeClr().getVal() == STSchemeColorVal.PH_CLR)
                            || isFetchingFromMaster;
                    Color c = new XSLFColor(solidFill, theme, useCtxColor ? phClr : null).getColor();
                    setValue(c);
                    return true;
                }
View Full Code Here

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

        return _r;
    }

    public void setFontColor(Color color){
        CTTextCharacterProperties rPr = getRPr();
        CTSolidColorFillProperties fill = rPr.isSetSolidFill() ? rPr.getSolidFill() : rPr.addNewSolidFill();
        CTSRgbColor clr = fill.isSetSrgbClr() ? fill.getSrgbClr() : fill.addNewSrgbClr();
        clr.setVal(new byte[]{(byte)color.getRed(), (byte)color.getGreen(), (byte)color.getBlue()});

        if(fill.isSetHslClr()) fill.unsetHslClr();
        if(fill.isSetPrstClr()) fill.unsetPrstClr();
        if(fill.isSetSchemeClr()) fill.unsetSchemeClr();
        if(fill.isSetScrgbClr()) fill.unsetScrgbClr();
        if(fill.isSetSysClr()) fill.unsetSysClr();

    }
View Full Code Here

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

        CTShapeStyle style = _p.getParentShape().getSpStyle();
        final CTSchemeColor phClr = style == null ? null : style.getFontRef().getSchemeClr();

        CharacterPropertyFetcher<Color> fetcher = new CharacterPropertyFetcher<Color>(_p.getLevel()){
            public boolean fetch(CTTextCharacterProperties props){
                CTSolidColorFillProperties solidFill = props.getSolidFill();
                if(solidFill != null) {
                    boolean useCtxColor =
                            (solidFill.isSetSchemeClr() && solidFill.getSchemeClr().getVal() == STSchemeColorVal.PH_CLR)
                            || isFetchingFromMaster;
                    Color c = new XSLFColor(solidFill, theme, useCtxColor ? phClr : null).getColor();
                    setValue(c);
                    return true;
                }
View Full Code Here

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

            CTTextParagraph p = body.addNewP();
            p.addNewPPr().setAlgn(STTextAlignType.L);
            CTTextCharacterProperties endPr = p.addNewEndParaRPr();
            endPr.setLang("en-US");
            endPr.setSz(1100);  
            CTSolidColorFillProperties scfpr = endPr.addNewSolidFill();
            scfpr.addNewSrgbClr().setVal(new byte[] { 0, 0, 0 });
                       
            body.addNewLstStyle();

            prototype = shape;
        }
View Full Code Here

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

            int sz = (int)(pr.getSzArray(0).getVal()*100);
            rPr.setSz(sz);
        }
       
        if(pr.sizeOfColorArray() > 0) {
            CTSolidColorFillProperties fill = rPr.isSetSolidFill() ? rPr.getSolidFill() : rPr.addNewSolidFill();
            org.openxmlformats.schemas.spreadsheetml.x2006.main.CTColor xlsColor = pr.getColorArray(0);
            if(xlsColor.isSetRgb()) {
                CTSRgbColor clr = fill.isSetSrgbClr() ? fill.getSrgbClr() : fill.addNewSrgbClr();
                clr.setVal(xlsColor.getRgb());
            }
            else if(xlsColor.isSetIndexed()) {
                HSSFColor indexed = HSSFColor.getIndexHash().get((int) xlsColor.getIndexed());
                if (indexed != null) {
                    byte[] rgb = new byte[3];
                    rgb[0] = (byte) indexed.getTriplet()[0];
                    rgb[1] = (byte) indexed.getTriplet()[1];
                    rgb[2] = (byte) indexed.getTriplet()[2];
                    CTSRgbColor clr = fill.isSetSrgbClr() ? fill.getSrgbClr() : fill.addNewSrgbClr();
                    clr.setVal(rgb);
                }
            }
        }
    }
View Full Code Here

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

        if (obj instanceof CTNoFillProperties) {
            paint = NO_PAINT;

        }
        else if (obj instanceof CTSolidColorFillProperties) {
            CTSolidColorFillProperties solidFill = (CTSolidColorFillProperties) obj;
            XSLFColor c = new XSLFColor(solidFill, theme, phClr);
            paint = c.getColor();
        }
        else if (obj instanceof CTBlipFillProperties) {
            CTBlipFillProperties blipFill = (CTBlipFillProperties)obj;
View Full Code Here

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

    }

    private Color getLineColor(CTLineProperties ln){
        if(ln == null || ln.isSetNoFill() || !ln.isSetSolidFill()) return null;

        CTSolidColorFillProperties fill = ln.getSolidFill();
        if(!fill.isSetSrgbClr()) {
            // TODO for now return null for all colors except explicit RGB
            return null;
        }
        byte[] val = fill.getSrgbClr().getVal();
        return new Color(0xFF & val[0], 0xFF & val[1], 0xFF & val[2]);
    }
View Full Code Here

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

        CTTableCellProperties spPr = getXmlObject().getTcPr();
        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.CTSolidColorFillProperties

    @Override
    public Color getFillColor(){
        CTTableCellProperties spPr = getXmlObject().getTcPr();
        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();
        return new Color(0xFF & val[0], 0xFF & val[1], 0xFF & val[2]);
    }
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.