Examples of CTSchemeColor


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

        if(bg.isSetBgPr()){
            XmlObject spPr = bg.getBgPr();
            fill = rShape.getPaint(graphics, spPr, null);
        } else if (bg.isSetBgRef()){
            CTStyleMatrixReference bgRef= bg.getBgRef();
            CTSchemeColor phClr = bgRef.getSchemeClr();

            int idx = (int)bgRef.getIdx() - 1001;
            XSLFTheme theme = getSheet().getTheme();
            CTBackgroundFillStyleList bgStyles =
                    theme.getXmlObject().getThemeElements().getFmtScheme().getBgFillStyleLst();
View Full Code Here

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

    }

    public Color getFontColor(){
        final XSLFTheme theme = _p.getParentShape().getSheet().getTheme();
        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) {
View Full Code Here

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

    }

    public Color getFontColor(){
        final XSLFTheme theme = _p.getParentShape().getSheet().getTheme();
        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) {
View Full Code Here

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

                // background fill style within the presentation's style matrix, defined by the fmtScheme element.
                // value of 0 or 1000 indicates no background,
                // values 1-999 refer to the index of a fill style within the fillStyleLst element
                // values 1001 and above refer to the index of a background fill style within the bgFillStyleLst element.
                int idx = (int)fillRef.getIdx();
                CTSchemeColor phClr = fillRef.getSchemeClr();
                XSLFSheet sheet = _shape.getSheet();
                XSLFTheme theme = sheet.getTheme();
                XmlObject fillProps = null;
                if(idx >= 1 && idx <= 999){
                    fillProps = theme.getXmlObject().
View Full Code Here

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

            CTShapeStyle style = _shape.getSpStyle();
            if (style != null) {
                // get a reference to a line style within the style matrix.
                CTStyleMatrixReference lnRef = style.getLnRef();
                int idx = (int)lnRef.getIdx();
                CTSchemeColor phClr = lnRef.getSchemeClr();
                if(idx > 0){
                    XSLFTheme theme = _shape.getSheet().getTheme();
                    XmlObject lnProps = theme.getXmlObject().
                            getThemeElements().getFmtScheme().getLnStyleLst().selectPath("*")[idx - 1];
                    paint = getPaint(graphics, lnProps, phClr);
View Full Code Here

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

        //assertEquals(slide6.getTheme().getColor("accent1").getColor(), s0.getFillColor());
        assertEquals(new Color(79, 129, 189), s0.getFillColor());

        // lighter 80%
        XSLFSimpleShape s1 = (XSLFSimpleShape)shapes[1];
        CTSchemeColor ref1 = s1.getSpPr().getSolidFill().getSchemeClr();
        assertEquals(1, ref1.sizeOfLumModArray());
        assertEquals(1, ref1.sizeOfLumOffArray());
        assertEquals(20000, ref1.getLumModArray(0).getVal());
        assertEquals(80000, ref1.getLumOffArray(0).getVal());
        assertEquals("accent1", ref1.getVal().toString());
        assertEquals(new Color(220, 230, 242), s1.getFillColor());

        // lighter 60%
        XSLFSimpleShape s2 = (XSLFSimpleShape)shapes[2];
        CTSchemeColor ref2 = s2.getSpPr().getSolidFill().getSchemeClr();
        assertEquals(1, ref2.sizeOfLumModArray());
        assertEquals(1, ref2.sizeOfLumOffArray());
        assertEquals(40000, ref2.getLumModArray(0).getVal());
        assertEquals(60000, ref2.getLumOffArray(0).getVal());
        assertEquals("accent1", ref2.getVal().toString());
        assertEquals(new Color(185, 205, 229), s2.getFillColor());

        // lighter 40%
        XSLFSimpleShape s3 = (XSLFSimpleShape)shapes[3];
        CTSchemeColor ref3 = s3.getSpPr().getSolidFill().getSchemeClr();
        assertEquals(1, ref3.sizeOfLumModArray());
        assertEquals(1, ref3.sizeOfLumOffArray());
        assertEquals(60000, ref3.getLumModArray(0).getVal());
        assertEquals(40000, ref3.getLumOffArray(0).getVal());
        assertEquals("accent1", ref3.getVal().toString());
        assertEquals(new Color(149, 179, 215), s3.getFillColor());

        // darker 25%
        XSLFSimpleShape s4 = (XSLFSimpleShape)shapes[4];
        CTSchemeColor ref4 = s4.getSpPr().getSolidFill().getSchemeClr();
        assertEquals(1, ref4.sizeOfLumModArray());
        assertEquals(0, ref4.sizeOfLumOffArray());
        assertEquals(75000, ref4.getLumModArray(0).getVal());
        assertEquals("accent1", ref3.getVal().toString());
        // YK: calculated color is slightly different from PowerPoint
        assertEquals(new Color(59, 97, 142), s4.getFillColor());

        XSLFSimpleShape s5 = (XSLFSimpleShape)shapes[5];
        CTSchemeColor ref5 = s5.getSpPr().getSolidFill().getSchemeClr();
        assertEquals(1, ref5.sizeOfLumModArray());
        assertEquals(0, ref5.sizeOfLumOffArray());
        assertEquals(50000, ref5.getLumModArray(0).getVal());
        assertEquals("accent1", ref5.getVal().toString());
        // YK: calculated color is slightly different from PowerPoint
        assertEquals(new Color(40, 65, 95), s5.getFillColor());
    }
View Full Code Here

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

    }

    public Color getFontColor(){
        final XSLFTheme theme = _p.getParentShape().getSheet().getTheme();
        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) {
View Full Code Here

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

            CTPresetGeometry2D geom = sp.addNewPrstGeom();
            geom.setPrst(STShapeType.LINE);
            geom.addNewAvLst();

            CTShapeStyle style = shape.addNewStyle();
            CTSchemeColor scheme = style.addNewLnRef().addNewSchemeClr();
            scheme.setVal(STSchemeColorVal.ACCENT_1);
            style.getLnRef().setIdx(1);

            CTStyleMatrixReference fillref = style.addNewFillRef();
            fillref.setIdx(0);
            fillref.addNewSchemeClr().setVal(STSchemeColorVal.ACCENT_1);
View Full Code Here

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

            CTPresetGeometry2D geom = sp.addNewPrstGeom();
            geom.setPrst(STShapeType.RECT);
            geom.addNewAvLst();

            CTShapeStyle style = shape.addNewStyle();
            CTSchemeColor scheme = style.addNewLnRef().addNewSchemeClr();
            scheme.setVal(STSchemeColorVal.ACCENT_1);
            scheme.addNewShade().setVal(50000);
            style.getLnRef().setIdx(2);

            CTStyleMatrixReference fillref = style.addNewFillRef();
            fillref.setIdx(1);
            fillref.addNewSchemeClr().setVal(STSchemeColorVal.ACCENT_1);
View Full Code Here

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

        XSLFTheme theme = getSheet().getTheme();
        CTOuterShadowEffect ct = (CTOuterShadowEffect)getXmlObject();
        if(ct == null) {
            return null;
        } else {
            CTSchemeColor phClr = ct.getSchemeClr();
            return new XSLFColor(ct, theme, phClr).getColor();
        }
    }
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.