public short getFillBackgroundColor() { XSSFColor color = getFillBackgroundColorColor(); if (color == null) return 0; return color.getIndexed(); } public short getFillForegroundColor() {
public short getFillForegroundColor() { XSSFColor color = getFillForegroundColorColor(); if (color == null) return 0; return color.getIndexed(); }
public void setFillBackgroundColor(Color bg) { XSSFColor xcolor = XSSFColor.toXSSFColor(bg); if (xcolor == null) setFillBackgroundColor((CTColor)null); else setFillBackgroundColor(xcolor.getCTColor()); } public void setFillBackgroundColor(short bg) {
/** * @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()); }
public void setFillForegroundColor(Color fg) { XSSFColor xcolor = XSSFColor.toXSSFColor(fg); if (xcolor == null) setFillForegroundColor((CTColor)null); else setFillForegroundColor(xcolor.getCTColor()); } public void setFillForegroundColor(short fg) {
/** * 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()); }
public void setFillForegroundColor(short fg) { CTColor fgColor = CTColor.Factory.newInstance(); fgColor.setIndexed(fg); setFillForegroundColor(fgColor); } private void setFillForegroundColor(CTColor color) {
/** * @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; } }
public void setFillBackgroundColor(short bg) { CTColor bgColor = CTColor.Factory.newInstance(); bgColor.setIndexed(bg); setFillBackgroundColor(bgColor); } private void setFillBackgroundColor(CTColor color) {
public void setFillForegroundColor(Color fg) { XSSFColor xcolor = XSSFColor.toXSSFColor(fg); if (xcolor == null) setFillForegroundColor((CTColor)null); else setFillForegroundColor(xcolor.getCTColor()); } public void setFillForegroundColor(short fg) {
public short getFillBackgroundColor() { XSSFColor color = getFillBackgroundColorColor(); if (color == null) return 0; return color.getIndexed(); } public short getFillForegroundColor() {
public short getFillForegroundColor() { XSSFColor color = getFillForegroundColorColor(); if (color == null) return 0; return color.getIndexed(); }
/** * @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()); }
public void setFillBackgroundColor(Color bg) { XSSFColor xcolor = XSSFColor.toXSSFColor(bg); if (xcolor == null) setFillBackgroundColor((CTColor)null); else setFillBackgroundColor(xcolor.getCTColor()); } public void setFillBackgroundColor(short bg) {
public void setFillForegroundColor(short fg) { CTColor fgColor = CTColor.Factory.newInstance(); fgColor.setIndexed(fg); setFillForegroundColor(fgColor); } private void setFillForegroundColor(CTColor color) {
/** * 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); }
public void setFillBackgroundColor(short bg) { CTColor bgColor = CTColor.Factory.newInstance(); bgColor.setIndexed(bg); setFillBackgroundColor(bgColor); } private void setFillBackgroundColor(CTColor color) {
/** * @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; } }