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

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


    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

        snapToAnchor(p1, anchor);
        snapToAnchor(p2, anchor);

        for (int i = 0; i < gs.length; i++) {
            CTGradientStop stop = gs[i];
            colors[i] = new XSLFColor(stop, theme, phClr).getColor();
            fractions[i] = stop.getPos() / 100000.f;
        }

        AffineTransform grAt  = new AffineTransform();
        if(gradFill.isSetRotWithShape() || !gradFill.getRotWithShape()) {
            double rotation = _shape.getRotation();
View Full Code Here

        Color[] colors = new Color[gs.length];
        float[] fractions = new float[gs.length];


        for (int i = 0; i < gs.length; i++) {
            CTGradientStop stop = gs[i];
            colors[i] = new XSLFColor(stop, theme, phClr).getColor();
            fractions[i] = stop.getPos() / 100000.f;
        }

        // Trick to return GradientPaint on JDK 1.5 and RadialGradientPaint on JDK 1.6+
        Paint paint;
        try {
View Full Code Here

        snapToAnchor(p1, anchor);
        snapToAnchor(p2, anchor);

        for (int i = 0; i < gs.length; i++) {
            CTGradientStop stop = gs[i];
            colors[i] = new XSLFColor(stop, theme, phClr).getColor();
            fractions[i] = stop.getPos() / 100000.f;
        }

        AffineTransform grAt  = new AffineTransform();
        if(gradFill.isSetRotWithShape() || !gradFill.getRotWithShape()) {
            double rotation = _shape.getRotation();
View Full Code Here

        Color[] colors = new Color[gs.length];
        float[] fractions = new float[gs.length];


        for (int i = 0; i < gs.length; i++) {
            CTGradientStop stop = gs[i];
            colors[i] = new XSLFColor(stop, theme, phClr).getColor();
            fractions[i] = stop.getPos() / 100000.f;
        }

        // Trick to return GradientPaint on JDK 1.5 and RadialGradientPaint on JDK 1.6+
        Paint paint;
        try {
View Full Code Here

        snapToAnchor(p1, anchor);
        snapToAnchor(p2, anchor);

        for (int i = 0; i < gs.length; i++) {
            CTGradientStop stop = gs[i];
            colors[i] = new XSLFColor(stop, theme, phClr).getColor();
            fractions[i] = stop.getPos() / 100000.f;
        }

        AffineTransform grAt  = new AffineTransform();
        if(gradFill.isSetRotWithShape() || !gradFill.getRotWithShape()) {
            double rotation = _shape.getRotation();
View Full Code Here

        Color[] colors = new Color[gs.length];
        float[] fractions = new float[gs.length];


        for (int i = 0; i < gs.length; i++) {
            CTGradientStop stop = gs[i];
            colors[i] = new XSLFColor(stop, theme, phClr).getColor();
            fractions[i] = stop.getPos() / 100000.f;
        }

        // Trick to return GradientPaint on JDK 1.5 and RadialGradientPaint on JDK 1.6+
        Paint paint;
        try {
View Full Code Here

TOP

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

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.