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 IBorderFormatting GetBorderFormatting()
        {
            CT_Dxf dxf = this.GetDxf(false);

            if (dxf == null || !dxf.IsSetBorder())
            {
                return((IBorderFormatting)null);
            }
            return((IBorderFormatting) new XSSFBorderFormatting(dxf.border));
        }
Пример #3
0
        /**
         * Create a new border formatting structure if it does not exist,
         * otherwise just return existing object.
         *
         * @return - border formatting object, never returns <code>null</code>.
         */
        public IBorderFormatting CreateBorderFormatting()
        {
            CT_Dxf    dxf = GetDxf(true);
            CT_Border border;

            if (!dxf.IsSetBorder())
            {
                border = dxf.AddNewBorder();
            }
            else
            {
                border = dxf.border;
            }

            return(new XSSFBorderFormatting(border));
        }
        public IBorderFormatting CreateBorderFormatting()
        {
            CT_Dxf dxf = this.GetDxf(true);

            return((IBorderFormatting) new XSSFBorderFormatting(dxf.IsSetBorder() ? dxf.border : dxf.AddNewBorder()));
        }