Examples of addNewSrgbClr()


Examples of org.openxmlformats.schemas.drawingml.x2006.main.CTColor.addNewSrgbClr()

*/
public class TestXSLFColor extends TestCase {

    public void testGetters() {
        CTColor xml = CTColor.Factory.newInstance();
        CTSRgbColor c = xml.addNewSrgbClr();
        c.setVal(new byte[]{(byte)0xFF, 0, 0});

        XSLFColor color = new XSLFColor(xml, null, null);

        assertEquals(-1, color.getAlpha());
View Full Code Here

Examples of org.openxmlformats.schemas.drawingml.x2006.main.CTColor.addNewSrgbClr()

        assertEquals(new Color(128, 00, 00), color.getColor());
    }

    public void testSRgb() {
        CTColor xml = CTColor.Factory.newInstance();
        xml.addNewSrgbClr().setVal(new byte[]{ (byte)0xFF, (byte)0xFF, 0});

        XSLFColor color = new XSLFColor(xml, null, null);
        assertEquals(new Color(0xFF, 0xFF, 0), color.getColor());
    }
View Full Code Here

Examples of org.openxmlformats.schemas.drawingml.x2006.main.CTColor.addNewSrgbClr()

    }

    public void setBulletFontColor(Color color){
        CTTextParagraphProperties pr = _p.isSetPPr() ? _p.getPPr() : _p.addNewPPr();
        CTColor c = pr.isSetBuClr() ? pr.getBuClr() : pr.addNewBuClr();
        CTSRgbColor clr = c.isSetSrgbClr() ? c.getSrgbClr() : c.addNewSrgbClr();
        clr.setVal(new byte[]{(byte) color.getRed(), (byte) color.getGreen(), (byte) color.getBlue()});
    }

    public double getBulletFontSize(){
        ParagraphPropertyFetcher<Double> fetcher = new ParagraphPropertyFetcher<Double>(getLevel()){
View Full Code Here

Examples of org.openxmlformats.schemas.drawingml.x2006.main.CTSolidColorFillProperties.addNewSrgbClr()

    }

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

Examples of org.openxmlformats.schemas.drawingml.x2006.main.CTSolidColorFillProperties.addNewSrgbClr()

    }

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

Examples of org.openxmlformats.schemas.drawingml.x2006.main.CTSolidColorFillProperties.addNewSrgbClr()

            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.addNewSrgbClr()

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

Examples of org.openxmlformats.schemas.drawingml.x2006.main.CTSolidColorFillProperties.addNewSrgbClr()

                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.addNewSrgbClr()

    }

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

Examples of org.openxmlformats.schemas.drawingml.x2006.main.CTSolidColorFillProperties.addNewSrgbClr()

    }

    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();
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.