Search in sources :

Example 6 with CTPatternFill

use of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPatternFill in project poi by apache.

the class XSSFCellFill method setFillForegroundColor.

/**
     * Set the foreground fill color represented as a {@link XSSFColor} value.
     *
     * @param color - the color to use
     */
public void setFillForegroundColor(XSSFColor color) {
    CTPatternFill ptrn = ensureCTPatternFill();
    ptrn.setFgColor(color.getCTColor());
}
Also used : CTPatternFill(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPatternFill)

Example 7 with CTPatternFill

use of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPatternFill in project poi by apache.

the class XSSFCellFill method setPatternType.

/**
     * set the fill pattern
     *
     * @param patternType fill pattern to use
     */
public void setPatternType(STPatternType.Enum patternType) {
    CTPatternFill ptrn = ensureCTPatternFill();
    ptrn.setPatternType(patternType);
}
Also used : CTPatternFill(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPatternFill)

Example 8 with CTPatternFill

use of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPatternFill in project poi by apache.

the class XSSFCellFill method getFillBackgroundColor.

/**
     * Get the background fill color.
     *
     * @return fill color, null if color is not set
     */
public XSSFColor getFillBackgroundColor() {
    CTPatternFill ptrn = _fill.getPatternFill();
    if (ptrn == null)
        return null;
    CTColor ctColor = ptrn.getBgColor();
    return ctColor == null ? null : new XSSFColor(ctColor, _indexedColorMap);
}
Also used : XSSFColor(org.apache.poi.xssf.usermodel.XSSFColor) CTPatternFill(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPatternFill) CTColor(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTColor)

Example 9 with CTPatternFill

use of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPatternFill in project poi by apache.

the class XSSFCellFill method getFillForegroundColor.

/**
     * Get the foreground fill color.
     *
     * @return XSSFColor - foreground color. null if color is not set
     */
public XSSFColor getFillForegroundColor() {
    CTPatternFill ptrn = _fill.getPatternFill();
    if (ptrn == null)
        return null;
    CTColor ctColor = ptrn.getFgColor();
    return ctColor == null ? null : new XSSFColor(ctColor, _indexedColorMap);
}
Also used : XSSFColor(org.apache.poi.xssf.usermodel.XSSFColor) CTPatternFill(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPatternFill) CTColor(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTColor)

Example 10 with CTPatternFill

use of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPatternFill in project poi by apache.

the class XSSFCellFill method setFillBackgroundColor.

/**
     * Set the background fill color represented as a {@link XSSFColor} value.
     *
     * @param color
     */
public void setFillBackgroundColor(XSSFColor color) {
    CTPatternFill ptrn = ensureCTPatternFill();
    ptrn.setBgColor(color.getCTColor());
}
Also used : CTPatternFill(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPatternFill)

Aggregations

CTPatternFill (org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPatternFill)14 CTFill (org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFill)7 CTColor (org.openxmlformats.schemas.spreadsheetml.x2006.main.CTColor)6 Test (org.junit.Test)4 XSSFColor (org.apache.poi.xssf.usermodel.XSSFColor)2