Package org.apache.poi.xssf.usermodel
Class XSSFDxfCellStyle
- java.lang.Object
-
- org.apache.poi.xssf.usermodel.XSSFCellStyle
-
- org.apache.poi.xssf.usermodel.XSSFDxfCellStyle
-
- All Implemented Interfaces:
Duplicatable,CellStyle,DxfCellStyle
public class XSSFDxfCellStyle extends org.apache.poi.xssf.usermodel.XSSFCellStyle implements DxfCellStyle
Cell style for Dxfs- Since:
- 3.7.0
- Author:
- henri
-
-
Constructor Summary
Constructors Constructor Description XSSFDxfCellStyle(int dxfId, org.apache.poi.xssf.model.StylesTable stylesSource, org.apache.poi.xssf.model.ThemesTable theme)XSSFDxfCellStyle(org.apache.poi.xssf.model.StylesTable stylesSource, org.apache.poi.xssf.model.ThemesTable theme)Creates an empty Cell Style with theme
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BorderStylegetBorderBottom()get the type of border to use for the bottom border of the cellBorderStylegetBorderDiagonal()get the type of border to use for the diagonal border of the cellBorderStylegetBorderHorizontal()get the type of border to use for the horizontal border of the cellBorderStylegetBorderLeft()get the type of border to use for the left border of the cellBorderStylegetBorderRight()get the type of border to use for the right border of the cellBorderStylegetBorderTop()get the type of border to use for the top border of the cellBorderStylegetBorderVertical()get the type of border to use for the vertical border of the cellorg.apache.poi.xssf.usermodel.XSSFColorgetBottomBorderXSSFColor()Get the color to use for the bottom borderprotected org.apache.poi.xssf.usermodel.extensions.XSSFCellAlignmentgetCellAlignment()get the cellAlignment object to use for manage alignmentshortgetDataFormat()get the index of the data format.StringgetDataFormatString()Get the format stringshortgetDiagonalBorderColor()get the color to use for the diagonal borderColorgetDiagonalBorderColorColor()org.apache.poi.xssf.usermodel.XSSFColorgetDiagonalBorderXSSFColor()Get the color to use for the diagonal borderorg.openxmlformats.schemas.spreadsheetml.x2006.main.CTDxfgetDxf()intgetDxfIndex()org.apache.poi.xssf.usermodel.XSSFColorgetFillBackgroundXSSFColor()Get the background fill color.org.apache.poi.xssf.usermodel.XSSFColorgetFillForegroundXSSFColor()Get the foreground fill color.FillPatternTypegetFillPattern()Get the fill patternintgetFontIndex()gets the index of the font for this styleintgetFontIndexAsInt()gets the index of the font for this stylebooleangetHidden()get whether the cell's using this style are to be hiddenshortgetHorizontalBorderColor()get the color to use for the horizontal borderColorgetHorizontalBorderColorColor()org.apache.poi.xssf.usermodel.XSSFColorgetHorizontalBorderXSSFColor()Get the color to use for the horizontal bordershortgetIndention()get the number of spaces to indent the text in the cellshortgetIndex()get the index within the Workbook (sequence within the collection of ExtendedFormat objects)org.apache.poi.xssf.usermodel.XSSFColorgetLeftBorderXSSFColor()Get the color to use for the left borderbooleangetLocked()get whether the cell's using this style are to be lockedorg.apache.poi.xssf.usermodel.XSSFFontgetOrCreateFont()Gets or create the font for this styleStringgetRawDataFormatString()org.apache.poi.xssf.usermodel.XSSFColorgetRightBorderXSSFColor()Get the color to use for the right bordershortgetRotation()get the degree of rotation for the text in the cell.org.apache.poi.xssf.usermodel.XSSFColorgetTopBorderXSSFColor()Get the color to use for the top bordershortgetVerticalBorderColor()get the color to use for the vertical borderColorgetVerticalBorderColorColor()org.apache.poi.xssf.usermodel.XSSFColorgetVerticalBorderXSSFColor()Get the color to use for the vertical borderbooleangetWrapText()get whether the text should be wrappedbooleanisShowDiagonalDownBorder()Whether show diagonalDown diagonal borderbooleanisShowDiagonalUpBorder()Whether show diagonalUp diagonal bordervoidsetBorder(BorderStyle left, Color leftColor, BorderStyle top, Color topColor, BorderStyle right, Color rightColor, BorderStyle bottom, Color bottomColor, BorderStyle diagonal, Color diagonalColor, BorderStyle horizontal, Color horizontalColor, BorderStyle vertical, Color verticalColor, boolean diaUp, boolean diaDown)voidsetBorderBottom(BorderStyle border)set the type of border to use for the bottom border of the cellvoidsetBorderDiagonal(BorderStyle border)set the type of border to use for the diagonal border of the cellvoidsetBorderHorizontal(BorderStyle border)set the type of border to use for the horizontal border of the cellvoidsetBorderLeft(BorderStyle border)set the type of border to use for the left border of the cellvoidsetBorderRight(BorderStyle border)set the type of border to use for the right border of the cellvoidsetBorderTop(BorderStyle border)set the type of border to use for the top border of the cellvoidsetBorderVertical(BorderStyle border)set the type of border to use for the horizontal border of the cellvoidsetBottomBorderColor(org.apache.poi.xssf.usermodel.XSSFColor color)Set the color to use for the left border as aXSSFColorvaluevoidsetDataFormat(short fmt)set the data format (must be a valid format).voidsetDiagonalBorderColor(short color)set the color to use for the diagonal bordervoidsetDiagonalBorderColor(org.apache.poi.xssf.usermodel.XSSFColor color)Set the color to use for the left border as aXSSFColorvaluevoidsetFill(Color fillColor, Color backColor, short patternType)voidsetFillBackgroundColor(org.apache.poi.xssf.usermodel.XSSFColor color)Set the background fill color represented as aXSSFColorvalue.voidsetFillForegroundColor(org.apache.poi.xssf.usermodel.XSSFColor color)Set the foreground fill color represented as aXSSFColorvalue.voidsetFillPattern(FillPatternType fp)setting to one fills the cell with the foreground color...voidsetFont(Font font)set the font for this stylevoidsetHidden(boolean hidden)set the cell's using this style to be hiddenvoidsetHorizontalBorderColor(short color)set the color to use for the horizontal bordervoidsetHorizontalBorderColor(org.apache.poi.xssf.usermodel.XSSFColor color)Set the color to use for the left border as aXSSFColorvaluevoidsetIndention(short indent)set the number of spaces to indent the text in the cellvoidsetIndex(int dxfId)voidsetLeftBorderColor(org.apache.poi.xssf.usermodel.XSSFColor color)Set the color to use for the left border as aXSSFColorvaluevoidsetLocked(boolean locked)set the cell's using this style to be lockedvoidsetRightBorderColor(org.apache.poi.xssf.usermodel.XSSFColor color)Set the color to use for the left border as aXSSFColorvaluevoidsetRotation(short rotation)set the degree of rotation for the text in the cell.voidsetShowDiagonalDownBorder(boolean down)Whether show diagonalDown diagonal bordervoidsetShowDiagonalUpBorder(boolean up)Whether show diagonalUp diagonal bordervoidsetTopBorderColor(org.apache.poi.xssf.usermodel.XSSFColor color)Set the color to use for the left border as aXSSFColorvaluevoidsetVerticalBorderColor(short color)set the color to use for the vertical bordervoidsetVerticalBorderColor(org.apache.poi.xssf.usermodel.XSSFColor color)Set the color to use for the left border as aXSSFColorvaluevoidsetWrapText(boolean wrapped)Set whether the text should be wrapped.-
Methods inherited from class org.apache.poi.xssf.usermodel.XSSFCellStyle
cloneStyleFrom, copy, equals, getAlignment, getBorderColor, getBottomBorderColor, getCoreXf, getFillBackgroundColor, getFillBackgroundColorColor, getFillForegroundColor, getFillForegroundColorColor, getFont, getLeftBorderColor, getQuotePrefixed, getReadingOrder, getRightBorderColor, getShrinkToFit, getStyleXf, getTopBorderColor, getUIndex, getVerticalAlignment, hashCode, setAlignment, setBorderColor, setBottomBorderColor, setDataFormat, setFillBackgroundColor, setFillBackgroundColor, setFillForegroundColor, setFillForegroundColor, setLeftBorderColor, setQuotePrefixed, setReadingOrder, setRightBorderColor, setShrinkToFit, setTopBorderColor, setVerticalAlignment, verifyBelongsToStylesSource
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.poi.ss.usermodel.CellStyle
cloneStyleFrom, getAlignment, getBottomBorderColor, getFillBackgroundColor, getFillBackgroundColorColor, getFillForegroundColor, getFillForegroundColorColor, getLeftBorderColor, getQuotePrefixed, getRightBorderColor, getShrinkToFit, getTopBorderColor, getVerticalAlignment, setAlignment, setBottomBorderColor, setFillBackgroundColor, setFillBackgroundColor, setFillForegroundColor, setFillForegroundColor, setLeftBorderColor, setQuotePrefixed, setRightBorderColor, setShrinkToFit, setTopBorderColor, setVerticalAlignment
-
-
-
-
Constructor Detail
-
XSSFDxfCellStyle
public XSSFDxfCellStyle(org.apache.poi.xssf.model.StylesTable stylesSource, org.apache.poi.xssf.model.ThemesTable theme)Creates an empty Cell Style with theme- Since:
- 3.8.2
-
XSSFDxfCellStyle
public XSSFDxfCellStyle(int dxfId, org.apache.poi.xssf.model.StylesTable stylesSource, org.apache.poi.xssf.model.ThemesTable theme)
-
-
Method Detail
-
setIndex
public void setIndex(int dxfId)
-
getDxf
public org.openxmlformats.schemas.spreadsheetml.x2006.main.CTDxf getDxf()
-
getIndex
public short getIndex()
Description copied from interface:CellStyleget the index within the Workbook (sequence within the collection of ExtendedFormat objects)
-
setDataFormat
public void setDataFormat(short fmt)
Description copied from interface:CellStyleset the data format (must be a valid format). Built in formats are defined atBuiltinFormats.- Specified by:
setDataFormatin interfaceCellStyle- Overrides:
setDataFormatin classorg.apache.poi.xssf.usermodel.XSSFCellStyle- See Also:
DataFormat
-
getDataFormat
public short getDataFormat()
Description copied from interface:CellStyleget the index of the data format. Built in formats are defined atBuiltinFormats.- Specified by:
getDataFormatin interfaceCellStyle- Overrides:
getDataFormatin classorg.apache.poi.xssf.usermodel.XSSFCellStyle- See Also:
DataFormat
-
getDataFormatString
public String getDataFormatString()
Description copied from interface:CellStyleGet the format string- Specified by:
getDataFormatStringin interfaceCellStyle- Overrides:
getDataFormatStringin classorg.apache.poi.xssf.usermodel.XSSFCellStyle
-
getRawDataFormatString
public String getRawDataFormatString()
-
setFont
public void setFont(Font font)
Description copied from interface:CellStyleset the font for this style- Specified by:
setFontin interfaceCellStyle- Overrides:
setFontin classorg.apache.poi.xssf.usermodel.XSSFCellStyle- Parameters:
font- a font object created or retrieved from the Workbook object- See Also:
Workbook.createFont(),Workbook.getFontAt(int)
-
getOrCreateFont
public org.apache.poi.xssf.usermodel.XSSFFont getOrCreateFont()
Gets or create the font for this style- Returns:
- XSSFFont - font
-
getFontIndex
public int getFontIndex()
Description copied from interface:CellStylegets the index of the font for this style- Specified by:
getFontIndexin interfaceCellStyle- Overrides:
getFontIndexin classorg.apache.poi.xssf.usermodel.XSSFCellStyle- See Also:
Workbook.getFontAt(int)
-
setHidden
public void setHidden(boolean hidden)
Description copied from interface:CellStyleset the cell's using this style to be hidden
-
getHidden
public boolean getHidden()
Description copied from interface:CellStyleget whether the cell's using this style are to be hidden
-
setLocked
public void setLocked(boolean locked)
Description copied from interface:CellStyleset the cell's using this style to be locked
-
getLocked
public boolean getLocked()
Description copied from interface:CellStyleget whether the cell's using this style are to be locked
-
setWrapText
public void setWrapText(boolean wrapped)
Description copied from interface:CellStyleSet whether the text should be wrapped. Setting this flag totruemake all content visible within a cell by displaying it on multiple lines- Specified by:
setWrapTextin interfaceCellStyle- Overrides:
setWrapTextin classorg.apache.poi.xssf.usermodel.XSSFCellStyle- Parameters:
wrapped- wrap text or not
-
getWrapText
public boolean getWrapText()
Description copied from interface:CellStyleget whether the text should be wrapped- Specified by:
getWrapTextin interfaceCellStyle- Overrides:
getWrapTextin classorg.apache.poi.xssf.usermodel.XSSFCellStyle- Returns:
- wrap text or not
-
setRotation
public void setRotation(short rotation)
Description copied from interface:CellStyleset the degree of rotation for the text in the cell. Note: HSSF uses values from -90 to 90 degrees, whereas XSSF uses values from 0 to 180 degrees. The implementations of this method will map between these two value-ranges accordingly, however the corresponding getter is returning values in the range mandated by the current type of Excel file-format that this CellStyle is applied to.- Specified by:
setRotationin interfaceCellStyle- Overrides:
setRotationin classorg.apache.poi.xssf.usermodel.XSSFCellStyle- Parameters:
rotation- degrees (see note above)
-
getRotation
public short getRotation()
Description copied from interface:CellStyleget the degree of rotation for the text in the cell. Note: HSSF uses values from -90 to 90 degrees, whereas XSSF uses values from 0 to 180 degrees. The implementations of this method will map between these two value-ranges value-range as used by the type of Excel file-format that this CellStyle is applied to.- Specified by:
getRotationin interfaceCellStyle- Overrides:
getRotationin classorg.apache.poi.xssf.usermodel.XSSFCellStyle- Returns:
- rotation degrees (see note above)
-
setIndention
public void setIndention(short indent)
Description copied from interface:CellStyleset the number of spaces to indent the text in the cell- Specified by:
setIndentionin interfaceCellStyle- Overrides:
setIndentionin classorg.apache.poi.xssf.usermodel.XSSFCellStyle- Parameters:
indent- - number of spaces
-
getIndention
public short getIndention()
Description copied from interface:CellStyleget the number of spaces to indent the text in the cell- Specified by:
getIndentionin interfaceCellStyle- Overrides:
getIndentionin classorg.apache.poi.xssf.usermodel.XSSFCellStyle- Returns:
- indent - number of spaces
-
setBorderLeft
public void setBorderLeft(BorderStyle border)
Description copied from interface:CellStyleset the type of border to use for the left border of the cell- Specified by:
setBorderLeftin interfaceCellStyle- Overrides:
setBorderLeftin classorg.apache.poi.xssf.usermodel.XSSFCellStyle- Parameters:
border- type
-
getBorderLeft
public BorderStyle getBorderLeft()
Description copied from interface:CellStyleget the type of border to use for the left border of the cell- Specified by:
getBorderLeftin interfaceCellStyle- Overrides:
getBorderLeftin classorg.apache.poi.xssf.usermodel.XSSFCellStyle- Returns:
- border type
-
setBorderRight
public void setBorderRight(BorderStyle border)
Description copied from interface:CellStyleset the type of border to use for the right border of the cell- Specified by:
setBorderRightin interfaceCellStyle- Overrides:
setBorderRightin classorg.apache.poi.xssf.usermodel.XSSFCellStyle- Parameters:
border- type
-
getBorderRight
public BorderStyle getBorderRight()
Description copied from interface:CellStyleget the type of border to use for the right border of the cell- Specified by:
getBorderRightin interfaceCellStyle- Overrides:
getBorderRightin classorg.apache.poi.xssf.usermodel.XSSFCellStyle- Returns:
- border type
-
setBorderTop
public void setBorderTop(BorderStyle border)
Description copied from interface:CellStyleset the type of border to use for the top border of the cell- Specified by:
setBorderTopin interfaceCellStyle- Overrides:
setBorderTopin classorg.apache.poi.xssf.usermodel.XSSFCellStyle- Parameters:
border- type
-
getBorderTop
public BorderStyle getBorderTop()
Description copied from interface:CellStyleget the type of border to use for the top border of the cell- Specified by:
getBorderTopin interfaceCellStyle- Overrides:
getBorderTopin classorg.apache.poi.xssf.usermodel.XSSFCellStyle- Returns:
- border type
-
setBorderBottom
public void setBorderBottom(BorderStyle border)
Description copied from interface:CellStyleset the type of border to use for the bottom border of the cell- Specified by:
setBorderBottomin interfaceCellStyle- Overrides:
setBorderBottomin classorg.apache.poi.xssf.usermodel.XSSFCellStyle- Parameters:
border- type
-
getBorderBottom
public BorderStyle getBorderBottom()
Description copied from interface:CellStyleget the type of border to use for the bottom border of the cell- Specified by:
getBorderBottomin interfaceCellStyle- Overrides:
getBorderBottomin classorg.apache.poi.xssf.usermodel.XSSFCellStyle- Returns:
- border type
-
setFillPattern
public void setFillPattern(FillPatternType fp)
Description copied from interface:CellStylesetting to one fills the cell with the foreground color... No idea about other values- Specified by:
setFillPatternin interfaceCellStyle- Overrides:
setFillPatternin classorg.apache.poi.xssf.usermodel.XSSFCellStyle- Parameters:
fp- fill pattern (set toFillPatternType.SOLID_FOREGROUNDto fill w/foreground color)
-
getFillPattern
public FillPatternType getFillPattern()
Description copied from interface:CellStyleGet the fill pattern- Specified by:
getFillPatternin interfaceCellStyle- Overrides:
getFillPatternin classorg.apache.poi.xssf.usermodel.XSSFCellStyle- Returns:
- the fill pattern, default value is
FillPatternType.NO_FILL
-
getCellAlignment
protected org.apache.poi.xssf.usermodel.extensions.XSSFCellAlignment getCellAlignment()
get the cellAlignment object to use for manage alignment- Overrides:
getCellAlignmentin classorg.apache.poi.xssf.usermodel.XSSFCellStyle- Returns:
- XSSFCellAlignment - cell alignment
-
setBorderHorizontal
public void setBorderHorizontal(BorderStyle border)
Description copied from interface:DxfCellStyleset the type of border to use for the horizontal border of the cell- Specified by:
setBorderHorizontalin interfaceDxfCellStyle- Parameters:
border- type
-
getBorderHorizontal
public BorderStyle getBorderHorizontal()
Description copied from interface:DxfCellStyleget the type of border to use for the horizontal border of the cell- Specified by:
getBorderHorizontalin interfaceDxfCellStyle- Returns:
- border type
-
getHorizontalBorderColorColor
public Color getHorizontalBorderColorColor()
- Specified by:
getHorizontalBorderColorColorin interfaceDxfCellStyle- Returns:
-
setHorizontalBorderColor
public void setHorizontalBorderColor(short color)
Description copied from interface:DxfCellStyleset the color to use for the horizontal border- Specified by:
setHorizontalBorderColorin interfaceDxfCellStyle- Parameters:
color- The index of the color definition
-
getHorizontalBorderColor
public short getHorizontalBorderColor()
Description copied from interface:DxfCellStyleget the color to use for the horizontal border- Specified by:
getHorizontalBorderColorin interfaceDxfCellStyle
-
setBorderVertical
public void setBorderVertical(BorderStyle border)
Description copied from interface:DxfCellStyleset the type of border to use for the horizontal border of the cell- Specified by:
setBorderVerticalin interfaceDxfCellStyle- Parameters:
border- type
-
getBorderVertical
public BorderStyle getBorderVertical()
Description copied from interface:DxfCellStyleget the type of border to use for the vertical border of the cell- Specified by:
getBorderVerticalin interfaceDxfCellStyle- Returns:
- border type
-
getVerticalBorderColorColor
public Color getVerticalBorderColorColor()
- Specified by:
getVerticalBorderColorColorin interfaceDxfCellStyle- Returns:
-
setVerticalBorderColor
public void setVerticalBorderColor(short color)
Description copied from interface:DxfCellStyleset the color to use for the vertical border- Specified by:
setVerticalBorderColorin interfaceDxfCellStyle- Parameters:
color- The index of the color definition
-
getVerticalBorderColor
public short getVerticalBorderColor()
Description copied from interface:DxfCellStyleget the color to use for the vertical border- Specified by:
getVerticalBorderColorin interfaceDxfCellStyle
-
setBorderDiagonal
public void setBorderDiagonal(BorderStyle border)
Description copied from interface:DxfCellStyleset the type of border to use for the diagonal border of the cell- Specified by:
setBorderDiagonalin interfaceDxfCellStyle- Parameters:
border- type
-
getBorderDiagonal
public BorderStyle getBorderDiagonal()
Description copied from interface:DxfCellStyleget the type of border to use for the diagonal border of the cell- Specified by:
getBorderDiagonalin interfaceDxfCellStyle- Returns:
- border type
-
getDiagonalBorderColorColor
public Color getDiagonalBorderColorColor()
- Specified by:
getDiagonalBorderColorColorin interfaceDxfCellStyle
-
setDiagonalBorderColor
public void setDiagonalBorderColor(short color)
Description copied from interface:DxfCellStyleset the color to use for the diagonal border- Specified by:
setDiagonalBorderColorin interfaceDxfCellStyle- Parameters:
color- The index of the color definition
-
getDiagonalBorderColor
public short getDiagonalBorderColor()
Description copied from interface:DxfCellStyleget the color to use for the diagonal border- Specified by:
getDiagonalBorderColorin interfaceDxfCellStyle
-
isShowDiagonalUpBorder
public boolean isShowDiagonalUpBorder()
Description copied from interface:DxfCellStyleWhether show diagonalUp diagonal border- Specified by:
isShowDiagonalUpBorderin interfaceDxfCellStyle- Returns:
-
isShowDiagonalDownBorder
public boolean isShowDiagonalDownBorder()
Description copied from interface:DxfCellStyleWhether show diagonalDown diagonal border- Specified by:
isShowDiagonalDownBorderin interfaceDxfCellStyle
-
setShowDiagonalUpBorder
public void setShowDiagonalUpBorder(boolean up)
Description copied from interface:DxfCellStyleWhether show diagonalUp diagonal border- Specified by:
setShowDiagonalUpBorderin interfaceDxfCellStyle
-
setShowDiagonalDownBorder
public void setShowDiagonalDownBorder(boolean down)
Description copied from interface:DxfCellStyleWhether show diagonalDown diagonal border- Specified by:
setShowDiagonalDownBorderin interfaceDxfCellStyle
-
setLeftBorderColor
public void setLeftBorderColor(org.apache.poi.xssf.usermodel.XSSFColor color)
Set the color to use for the left border as aXSSFColorvalue- Overrides:
setLeftBorderColorin classorg.apache.poi.xssf.usermodel.XSSFCellStyle- Parameters:
color- the color to use
-
setTopBorderColor
public void setTopBorderColor(org.apache.poi.xssf.usermodel.XSSFColor color)
Set the color to use for the left border as aXSSFColorvalue- Overrides:
setTopBorderColorin classorg.apache.poi.xssf.usermodel.XSSFCellStyle- Parameters:
color- the color to use
-
setRightBorderColor
public void setRightBorderColor(org.apache.poi.xssf.usermodel.XSSFColor color)
Set the color to use for the left border as aXSSFColorvalue- Overrides:
setRightBorderColorin classorg.apache.poi.xssf.usermodel.XSSFCellStyle- Parameters:
color- the color to use
-
setBottomBorderColor
public void setBottomBorderColor(org.apache.poi.xssf.usermodel.XSSFColor color)
Set the color to use for the left border as aXSSFColorvalue- Overrides:
setBottomBorderColorin classorg.apache.poi.xssf.usermodel.XSSFCellStyle- Parameters:
color- the color to use
-
setHorizontalBorderColor
public void setHorizontalBorderColor(org.apache.poi.xssf.usermodel.XSSFColor color)
Set the color to use for the left border as aXSSFColorvalue- Parameters:
color- the color to use
-
setVerticalBorderColor
public void setVerticalBorderColor(org.apache.poi.xssf.usermodel.XSSFColor color)
Set the color to use for the left border as aXSSFColorvalue- Parameters:
color- the color to use
-
setDiagonalBorderColor
public void setDiagonalBorderColor(org.apache.poi.xssf.usermodel.XSSFColor color)
Set the color to use for the left border as aXSSFColorvalue- Parameters:
color- the color to use
-
getLeftBorderXSSFColor
public org.apache.poi.xssf.usermodel.XSSFColor getLeftBorderXSSFColor()
Get the color to use for the left border- Overrides:
getLeftBorderXSSFColorin classorg.apache.poi.xssf.usermodel.XSSFCellStyle- Returns:
- the index of the color definition or
nullif not set - See Also:
IndexedColors
-
getTopBorderXSSFColor
public org.apache.poi.xssf.usermodel.XSSFColor getTopBorderXSSFColor()
Get the color to use for the top border- Overrides:
getTopBorderXSSFColorin classorg.apache.poi.xssf.usermodel.XSSFCellStyle- Returns:
- the index of the color definition or
nullif not set - See Also:
IndexedColors
-
getRightBorderXSSFColor
public org.apache.poi.xssf.usermodel.XSSFColor getRightBorderXSSFColor()
Get the color to use for the right border- Overrides:
getRightBorderXSSFColorin classorg.apache.poi.xssf.usermodel.XSSFCellStyle- Returns:
- the index of the color definition or
nullif not set - See Also:
IndexedColors
-
getBottomBorderXSSFColor
public org.apache.poi.xssf.usermodel.XSSFColor getBottomBorderXSSFColor()
Get the color to use for the bottom border- Overrides:
getBottomBorderXSSFColorin classorg.apache.poi.xssf.usermodel.XSSFCellStyle- Returns:
- the index of the color definition or
nullif not set - See Also:
IndexedColors
-
getHorizontalBorderXSSFColor
public org.apache.poi.xssf.usermodel.XSSFColor getHorizontalBorderXSSFColor()
Get the color to use for the horizontal border- Returns:
- the index of the color definition or
nullif not set - See Also:
IndexedColors
-
getVerticalBorderXSSFColor
public org.apache.poi.xssf.usermodel.XSSFColor getVerticalBorderXSSFColor()
Get the color to use for the vertical border- Returns:
- the index of the color definition or
nullif not set - See Also:
IndexedColors
-
getDiagonalBorderXSSFColor
public org.apache.poi.xssf.usermodel.XSSFColor getDiagonalBorderXSSFColor()
Get the color to use for the diagonal border- Returns:
- the index of the color definition or
nullif not set - See Also:
IndexedColors
-
setFillForegroundColor
public void setFillForegroundColor(org.apache.poi.xssf.usermodel.XSSFColor color)
Set the foreground fill color represented as aXSSFColorvalue.
Note: Ensure Foreground color is set prior to background color.- Overrides:
setFillForegroundColorin classorg.apache.poi.xssf.usermodel.XSSFCellStyle- Parameters:
color- the color to use- See Also:
)
-
setFillBackgroundColor
public void setFillBackgroundColor(org.apache.poi.xssf.usermodel.XSSFColor color)
Set the background fill color represented as aXSSFColorvalue.For example:
cs.setFillPattern(XSSFCellStyle.FINE_DOTS ); cs.setFillBackgroundXSSFColor(new XSSFColor(java.awt.Color.RED));
optionally a Foreground and background fill can be applied: Note: Ensure Foreground color is set prior to backgroundcs.setFillPattern(XSSFCellStyle.FINE_DOTS ); cs.setFillForegroundColor(new XSSFColor(java.awt.Color.BLUE)); cs.setFillBackgroundColor(new XSSFColor(java.awt.Color.GREEN));
or, for the special case of SOLID_FILL:cs.setFillPattern(XSSFCellStyle.SOLID_FOREGROUND ); cs.setFillForegroundColor(new XSSFColor(java.awt.Color.GREEN));
It is necessary to set the fill style in order for the color to be shown in the cell.- Overrides:
setFillBackgroundColorin classorg.apache.poi.xssf.usermodel.XSSFCellStyle- Parameters:
color- - the color to use
-
getFillBackgroundXSSFColor
public org.apache.poi.xssf.usermodel.XSSFColor getFillBackgroundXSSFColor()
Get the background fill color.Note - many cells are actually filled with a foreground fill, not a background fill - see
XSSFCellStyle.getFillForegroundColor()- Overrides:
getFillBackgroundXSSFColorin classorg.apache.poi.xssf.usermodel.XSSFCellStyle- Returns:
- XSSFColor - fill color or
nullif not set
-
getFillForegroundXSSFColor
public org.apache.poi.xssf.usermodel.XSSFColor getFillForegroundXSSFColor()
Get the foreground fill color.Note - many cells are actually filled with a foreground fill, not a background fill - see
XSSFCellStyle.getFillForegroundColor()- Overrides:
getFillForegroundXSSFColorin classorg.apache.poi.xssf.usermodel.XSSFCellStyle- Returns:
- XSSFColor - fill color or
nullif not set
-
getFontIndexAsInt
public int getFontIndexAsInt()
Description copied from interface:CellStylegets the index of the font for this style- Specified by:
getFontIndexAsIntin interfaceCellStyle- Overrides:
getFontIndexAsIntin classorg.apache.poi.xssf.usermodel.XSSFCellStyle- See Also:
Workbook.getFontAt(int)
-
setBorder
public void setBorder(BorderStyle left, Color leftColor, BorderStyle top, Color topColor, BorderStyle right, Color rightColor, BorderStyle bottom, Color bottomColor, BorderStyle diagonal, Color diagonalColor, BorderStyle horizontal, Color horizontalColor, BorderStyle vertical, Color verticalColor, boolean diaUp, boolean diaDown)
-
getDxfIndex
public int getDxfIndex()
-
-