Class XSSFCellFill
- java.lang.Object
-
- org.apache.poi.xssf.usermodel.extensions.XSSFCellFill
-
public final class XSSFCellFill extends Object
This element specifies fill formatting. A cell fill consists of a background color, foreground color, and pattern to be applied across the cell.
-
-
Constructor Summary
Constructors Constructor Description XSSFCellFill()Creates an empty CellFillXSSFCellFill(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFill fill, IndexedColorMap colorMap)Creates a CellFill from the supplied parts
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFillgetCTFill()Returns the underlying XML bean.XSSFColorgetFillBackgroundColor()Get the background fill color.XSSFColorgetFillForegroundColor()Get the foreground fill color.org.openxmlformats.schemas.spreadsheetml.x2006.main.STPatternType.EnumgetPatternType()get the fill patterninthashCode()voidsetFillBackgroundColor(int index)Set the background fill color represented as a indexed color value.voidsetFillBackgroundColor(XSSFColor color)Set the background fill color represented as aXSSFColorvalue.voidsetFillForegroundColor(int index)Set the foreground fill color as a indexed color valuevoidsetFillForegroundColor(XSSFColor color)Set the foreground fill color represented as aXSSFColorvalue.voidsetPatternType(org.openxmlformats.schemas.spreadsheetml.x2006.main.STPatternType.Enum patternType)set the fill pattern
-
-
-
Constructor Detail
-
XSSFCellFill
public XSSFCellFill(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFill fill, IndexedColorMap colorMap)Creates a CellFill from the supplied parts- Parameters:
fill- - fill
-
XSSFCellFill
public XSSFCellFill()
Creates an empty CellFill
-
-
Method Detail
-
getFillBackgroundColor
public XSSFColor getFillBackgroundColor()
Get the background fill color.- Returns:
- fill color, null if color is not set
-
setFillBackgroundColor
public void setFillBackgroundColor(int index)
Set the background fill color represented as a indexed color value.- Parameters:
index- - the color to use
-
setFillBackgroundColor
public void setFillBackgroundColor(XSSFColor color)
Set the background fill color represented as aXSSFColorvalue.- Parameters:
color- - background color. null if color should be unset
-
getFillForegroundColor
public XSSFColor getFillForegroundColor()
Get the foreground fill color.- Returns:
- XSSFColor - foreground color. null if color is not set
-
setFillForegroundColor
public void setFillForegroundColor(int index)
Set the foreground fill color as a indexed color value- Parameters:
index- - the color to use
-
setFillForegroundColor
public void setFillForegroundColor(XSSFColor color)
Set the foreground fill color represented as aXSSFColorvalue.- Parameters:
color- - the color to use
-
getPatternType
public org.openxmlformats.schemas.spreadsheetml.x2006.main.STPatternType.Enum getPatternType()
get the fill pattern- Returns:
- fill pattern type. null if fill pattern is not set
-
setPatternType
public void setPatternType(org.openxmlformats.schemas.spreadsheetml.x2006.main.STPatternType.Enum patternType)
set the fill pattern- Parameters:
patternType- fill pattern to use
-
getCTFill
@Internal public org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFill getCTFill()
Returns the underlying XML bean.- Returns:
- CTFill
-
-