Package org.openxmlformats.schemas.drawingml.x2006.main

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


    public void testSchemeColor() {
        XMLSlideShow ppt = new XMLSlideShow();
        XSLFTheme theme = ppt.createSlide().getTheme();

        CTColor xml = CTColor.Factory.newInstance();
        xml.addNewSchemeClr().setVal(STSchemeColorVal.ACCENT_2);

        XSLFColor color = new XSLFColor(xml, theme, null);
        // accent2 is theme1.xml is <a:srgbClr val="C0504D"/>
        assertEquals(Color.decode("0xC0504D"), color.getColor());

        xml = CTColor.Factory.newInstance();
        xml.addNewSchemeClr().setVal(STSchemeColorVal.LT_1);
        color = new XSLFColor(xml, theme, null);
        // <a:sysClr val="window" lastClr="FFFFFF"/>
        assertEquals(Color.decode("0xFFFFFF"), color.getColor());

        xml = CTColor.Factory.newInstance();
        xml.addNewSchemeClr().setVal(STSchemeColorVal.DK_1);
        color = new XSLFColor(xml, theme, null);
        // <a:sysClr val="windowText" lastClr="000000"/>
        assertEquals(Color.decode("0x000000"), color.getColor());
    }
View Full Code Here


        // <a:sysClr val="windowText" lastClr="000000"/>
        assertEquals(Color.decode("0x000000"), color.getColor());
    }

    public void testPresetColor() {
        CTColor xml = CTColor.Factory.newInstance();
        xml.addNewPrstClr().setVal(STPresetColorVal.AQUAMARINE);
        XSLFColor color = new XSLFColor(xml, null, null);
        assertEquals(new Color(127, 255, 212), color.getColor());


        for(String colorName : XSLFColor.presetColors.keySet()){
            xml = CTColor.Factory.newInstance();
            STPresetColorVal.Enum val = STPresetColorVal.Enum.forString(colorName);
            assertNotNull(colorName, val);
            xml.addNewPrstClr().setVal(val);
            color = new XSLFColor(xml, null, null);
            assertEquals(XSLFColor.presetColors.get(colorName), color.getColor());
        }
    }
View Full Code Here

    public ThemesTable(ThemeDocument theme) {
        this.theme = theme;
    }

    public XSSFColor getThemeColor(int idx) {
        CTColorScheme colorScheme = theme.getTheme().getThemeElements().getClrScheme();
        CTColor ctColor = null;
        int cnt = 0;
        for (XmlObject obj : colorScheme.selectPath("./*")) {
            if (obj instanceof org.openxmlformats.schemas.drawingml.x2006.main.CTColor) {
                if (cnt == idx) {
                    ctColor = (org.openxmlformats.schemas.drawingml.x2006.main.CTColor) obj;
                   
                    byte[] rgb = null;
View Full Code Here

    public ThemesTable(ThemeDocument theme) {
        this.theme = theme;
    }

    public XSSFColor getThemeColor(int idx) {
        CTColorScheme colorScheme = theme.getTheme().getThemeElements().getClrScheme();
        CTColor ctColor = null;
        int cnt = 0;
        for (XmlObject obj : colorScheme.selectPath("./*")) {
            if (obj instanceof org.openxmlformats.schemas.drawingml.x2006.main.CTColor) {
                if (cnt == idx) {
                    ctColor = (org.openxmlformats.schemas.drawingml.x2006.main.CTColor) obj;
                   
                    byte[] rgb = null;
View Full Code Here

            CTBlipFillProperties blipFill = (CTBlipFillProperties)obj;
            paint = createTexturePaint(blipFill, graphics, parentPart);
        }
        else if (obj instanceof CTGradientFillProperties) {
            Rectangle2D anchor = getAnchor(graphics);
            CTGradientFillProperties gradFill = (CTGradientFillProperties) obj;
            if (gradFill.isSetLin()) {
                 paint = createLinearGradientPaint(graphics, gradFill, anchor, theme, phClr);
            } else if (gradFill.isSetPath()){
                CTPathShadeProperties ps = gradFill.getPath();
                if(ps.getPath() ==  STPathShadeType.CIRCLE){
                    paint = createRadialGradientPaint(gradFill, anchor, theme, phClr);
                } else if (ps.getPath() ==  STPathShadeType.SHAPE){
                    paint = toRadialGradientPaint(gradFill, anchor, theme, phClr);
                }
View Full Code Here

                return pos1.compareTo(pos2);
            }
        });
        gs[1].setPos(50000);

        CTGradientFillProperties g = CTGradientFillProperties.Factory.newInstance();
        g.set(gradFill);
        g.getGsLst().setGsArray(new CTGradientStop[]{gs[0], gs[1]});
        return createRadialGradientPaint(g, anchor, theme, phClr);
    }
View Full Code Here

            CTBlipFillProperties blipFill = (CTBlipFillProperties)obj;
            paint = createTexturePaint(blipFill, graphics, parentPart);
        }
        else if (obj instanceof CTGradientFillProperties) {
            Rectangle2D anchor = getAnchor(graphics);
            CTGradientFillProperties gradFill = (CTGradientFillProperties) obj;
            if (gradFill.isSetLin()) {
                 paint = createLinearGradientPaint(graphics, gradFill, anchor, theme, phClr);
            } else if (gradFill.isSetPath()){
                CTPathShadeProperties ps = gradFill.getPath();
                if(ps.getPath() ==  STPathShadeType.CIRCLE){
                    paint = createRadialGradientPaint(gradFill, anchor, theme, phClr);
                } else if (ps.getPath() ==  STPathShadeType.SHAPE){
                    paint = toRadialGradientPaint(gradFill, anchor, theme, phClr);
                }
View Full Code Here

                return pos1.compareTo(pos2);
            }
        });
        gs[1].setPos(50000);

        CTGradientFillProperties g = CTGradientFillProperties.Factory.newInstance();
        g.set(gradFill);
        g.getGsLst().setGsArray(new CTGradientStop[]{gs[0], gs[1]});
        return createRadialGradientPaint(g, anchor, theme, phClr);
    }
View Full Code Here

            CTBlipFillProperties blipFill = (CTBlipFillProperties)obj;
            paint = createTexturePaint(blipFill, graphics, parentPart);
        }
        else if (obj instanceof CTGradientFillProperties) {
            Rectangle2D anchor = getAnchor(graphics);
            CTGradientFillProperties gradFill = (CTGradientFillProperties) obj;
            if (gradFill.isSetLin()) {
                 paint = createLinearGradientPaint(graphics, gradFill, anchor, theme, phClr);
            } else if (gradFill.isSetPath()){
                CTPathShadeProperties ps = gradFill.getPath();
                if(ps.getPath() ==  STPathShadeType.CIRCLE){
                    paint = createRadialGradientPaint(gradFill, anchor, theme, phClr);
                } else if (ps.getPath() ==  STPathShadeType.SHAPE){
                    paint = toRadialGradientPaint(gradFill, anchor, theme, phClr);
                }
View Full Code Here

                return pos1.compareTo(pos2);
            }
        });
        gs[1].setPos(50000);

        CTGradientFillProperties g = CTGradientFillProperties.Factory.newInstance();
        g.set(gradFill);
        g.getGsLst().setGsArray(new CTGradientStop[]{gs[0], gs[1]});
        return createRadialGradientPaint(g, anchor, theme, phClr);
    }
View Full Code Here

TOP

Related Classes of org.openxmlformats.schemas.drawingml.x2006.main.CTGradientFillProperties

Copyright © 2018 www.massapicom. 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.