/** * @return - pattern formatting object if defined, <code>null</code> otherwise */ public XSSFPatternFormatting getPatternFormatting(){ CTDxf dxf = getDxf(false); if(dxf == null || !dxf.isSetFill()) return null; return new XSSFPatternFormatting(dxf.getFill(), _sh.getWorkbook().getStylesSource().getIndexedColors()); }
/** * 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 XSSFPatternFormatting createPatternFormatting(){ CTDxf dxf = getDxf(true); CTFill fill; if(!dxf.isSetFill()) { fill = dxf.addNewFill(); } else { fill = dxf.getFill(); } return new XSSFPatternFormatting(fill, _sh.getWorkbook().getStylesSource().getIndexedColors()); }
/** * @param dxf * @param stripeSize 0 for non-stripe styles, > 1 for stripes * @param colorMap */ public XSSFDxfStyleProvider(CTDxf dxf, int stripeSize, IndexedColorMap 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.getBorder(), colorMap) : null; font = dxf.isSetFont() ? new XSSFFontFormatting(dxf.getFont(), colorMap) : null; if (dxf.isSetNumFmt()) { CTNumFmt numFmt = dxf.getNumFmt(); number = new ExcelNumberFormat((int) numFmt.getNumFmtId(), numFmt.getFormatCode()); } else { number = null; } fill = dxf.isSetFill() ? new XSSFPatternFormatting(dxf.getFill(), colorMap) : null; } }
/** * @return - pattern formatting object if defined, <code>null</code> otherwise */ public XSSFPatternFormatting getPatternFormatting(){ CTDxf dxf = getDxf(false); if(dxf == null || !dxf.isSetFill()) return null; return new XSSFPatternFormatting(dxf.getFill()); }
/** * 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 XSSFPatternFormatting createPatternFormatting(){ CTDxf dxf = getDxf(true); CTFill fill; if(!dxf.isSetFill()) { fill = dxf.addNewFill(); } else { fill = dxf.getFill(); } return new XSSFPatternFormatting(fill); }
/** * @return - pattern formatting object if defined, <code>null</code> otherwise */ public XSSFPatternFormatting getPatternFormatting(){ CTDxf dxf = getDxf(false); if(dxf == null || !dxf.isSetFill()) return null; return new XSSFPatternFormatting(dxf.getFill(), _sh.getWorkbook().getStylesSource().getIndexedColors()); }
/** * 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 XSSFPatternFormatting createPatternFormatting(){ CTDxf dxf = getDxf(true); CTFill fill; if(!dxf.isSetFill()) { fill = dxf.addNewFill(); } else { fill = dxf.getFill(); } return new XSSFPatternFormatting(fill, _sh.getWorkbook().getStylesSource().getIndexedColors()); }
/** * @param dxf * @param stripeSize 0 for non-stripe styles, > 1 for stripes * @param colorMap */ public XSSFDxfStyleProvider(CTDxf dxf, int stripeSize, IndexedColorMap 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.getBorder(), colorMap) : null; font = dxf.isSetFont() ? new XSSFFontFormatting(dxf.getFont(), colorMap) : null; if (dxf.isSetNumFmt()) { CTNumFmt numFmt = dxf.getNumFmt(); number = new ExcelNumberFormat((int) numFmt.getNumFmtId(), numFmt.getFormatCode()); } else { number = null; } fill = dxf.isSetFill() ? new XSSFPatternFormatting(dxf.getFill(), colorMap) : null; } }