public short getFillPattern() { if(!_fill.isSetPatternFill() || !_fill.getPatternFill().isSetPatternType()) return NO_FILL; return (short)(_fill.getPatternFill().getPatternType().intValue() - 1); }
/** * 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); }
public short getFillPattern() { if(!_fill.isSetPatternFill() || !_fill.getPatternFill().isSetPatternType()) return NO_FILL; return (short)(_fill.getPatternFill().getPatternType().intValue() - 1); }
public short getFillPattern(){ if(!_fill.isSetPatternFill() || !_fill.getPatternFill().isSetPatternType()) return NO_FILL; return (short)(_fill.getPatternFill().getPatternType().intValue() - 1); }
/** * 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); }
CTFill ct = getCTFill(); CTPatternFill ptrn = ct.isSetPatternFill() ? ct.getPatternFill() : ct.addNewPatternFill(); if(fp == NO_FILL && ptrn.isSetPatternType()) ptrn.unsetPatternType(); else ptrn.setPatternType(STPatternType.Enum.forInt(fp + 1));