private CTPatternFill ensureCTPatternFill() { CTPatternFill patternFill = _fill.getPatternFill(); if (patternFill == null) { patternFill = _fill.addNewPatternFill(); } return patternFill; }
private static CTFill[] createDefaultFills() { CTFill[] ctFill = new CTFill[]{CTFill.Factory.newInstance(),CTFill.Factory.newInstance()}; ctFill[0].addNewPatternFill().setPatternType(STPatternType.NONE); ctFill[1].addNewPatternFill().setPatternType(STPatternType.DARK_GRAY); return ctFill; }
private void setFillForegroundColor(CTColor color) { CTPatternFill ptrn = _fill.isSetPatternFill() ? _fill.getPatternFill() : _fill.addNewPatternFill(); if (color == null) { ptrn.unsetFgColor(); } else { ptrn.setFgColor(color); } }
private void setFillBackgroundColor(CTColor color) { CTPatternFill ptrn = _fill.isSetPatternFill() ? _fill.getPatternFill() : _fill.addNewPatternFill(); if (color == null) { ptrn.unsetBgColor(); } else { ptrn.setBgColor(color); } }
public void setFillPattern(short fp){ CTPatternFill ptrn = _fill.isSetPatternFill() ? _fill.getPatternFill() : _fill.addNewPatternFill(); if(fp == NO_FILL) ptrn.unsetPatternType(); else ptrn.setPatternType(STPatternType.Enum.forInt(fp + 1)); } }
/** * Set the foreground fill color represented as a {@link XSSFColor} value. * <br> * <i>Note: Ensure Foreground color is set prior to background color.</i> * @param color the color to use * @see #setFillBackgroundColor(org.apache.poi.xssf.usermodel.XSSFColor) ) */ public void setFillForegroundColor(XSSFColor color) { CTFill ct = getCTFill(); CTPatternFill ptrn = ct.getPatternFill(); if(color == null) { if(ptrn != null && ptrn.isSetFgColor()) ptrn.unsetFgColor(); } else { if(ptrn == null) ptrn = ct.addNewPatternFill(); ptrn.setFgColor(color.getCTColor()); } addFill(ct); }
if(ptrn != null && ptrn.isSetBgColor()) ptrn.unsetBgColor(); } else { if(ptrn == null) ptrn = ct.addNewPatternFill(); ptrn.setBgColor(color.getCTColor());
/** * This element is used to specify cell fill information for pattern and solid color cell fills. For solid cell fills (no pattern), * foreground color is used is used. For cell fills with patterns specified, then the cell fill color is specified by the background color element. * * @param pattern the fill pattern to use * @see #setFillBackgroundColor(XSSFColor) * @see #setFillForegroundColor(XSSFColor) * @see org.apache.poi.ss.usermodel.FillPatternType */ @Override public void setFillPattern(FillPatternType pattern) { CTFill ct = getCTFill(); CTPatternFill ctptrn = ct.isSetPatternFill() ? ct.getPatternFill() : ct.addNewPatternFill(); if (pattern == FillPatternType.NO_FILL && ctptrn.isSetPatternType()) { ctptrn.unsetPatternType(); } else { ctptrn.setPatternType(STPatternType.Enum.forInt(pattern.getCode() + 1)); } addFill(ct); }
private CTPatternFill ensureCTPatternFill() { CTPatternFill patternFill = _fill.getPatternFill(); if (patternFill == null) { patternFill = _fill.addNewPatternFill(); } return patternFill; }
private CTPatternFill ensureCTPatternFill() { CTPatternFill patternFill = _fill.getPatternFill(); if (patternFill == null) { patternFill = _fill.addNewPatternFill(); } return patternFill; }
private static CTFill[] createDefaultFills() { CTFill[] ctFill = new CTFill[]{CTFill.Factory.newInstance(),CTFill.Factory.newInstance()}; ctFill[0].addNewPatternFill().setPatternType(STPatternType.NONE); ctFill[1].addNewPatternFill().setPatternType(STPatternType.DARK_GRAY); return ctFill; }
private static CTFill[] createDefaultFills() { CTFill[] ctFill = new CTFill[]{CTFill.Factory.newInstance(),CTFill.Factory.newInstance()}; ctFill[0].addNewPatternFill().setPatternType(STPatternType.NONE); ctFill[1].addNewPatternFill().setPatternType(STPatternType.DARK_GRAY); return ctFill; }
private void setFillBackgroundColor(CTColor color) { CTPatternFill ptrn = _fill.isSetPatternFill() ? _fill.getPatternFill() : _fill.addNewPatternFill(); if (color == null) { ptrn.unsetBgColor(); } else { ptrn.setBgColor(color); } }
private void setFillForegroundColor(CTColor color) { CTPatternFill ptrn = _fill.isSetPatternFill() ? _fill.getPatternFill() : _fill.addNewPatternFill(); if (color == null) { ptrn.unsetFgColor(); } else { ptrn.setFgColor(color); } }
public void setFillForegroundColor(short fg){ CTPatternFill ptrn = _fill.isSetPatternFill() ? _fill.getPatternFill() : _fill.addNewPatternFill(); CTColor fgColor = CTColor.Factory.newInstance(); fgColor.setIndexed(fg); ptrn.setFgColor(fgColor); }
public void setFillPattern(short fp){ CTPatternFill ptrn = _fill.isSetPatternFill() ? _fill.getPatternFill() : _fill.addNewPatternFill(); if(fp == NO_FILL) ptrn.unsetPatternType(); else ptrn.setPatternType(STPatternType.Enum.forInt(fp + 1)); } }
public void setFillBackgroundColor(short bg){ CTPatternFill ptrn = _fill.isSetPatternFill() ? _fill.getPatternFill() : _fill.addNewPatternFill(); CTColor bgColor = CTColor.Factory.newInstance(); bgColor.setIndexed(bg); ptrn.setBgColor(bgColor); }
public void setFillPattern(short fp){ CTPatternFill ptrn = _fill.isSetPatternFill() ? _fill.getPatternFill() : _fill.addNewPatternFill(); if(fp == NO_FILL) ptrn.unsetPatternType(); else ptrn.setPatternType(STPatternType.Enum.forInt(fp + 1)); } }
/** * Set the foreground fill color represented as a {@link XSSFColor} value. * <br> * <i>Note: Ensure Foreground color is set prior to background color.</i> * @param color the color to use * @see #setFillBackgroundColor(org.apache.poi.xssf.usermodel.XSSFColor) ) */ public void setFillForegroundColor(XSSFColor color) { CTFill ct = getCTFill(); CTPatternFill ptrn = ct.getPatternFill(); if(color == null) { if(ptrn != null && ptrn.isSetFgColor()) ptrn.unsetFgColor(); } else { if(ptrn == null) ptrn = ct.addNewPatternFill(); ptrn.setFgColor(color.getCTColor()); } addFill(ct); }
/** * This element is used to specify cell fill information for pattern and solid color cell fills. For solid cell fills (no pattern), * foreground color is used is used. For cell fills with patterns specified, then the cell fill color is specified by the background color element. * * @param pattern the fill pattern to use * @see #setFillBackgroundColor(XSSFColor) * @see #setFillForegroundColor(XSSFColor) * @see org.apache.poi.ss.usermodel.FillPatternType */ @Override public void setFillPattern(FillPatternType pattern) { CTFill ct = getCTFill(); CTPatternFill ctptrn = ct.isSetPatternFill() ? ct.getPatternFill() : ct.addNewPatternFill(); if (pattern == FillPatternType.NO_FILL && ctptrn.isSetPatternType()) { ctptrn.unsetPatternType(); } else { ctptrn.setPatternType(STPatternType.Enum.forInt(pattern.getCode() + 1)); } addFill(ct); }