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

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


    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


    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

    private void read(InputStream is) throws Exception {
        XmlObject obj = XmlObject.Factory.parse(is);
        for (XmlObject def : obj.selectPath("*/*")) {

            String name = def.getDomNode().getLocalName();
            CTCustomGeometry2D geom = CTCustomGeometry2D.Factory.parse(def.toString());

            if(containsKey(name)) {
                System.out.println("Duplicate definoition of " + name) ;
            }
            put(name, new CustomGeometry(geom));
View Full Code Here

     */
    public GeneralPath getPath() {
        GeneralPath path = new GeneralPath();
        Rectangle2D bounds = getAnchor();

        CTCustomGeometry2D geom = getSpPr().getCustGeom();
        for(CTPath2D spPath : geom.getPathLst().getPathList()){
            double scaleW = bounds.getWidth() / Units.toPoints(spPath.getW());
            double scaleH = bounds.getHeight() / Units.toPoints(spPath.getH());
            for(XmlObject ch : spPath.selectPath("*")){
                if(ch instanceof CTPath2DMoveTo){
                    CTAdjPoint2D pt = ((CTPath2DMoveTo)ch).getPt();
View Full Code Here

        cnv.setName("Freeform " + shapeId);
        cnv.setId(shapeId + 1);
        nvSpPr.addNewCNvSpPr();
        nvSpPr.addNewNvPr();
        CTShapeProperties spPr = ct.addNewSpPr();
        CTCustomGeometry2D geom = spPr.addNewCustGeom();
        geom.addNewAvLst();
        geom.addNewGdLst();
        geom.addNewAhLst();
        geom.addNewCxnLst();
        CTGeomRect rect = geom.addNewRect();
        rect.setR("r");
        rect.setB("b");
        rect.setT("t");
        rect.setL("l");
        geom.addNewPathLst();
        return ct;
    }
View Full Code Here

    @SuppressWarnings("deprecation")
    public GeneralPath getPath() {
        GeneralPath path = new GeneralPath();
        Rectangle2D bounds = getAnchor();

        CTCustomGeometry2D geom = getSpPr().getCustGeom();
        for(CTPath2D spPath : geom.getPathLst().getPathArray()){
            double scaleW = bounds.getWidth() / Units.toPoints(spPath.getW());
            double scaleH = bounds.getHeight() / Units.toPoints(spPath.getH());
            for(XmlObject ch : spPath.selectPath("*")){
                if(ch instanceof CTPath2DMoveTo){
                    CTAdjPoint2D pt = ((CTPath2DMoveTo)ch).getPt();
View Full Code Here

        cnv.setName("Freeform " + shapeId);
        cnv.setId(shapeId + 1);
        nvSpPr.addNewCNvSpPr();
        nvSpPr.addNewNvPr();
        CTShapeProperties spPr = ct.addNewSpPr();
        CTCustomGeometry2D geom = spPr.addNewCustGeom();
        geom.addNewAvLst();
        geom.addNewGdLst();
        geom.addNewAhLst();
        geom.addNewCxnLst();
        CTGeomRect rect = geom.addNewRect();
        rect.setR("r");
        rect.setB("b");
        rect.setT("t");
        rect.setL("l");
        geom.addNewPathLst();
        return ct;
    }
View Full Code Here

    public GeneralPath getPath() {
        GeneralPath path = new GeneralPath();
        Rectangle2D bounds = getAnchor();
        int x0 = Units.toEMU(bounds.getX());
        int y0 = Units.toEMU(bounds.getY());
        CTCustomGeometry2D geom = getSpPr().getCustGeom();
        for(CTPath2D spPath : geom.getPathLst().getPathList()){
            for(XmlObject ch : spPath.selectPath("*")){
                if(ch instanceof CTPath2DMoveTo){
                    CTAdjPoint2D pt = ((CTPath2DMoveTo)ch).getPt();
                    path.moveTo((float)Units.toPoints((Long)pt.getX() + x0),
                                (float)Units.toPoints((Long)pt.getY() + y0));
View Full Code Here

        cnv.setName("Freeform " + shapeId);
        cnv.setId(shapeId + 1);
        nvSpPr.addNewCNvSpPr();
        nvSpPr.addNewNvPr();
        CTShapeProperties spPr = ct.addNewSpPr();
        CTCustomGeometry2D geom = spPr.addNewCustGeom();
        geom.addNewAvLst();
        geom.addNewGdLst();
        geom.addNewAhLst();
        geom.addNewCxnLst();
        CTGeomRect rect = geom.addNewRect();
        rect.setR("r");
        rect.setB("b");
        rect.setT("t");
        rect.setL("l");
        geom.addNewPathLst();
        return ct;
    }
View Full Code Here

TOP

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

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.