public XSSFDxfStyleProvider(CT_Dxf dxf, int stripeSize, IIndexedColorMap colorMap)
 {
     this.stripeSize = stripeSize;
     this.colorMap   = colorMap;
     if (dxf == null)
     {
         border = null;
         font   = null;
         number = null;
         fill   = null;
     }
     else
     {
         border = dxf.IsSetBorder() ? new XSSFBorderFormatting(dxf.border) : null;
         font   = dxf.IsSetFont() ? new XSSFFontFormatting(dxf.font) : null;
         if (dxf.IsSetNumFmt())
         {
             CT_NumFmt numFmt = dxf.numFmt;
             number = new ExcelNumberFormat((int)numFmt.numFmtId, numFmt.formatCode);
         }
         else
         {
             number = null;
         }
         fill = dxf.IsSetFill() ? new XSSFPatternFormatting(dxf.fill) : null;
     }
 }
        public IPatternFormatting GetPatternFormatting()
        {
            CT_Dxf dxf = this.GetDxf(false);

            if (dxf == null || !dxf.IsSetFill())
            {
                return((IPatternFormatting)null);
            }
            return((IPatternFormatting) new XSSFPatternFormatting(dxf.fill));
        }
Пример #3
0
        /**
         * Create a new pattern formatting structure if it does not exist,
         * otherwise just return existing object.
         *
         * @return - pattern formatting object, never returns <code>null</code>.
         */
        public IPatternFormatting CreatePatternFormatting()
        {
            CT_Dxf  dxf = GetDxf(true);
            CT_Fill fill;

            if (!dxf.IsSetFill())
            {
                fill = dxf.AddNewFill();
            }
            else
            {
                fill = dxf.fill;
            }

            return(new XSSFPatternFormatting(fill));
        }
        public IPatternFormatting CreatePatternFormatting()
        {
            CT_Dxf dxf = this.GetDxf(true);

            return((IPatternFormatting) new XSSFPatternFormatting(dxf.IsSetFill() ? dxf.fill : dxf.AddNewFill()));
        }