Ejemplo n.º 1
0
 public CT_CustomColor()
 {
     this.prstClrField   = new CT_PresetColor();
     this.schemeClrField = new CT_SchemeColor();
     this.sysClrField    = new CT_SystemColor();
     this.hslClrField    = new CT_HslColor();
     this.srgbClrField   = new CT_SRgbColor();
     this.scrgbClrField  = new CT_ScRgbColor();
     this.nameField      = "";
 }
Ejemplo n.º 2
0
        /**
         * Initialize default structure of a new auto-shape
         *
         */
        public static CT_Connector Prototype()
        {
            CT_Connector          shape = new CT_Connector();
            CT_ConnectorNonVisual nv    = shape.AddNewNvCxnSpPr();

            NPOI.OpenXmlFormats.Dml.Spreadsheet.CT_NonVisualDrawingProps nvp = nv.AddNewCNvPr();
            nvp.id   = (1);
            nvp.name = ("Shape 1");
            nv.AddNewCNvCxnSpPr();

            NPOI.OpenXmlFormats.Dml.Spreadsheet.CT_ShapeProperties sp  = shape.AddNewSpPr();
            NPOI.OpenXmlFormats.Dml.Spreadsheet.CT_Transform2D     t2d = sp.AddNewXfrm();
            CT_PositiveSize2D p1 = t2d.AddNewExt();

            p1.cx = (0);
            p1.cy = (0);
            CT_Point2D p2 = t2d.AddNewOff();

            p2.x = (0);
            p2.y = (0);

            CT_PresetGeometry2D geom = sp.AddNewPrstGeom();

            geom.prst = (ST_ShapeType.line);
            geom.AddNewAvLst();

            NPOI.OpenXmlFormats.Dml.Spreadsheet.CT_ShapeStyle style = shape.AddNewStyle();
            CT_SchemeColor scheme = style.AddNewLnRef().AddNewSchemeClr();

            scheme.val      = (ST_SchemeColorVal.accent1);
            style.lnRef.idx = (1);

            CT_StyleMatrixReference fillref = style.AddNewFillRef();

            fillref.idx = (0);
            fillref.AddNewSchemeClr().val = (ST_SchemeColorVal.accent1);

            CT_StyleMatrixReference effectRef = style.AddNewEffectRef();

            effectRef.idx = (0);
            effectRef.AddNewSchemeClr().val = (ST_SchemeColorVal.accent1);

            CT_FontReference fontRef = style.AddNewFontRef();

            fontRef.idx = (ST_FontCollectionIndex.minor);
            fontRef.AddNewSchemeClr().val = (ST_SchemeColorVal.tx1);

            prototype = shape;

            return(prototype);
        }
Ejemplo n.º 3
0
 public CT_TableStyleTextStyle()
 {
     this.extLstField    = new CT_OfficeArtExtensionList();
     this.prstClrField   = new CT_PresetColor();
     this.schemeClrField = new CT_SchemeColor();
     this.sysClrField    = new CT_SystemColor();
     this.hslClrField    = new CT_HslColor();
     this.srgbClrField   = new CT_SRgbColor();
     this.scrgbClrField  = new CT_ScRgbColor();
     this.fontRefField   = new CT_FontReference();
     this.fontField      = new CT_FontCollection();
     this.bField         = ST_OnOffStyleType.def;
     this.iField         = ST_OnOffStyleType.def;
 }
Ejemplo n.º 4
0
 internal static CT_Shape Prototype()
 {
     if (XSSFSimpleShape.prototype == null)
     {
         CT_Shape                 ctShape            = new CT_Shape();
         CT_ShapeNonVisual        ctShapeNonVisual   = ctShape.AddNewNvSpPr();
         CT_NonVisualDrawingProps visualDrawingProps = ctShapeNonVisual.AddNewCNvPr();
         visualDrawingProps.id   = 1U;
         visualDrawingProps.name = "Shape 1";
         ctShapeNonVisual.AddNewCNvSpPr();
         CT_ShapeProperties ctShapeProperties = ctShape.AddNewSpPr();
         CT_Transform2D     ctTransform2D     = ctShapeProperties.AddNewXfrm();
         CT_PositiveSize2D  ctPositiveSize2D  = ctTransform2D.AddNewExt();
         ctPositiveSize2D.cx = 0L;
         ctPositiveSize2D.cy = 0L;
         CT_Point2D ctPoint2D = ctTransform2D.AddNewOff();
         ctPoint2D.x = 0L;
         ctPoint2D.y = 0L;
         CT_PresetGeometry2D presetGeometry2D = ctShapeProperties.AddNewPrstGeom();
         presetGeometry2D.prst = ST_ShapeType.rect;
         presetGeometry2D.AddNewAvLst();
         CT_ShapeStyle  ctShapeStyle  = ctShape.AddNewStyle();
         CT_SchemeColor ctSchemeColor = ctShapeStyle.AddNewLnRef().AddNewSchemeClr();
         ctSchemeColor.val = ST_SchemeColorVal.accent1;
         ctSchemeColor.AddNewShade().val = 50000;
         ctShapeStyle.lnRef.idx = 2U;
         CT_StyleMatrixReference styleMatrixReference1 = ctShapeStyle.AddNewFillRef();
         styleMatrixReference1.idx = 1U;
         styleMatrixReference1.AddNewSchemeClr().val   = ST_SchemeColorVal.accent1;
         CT_StyleMatrixReference styleMatrixReference2 = ctShapeStyle.AddNewEffectRef();
         styleMatrixReference2.idx = 0U;
         styleMatrixReference2.AddNewSchemeClr().val = ST_SchemeColorVal.accent1;
         CT_FontReference ctFontReference            = ctShapeStyle.AddNewFontRef();
         ctFontReference.idx = ST_FontCollectionIndex.minor;
         ctFontReference.AddNewSchemeClr().val    = ST_SchemeColorVal.lt1;
         CT_TextBody           ctTextBody         = ctShape.AddNewTxBody();
         CT_TextBodyProperties textBodyProperties = ctTextBody.AddNewBodyPr();
         textBodyProperties.anchor = ST_TextAnchoringType.ctr;
         textBodyProperties.rtlCol = false;
         CT_TextParagraph ctTextParagraph = ctTextBody.AddNewP();
         ctTextParagraph.AddNewPPr().algn = ST_TextAlignType.ctr;
         CT_TextCharacterProperties characterProperties = ctTextParagraph.AddNewEndParaRPr();
         characterProperties.lang = "en-US";
         characterProperties.sz   = 1100;
         ctTextBody.AddNewLstStyle();
         XSSFSimpleShape.prototype = ctShape;
     }
     return(XSSFSimpleShape.prototype);
 }
Ejemplo n.º 5
0
        public static CT_FontReference Parse(XElement node, XmlNamespaceManager namespaceManager)
        {
            if (node == null)
            {
                return(null);
            }
            CT_FontReference ctObj = new CT_FontReference();

            if (node.Attribute("idx") != null)
            {
                ctObj.idx = (ST_FontCollectionIndex)Enum.Parse(typeof(ST_FontCollectionIndex), node.Attribute("idx").Value);
            }
            foreach (XElement childNode in node.ChildElements())
            {
                if (childNode.Name.LocalName == "scrgbClr")
                {
                    ctObj.scrgbClr = CT_ScRgbColor.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "srgbClr")
                {
                    ctObj.srgbClr = CT_SRgbColor.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "hslClr")
                {
                    ctObj.hslClr = CT_HslColor.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "sysClr")
                {
                    ctObj.sysClr = CT_SystemColor.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "schemeClr")
                {
                    ctObj.schemeClr = CT_SchemeColor.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "prstClr")
                {
                    ctObj.prstClr = CT_PresetColor.Parse(childNode, namespaceManager);
                }
            }
            return(ctObj);
        }
Ejemplo n.º 6
0
        public static CT_StyleMatrixReference Parse(XElement node, XmlNamespaceManager namespaceManager)
        {
            if (node == null)
            {
                return(null);
            }
            CT_StyleMatrixReference ctObj = new CT_StyleMatrixReference();

            ctObj.idx = XmlHelper.ReadUInt(node.Attribute("idx"));
            foreach (XElement childNode in node.ChildElements())
            {
                if (childNode.Name.LocalName == "scrgbClr")
                {
                    ctObj.scrgbClr = CT_ScRgbColor.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "srgbClr")
                {
                    ctObj.srgbClr = CT_SRgbColor.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "hslClr")
                {
                    ctObj.hslClr = CT_HslColor.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "sysClr")
                {
                    ctObj.sysClr = CT_SystemColor.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "schemeClr")
                {
                    ctObj.schemeClr = CT_SchemeColor.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "prstClr")
                {
                    ctObj.prstClr = CT_PresetColor.Parse(childNode, namespaceManager);
                }
            }
            return(ctObj);
        }
Ejemplo n.º 7
0
 public CT_SchemeColor AddNewSchemeClr()
 {
     this.schemeClrField = new CT_SchemeColor();
     return(this.schemeClrField);
 }
Ejemplo n.º 8
0
        /**
         * Prototype with the default structure of a new auto-shape.
         */
        internal static CT_Shape Prototype()
        {
            if (prototype == null)
            {
                CT_Shape shape = new CT_Shape();


                CT_ShapeNonVisual        nv  = shape.AddNewNvSpPr();
                CT_NonVisualDrawingProps nvp = nv.AddNewCNvPr();
                nvp.id   = (1);
                nvp.name = ("Shape 1");
                nv.AddNewCNvSpPr();

                CT_ShapeProperties sp  = shape.AddNewSpPr();
                CT_Transform2D     t2d = sp.AddNewXfrm();
                CT_PositiveSize2D  p1  = t2d.AddNewExt();
                p1.cx = (0);
                p1.cy = (0);
                CT_Point2D p2 = t2d.AddNewOff();
                p2.x = (0);
                p2.y = (0);

                CT_PresetGeometry2D geom = sp.AddNewPrstGeom();
                geom.prst = (ST_ShapeType.rect);
                geom.AddNewAvLst();

                CT_ShapeStyle  style  = shape.AddNewStyle();
                CT_SchemeColor scheme = style.AddNewLnRef().AddNewSchemeClr();
                scheme.val = (ST_SchemeColorVal.accent1);
                scheme.AddNewShade().val = 50000;
                style.lnRef.idx = (2);

                CT_StyleMatrixReference Fillref = style.AddNewFillRef();
                Fillref.idx = (1);
                Fillref.AddNewSchemeClr().val = (ST_SchemeColorVal.accent1);

                CT_StyleMatrixReference effectRef = style.AddNewEffectRef();
                effectRef.idx = (0);
                effectRef.AddNewSchemeClr().val = (ST_SchemeColorVal.accent1);

                CT_FontReference fontRef = style.AddNewFontRef();
                fontRef.idx = (ST_FontCollectionIndex.minor);
                fontRef.AddNewSchemeClr().val = (ST_SchemeColorVal.lt1);

                CT_TextBody           body   = shape.AddNewTxBody();
                CT_TextBodyProperties bodypr = body.AddNewBodyPr();
                bodypr.anchor = (ST_TextAnchoringType.ctr);
                bodypr.rtlCol = (false);
                CT_TextParagraph p = body.AddNewP();

                p.AddNewPPr().algn = (ST_TextAlignType.ctr);
                CT_TextCharacterProperties endPr = p.AddNewEndParaRPr();
                endPr.lang = ("en-US");
                endPr.sz   = (1100);

                body.AddNewLstStyle();

                prototype = shape;
            }
            return(prototype);
        }