public class XSSFCellStyle extends java.lang.Object implements CellStyle, Duplicatable
Constructor and Description |
---|
XSSFCellStyle(int cellXfId, int cellStyleXfId, StylesTable stylesSource, ThemesTable theme)
Creates a Cell Style from the supplied parts
|
XSSFCellStyle(StylesTable stylesSource)
Creates an empty Cell Style
|
Modifier and Type | Method and Description |
---|---|
void |
cloneStyleFrom(CellStyle source)
Clones all the style information from another XSSFCellStyle, onto this one.
(将另一个 XSSFCellStyle 中的所有样式信息克隆到这个上。)
|
XSSFCellStyle |
copy()
Make a copy of this style.
(复制这种风格。)
|
boolean |
equals(java.lang.Object o)
Checks is the supplied style is equal to this style
(检查提供的样式是否等于此样式)
|
HorizontalAlignment |
getAlignment()
get the type of horizontal alignment for the cell
(获取单元格的水平对齐类型)
|
BorderStyle |
getBorderBottom()
get the type of border to use for the bottom border of the cell
(获取用于单元格底部边框的边框类型)
|
XSSFColor |
getBorderColor(XSSFCellBorder.BorderSide side)
Gets border color
(获取边框颜色)
|
BorderStyle |
getBorderLeft()
get the type of border to use for the left border of the cell
(获取用于单元格左边框的边框类型)
|
BorderStyle |
getBorderRight()
get the type of border to use for the right border of the cell
(获取用于单元格右边框的边框类型)
|
BorderStyle |
getBorderTop()
get the type of border to use for the top border of the cell
(获取用于单元格顶部边框的边框类型)
|
short |
getBottomBorderColor()
Get the color to use for the bottom border
Color is optional. (获取用于底部边框的颜色 颜色是可选的。) |
XSSFColor |
getBottomBorderXSSFColor()
Get the color to use for the bottom border as a
XSSFColor
(获取用于底部边框的颜色作为 XSSFColor)
|
protected XSSFCellAlignment |
getCellAlignment()
get the cellAlignment object to use for manage alignment
(获取用于管理对齐的 cellAlignment 对象)
|
org.openxmlformats.schemas.spreadsheetml.x2006.main.CTXf |
getCoreXf()
Used so that StylesSource can figure out our location
(用于 StylesSource 可以找出我们的位置)
|
short |
getDataFormat()
Get the index of the number format (numFmt) record used by this cell format.
(获取此单元格格式使用的数字格式(numFmt)记录的索引。)
|
java.lang.String |
getDataFormatString()
Get the contents of the format string, by looking up the StylesSource
(通过查找 StylesSource 获取格式字符串的内容)
|
short |
getFillBackgroundColor()
Get the background fill color.
(获取背景填充颜色。)
|
XSSFColor |
getFillBackgroundColorColor()
Gets the color object representing the current background fill, resolving indexes using the supplied workbook.
(获取表示当前背景填充的颜色对象,使用提供的工作簿解析索引。)
|
XSSFColor |
getFillBackgroundXSSFColor()
Get the background fill color.
(获取背景填充颜色。)
|
short |
getFillForegroundColor()
Get the foreground fill color.
(获取前景填充颜色。)
|
XSSFColor |
getFillForegroundColorColor()
Gets the color object representing the current foreground fill, resolving indexes using the supplied workbook.
(获取表示当前前景填充的颜色对象,使用提供的工作簿解析索引。)
|
XSSFColor |
getFillForegroundXSSFColor()
Get the foreground fill color.
(获取前景填充颜色。)
|
FillPatternType |
getFillPattern()
Get the fill pattern
(获取填充图案)
|
XSSFFont |
getFont()
Gets the font for this style
(获取此样式的字体)
|
int |
getFontIndex()
Gets the index of the font for this style
(获取此样式的字体索引)
|
int |
getFontIndexAsInt()
|
boolean |
getHidden()
Get whether the cell's using this style are to be hidden
(获取是否隐藏使用该样式的单元格)
|
short |
getIndention()
Get the number of spaces to indent the text in the cell
(获取单元格中文本缩进的空格数)
|
short |
getIndex()
Get the index within the StylesTable (sequence within the collection of CTXf elements)
(获取 StylesTable 中的索引(CTXf 元素集合中的序列))
|
short |
getLeftBorderColor()
Get the color to use for the left border
(获取用于左边框的颜色)
|
XSSFColor |
getLeftBorderXSSFColor()
Get the color to use for the left border
(获取用于左边框的颜色)
|
boolean |
getLocked()
Get whether the cell's using this style are locked
(获取使用该样式的单元格是否被锁定)
|
boolean |
getQuotePrefixed()
Is "Quote Prefix" or "123 Prefix" enabled for the cell?
(单元格是否启用了“引用前缀”或“123 前缀”?)
|
ReadingOrder |
getReadingOrder()
Get reading order of the cell
(获取单元格的阅读顺序)
|
short |
getRightBorderColor()
Get the color to use for the right border
(获取用于右边框的颜色)
|
XSSFColor |
getRightBorderXSSFColor()
Get the color to use for the right border
(获取用于右边框的颜色)
|
short |
getRotation()
Get the degree of rotation for the text in the cell
(获取单元格中文本的旋转度数)
|
boolean |
getShrinkToFit()
Should the Cell be auto-sized by Excel to shrink it to fit if this text is too long?
(如果此文本太长,是否应该由 Excel 自动调整单元格以缩小它以适应?)
|
org.openxmlformats.schemas.spreadsheetml.x2006.main.CTXf |
getStyleXf()
Used so that StylesSource can figure out our location
(用于 StylesSource 可以找出我们的位置)
|
short |
getTopBorderColor()
Get the color to use for the top border
(获取用于上边框的颜色)
|
XSSFColor |
getTopBorderXSSFColor()
Get the color to use for the top border
(获取用于上边框的颜色)
|
protected int |
getUIndex()
Workaround for places where we need to support more than 32767 cell styles, ideally the main getIndex() and others would return int, not short, but that would affect some public APIs
(我们需要支持超过 32767 种单元格样式的地方的解决方法,理想情况下,主 getIndex() 和其他将返回 int,而不是短,但这会影响一些公共 API)
|
VerticalAlignment |
getVerticalAlignment()
get the type of vertical alignment for the cell
(获取单元格的垂直对齐类型)
|
boolean |
getWrapText()
Whether the text should be wrapped
(文本是否应该换行)
|
int |
hashCode()
Returns a hash code value for the object.
(返回对象的哈希码值。)
|
void |
setAlignment(HorizontalAlignment align)
Set the type of horizontal alignment for the cell
(设置单元格的水平对齐类型)
|
void |
setBorderBottom(BorderStyle border)
Set the type of border to use for the bottom border of the cell
(设置用于单元格底部边框的边框类型)
|
void |
setBorderColor(XSSFCellBorder.BorderSide side, XSSFColor color)
Set the color to use for the selected border
(设置用于选定边框的颜色)
|
void |
setBorderLeft(BorderStyle border)
Set the type of border to use for the left border of the cell
(设置用于单元格左边框的边框类型)
|
void |
setBorderRight(BorderStyle border)
Set the type of border to use for the right border of the cell
(设置用于单元格右边框的边框类型)
|
void |
setBorderTop(BorderStyle border)
Set the type of border to use for the top border of the cell
(设置用于单元格上边框的边框类型)
|
void |
setBottomBorderColor(short color)
Set the color to use for the bottom border
(设置用于底部边框的颜色)
|
void |
setBottomBorderColor(XSSFColor color)
Set the color to use for the bottom border
(设置用于底部边框的颜色)
|
void |
setDataFormat(int fmt)
Set the index of a data format
(设置数据格式的索引)
|
void |
setDataFormat(short fmt)
Set the index of a data format
(设置数据格式的索引)
|
void |
setFillBackgroundColor(short bg)
Set the background fill color represented as a indexed color value.
(设置表示为索引颜色值的背景填充颜色。)
|
void |
setFillBackgroundColor(XSSFColor color)
Set the background fill color represented as a
XSSFColor value.
(设置表示为 XSSFColor 值的背景填充颜色。)
|
void |
setFillForegroundColor(short fg)
Set the foreground fill color as a indexed color value
Note: Ensure Foreground color is set prior to background color. (将前景色填充颜色设置为索引颜色值 注意:确保前景色设置在背景色之前。) |
void |
setFillForegroundColor(XSSFColor color)
Set the foreground fill color represented as a
XSSFColor value.
(设置表示为 XSSFColor 值的前景填充颜色。)
|
void |
setFillPattern(FillPatternType pattern)
This element is used to specify cell fill information for pattern and solid color cell fills.
(此元素用于指定图案和纯色单元格填充的单元格填充信息。)
|
void |
setFont(Font font)
Set the font for this style
(设置此样式的字体)
|
void |
setHidden(boolean hidden)
Set the cell's using this style to be hidden
(将使用此样式的单元格设置为隐藏)
|
void |
setIndention(short indent)
Set the number of spaces to indent the text in the cell
(设置单元格中文本缩进的空格数)
|
void |
setLeftBorderColor(short color)
Set the color to use for the left border as a indexed color value
(将用于左边框的颜色设置为索引颜色值)
|
void |
setLeftBorderColor(XSSFColor color)
Set the color to use for the left border as a
XSSFColor value
(将用于左边框的颜色设置为 XSSFColor 值)
|
void |
setLocked(boolean locked)
Set the cell's using this style to be locked
(将使用此样式的单元格设置为锁定)
|
void |
setQuotePrefixed(boolean quotePrefix)
Turn on or off "Quote Prefix" or "123 Prefix" for the style, which is used to tell Excel that the thing which looks like a number or a formula shouldn't be treated as on.
(打开或关闭样式的“引用前缀”或“123 前缀”,用于告诉 Excel 不应将看起来像数字或公式的东西视为打开。)
|
void |
setReadingOrder(ReadingOrder order)
Set reading order for the cell
(设置单元格的阅读顺序)
|
void |
setRightBorderColor(short color)
Set the color to use for the right border
(设置用于右边框的颜色)
|
void |
setRightBorderColor(XSSFColor color)
Set the color to use for the right border as a
XSSFColor value
(将用于右边框的颜色设置为 XSSFColor 值)
|
void |
setRotation(short rotation)
Set the degree of rotation for the text in the cell
(设置单元格中文本的旋转度数)
|
void |
setShrinkToFit(boolean shrinkToFit)
Controls if the Cell should be auto-sized to shrink to fit if the text is too long
(如果文本太长,控制单元格是否应自动调整大小以缩小以适应)
|
void |
setTopBorderColor(short color)
Set the color to use for the top border
(设置用于上边框的颜色)
|
void |
setTopBorderColor(XSSFColor color)
Set the color to use for the top border as a
XSSFColor value
(将用于上边框的颜色设置为 XSSFColor 值)
|
void |
setVerticalAlignment(VerticalAlignment align)
Set the type of vertical alignment for the cell
(设置单元格的垂直对齐类型)
|
void |
setWrapText(boolean wrapped)
Set whether the text should be wrapped.
(设置文本是否应换行。)
|
void |
verifyBelongsToStylesSource(StylesTable src)
Verifies that this style belongs to the supplied Workbook Styles Source.
(验证此样式是否属于提供的工作簿样式源。)
|
public XSSFCellStyle(int cellXfId, int cellStyleXfId, StylesTable stylesSource, ThemesTable theme)
cellXfId
- The main XF for the cell. Must be a valid 0-based index into the XF table
(cellXfId - 单元格的主要 XF。必须是 XF 表中基于 0 的有效索引)
cellStyleXfId
- Optional, style xf. A value of
-1
means no xf.
(cellStyleXfId - 可选,样式 xf。值 -1 表示没有 xf。)
stylesSource
- Styles Source to work off
(stylesSource - 要处理的样式源)
public XSSFCellStyle(StylesTable stylesSource)
@Internal public org.openxmlformats.schemas.spreadsheetml.x2006.main.CTXf getCoreXf()
@Internal public org.openxmlformats.schemas.spreadsheetml.x2006.main.CTXf getStyleXf()
public void verifyBelongsToStylesSource(StylesTable src)
java.lang.IllegalArgumentException
- if there's a workbook mis-match
(java.lang.IllegalArgumentException - 如果工作簿不匹配)
public void cloneStyleFrom(CellStyle source)
cloneStyleFrom
in interface
CellStyle
(接口 CellStyle 中的 cloneStyleFrom)
public HorizontalAlignment getAlignment()
CellStyle
getAlignment
in interface
CellStyle
(接口 CellStyle 中的 getAlignment)
public BorderStyle getBorderBottom()
CellStyle
getBorderBottom
in interface
CellStyle
(接口 CellStyle 中的 getBorderBottom)
public BorderStyle getBorderLeft()
CellStyle
getBorderLeft
in interface
CellStyle
(接口 CellStyle 中的 getBorderLeft)
public BorderStyle getBorderRight()
CellStyle
getBorderRight
in interface
CellStyle
(接口 CellStyle 中的 getBorderRight)
public BorderStyle getBorderTop()
CellStyle
getBorderTop
in interface
CellStyle
(接口 CellStyle 中的 getBorderTop)
public short getBottomBorderColor()
getBottomBorderColor
in interface
CellStyle
(接口 CellStyle 中的 getBottomBorderColor)
IndexedColors.AUTOMATIC
(颜色定义的索引,默认值为 IndexedColors.AUTOMATIC)
IndexedColors
public XSSFColor getBottomBorderXSSFColor()
XSSFColor
(获取用于底部边框的颜色作为 XSSFColor)
null
if not set
(使用的颜色或 null 如果未设置)
public short getDataFormat()
getDataFormat
in interface
CellStyle
(接口 CellStyle 中的 getDataFormat)
DataFormat
public java.lang.String getDataFormatString()
getDataFormatString
in interface
CellStyle
(接口 CellStyle 中的 getDataFormatString)
public short getFillBackgroundColor()
Note - many cells are actually filled with a foreground fill, not a background fill - see getFillForegroundColor()
getFillBackgroundColor
in interface
CellStyle
(接口 CellStyle 中的 getFillBackgroundColor)
IndexedColors.AUTOMATIC
(填充颜色,默认值为 IndexedColors.AUTOMATIC)
IndexedColors
public XSSFColor getFillBackgroundColorColor()
CellStyle
getFillBackgroundColorColor
in interface
CellStyle
(接口 CellStyle 中的 getFillBackgroundColorColor)
public XSSFColor getFillBackgroundXSSFColor()
Note - many cells are actually filled with a foreground fill, not a background fill - see getFillForegroundColor()
null
if not set
(XSSFColor - 如果未设置,则填充颜色或 null)
XSSFColor.getRGB()
public short getFillForegroundColor()
Many cells are filled with this, instead of a background color (getFillBackgroundColor()
)
getFillForegroundColor
in interface
CellStyle
(接口 CellStyle 中的 getFillForegroundColor)
IndexedColors.AUTOMATIC
(填充颜色,默认值为 IndexedColors.AUTOMATIC)
IndexedColors
public XSSFColor getFillForegroundColorColor()
CellStyle
getFillForegroundColorColor
in interface
CellStyle
(接口 CellStyle 中的 getFillForegroundColorColor)
public XSSFColor getFillForegroundXSSFColor()
null
if not set
(XSSFColor - 如果未设置,则填充颜色或 null)
public FillPatternType getFillPattern()
CellStyle
getFillPattern
in interface
CellStyle
(接口 CellStyle 中的 getFillPattern)
FillPatternType.NO_FILL
(填充图案,默认值为 FillPatternType.NO_FILL)
public XSSFFont getFont()
public int getFontIndex()
getFontIndex
in interface
CellStyle
(接口 CellStyle 中的 getFontIndex)
XSSFWorkbook.getFontAt(int)
@Deprecated @Removal(version="6.0.0") public int getFontIndexAsInt()
getFontIndex()
instead
getFontIndexAsInt
in interface
CellStyle
(接口 CellStyle 中的 getFontIndexAsInt)
XSSFWorkbook.getFontAt(int)
public boolean getHidden()
public short getIndention()
getIndention
in interface
CellStyle
(接口 CellStyle 中的 getIndention)
public short getIndex()
protected int getUIndex()
public short getLeftBorderColor()
getLeftBorderColor
in interface
CellStyle
(接口 CellStyle 中的 getLeftBorderColor)
IndexedColors.BLACK
(颜色定义的索引,默认值为 IndexedColors.BLACK)
IndexedColors
public XSSFColor getLeftBorderXSSFColor()
null
if not set
(颜色定义的索引,如果未设置,则为 null)
IndexedColors
public boolean getLocked()
public boolean getQuotePrefixed()
getQuotePrefixed
in interface
CellStyle
(接口 CellStyle 中的 getQuotePrefixed)
public short getRightBorderColor()
getRightBorderColor
in interface
CellStyle
(接口 CellStyle 中的 getRightBorderColor)
IndexedColors.BLACK
(颜色定义的索引,默认值为 IndexedColors.BLACK)
IndexedColors
public XSSFColor getRightBorderXSSFColor()
null
if not set
(使用的颜色或 null 如果未设置)
public short getRotation()
Expressed in degrees. Values range from 0 to 180. The first letter of the text is considered the center-point of the arc.
For 0 - 90, the value represents degrees above horizon. For 91-180 the degrees below the horizon is calculated as:
[degrees below horizon] = 90 - textRotation.
getRotation
in interface
CellStyle
(接口 CellStyle 中的 getRotation)
public boolean getShrinkToFit()
CellStyle
getShrinkToFit
in interface
CellStyle
(接口 CellStyle 中的 getShrinkToFit)
public short getTopBorderColor()
getTopBorderColor
in interface
CellStyle
(接口 CellStyle 中的 getTopBorderColor)
IndexedColors.BLACK
(颜色定义的索引,默认值为 IndexedColors.BLACK)
IndexedColors
public XSSFColor getTopBorderXSSFColor()
null
if not set
(使用的颜色或 null 如果未设置)
public VerticalAlignment getVerticalAlignment()
CellStyle
getVerticalAlignment
in interface
CellStyle
(接口 CellStyle 中的 getVerticalAlignment)
public boolean getWrapText()
getWrapText
in interface
CellStyle
(接口 CellStyle 中的 getWrapText)
public void setAlignment(HorizontalAlignment align)
setAlignment
in interface
CellStyle
(接口 CellStyle 中的 setAlignment)
align
- - the type of alignment
(align - - 对齐类型)
public void setBorderBottom(BorderStyle border)
setBorderBottom
in interface
CellStyle
(接口 CellStyle 中的 setBorderBottom)
border
- - type of border to use
(border - 要使用的边框类型)
BorderStyle
public void setBorderLeft(BorderStyle border)
setBorderLeft
in interface
CellStyle
(接口 CellStyle 中的 setBorderLeft)
border
- the type of border to use
(边框 - 要使用的边框类型)
public void setBorderRight(BorderStyle border)
setBorderRight
in interface
CellStyle
(接口 CellStyle 中的 setBorderRight)
border
- the type of border to use
(边框 - 要使用的边框类型)
public void setBorderTop(BorderStyle border)
setBorderTop
in interface
CellStyle
(接口 CellStyle 中的 setBorderTop)
border
- the type of border to use
(边框 - 要使用的边框类型)
public void setBottomBorderColor(short color)
setBottomBorderColor
in interface
CellStyle
(接口 CellStyle 中的 setBottomBorderColor)
color
- the index of the color definition
(color - 颜色定义的索引)
IndexedColors
public void setBottomBorderColor(XSSFColor color)
color
- the color to use, null means no color
(color - 要使用的颜色,null 表示没有颜色)
public void setDataFormat(short fmt)
setDataFormat
in interface
CellStyle
(接口 CellStyle 中的 setDataFormat)
fmt
- the index of a data format
(fmt - 数据格式的索引)
DataFormat
public void setDataFormat(int fmt)
fmt
- the index of a data format
(fmt - 数据格式的索引)
public void setFillBackgroundColor(XSSFColor color)
XSSFColor
value.
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 background
cs.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. (设置表示为 XSSFColor 值的背景填充颜色。例如:cs.setFillPattern(XSSFCellStyle.FINE_DOTS); cs.setFillBackgroundXSSFColor(new XSSFColor(java.awt.Color.RED));可以选择应用前景和背景填充:注意:确保在背景之前设置前景色 cs.setFillPattern(XSSFCellStyle.FINE_DOTS); cs.setFillForegroundColor(new XSSFColor(java.awt.Color.BLUE)); cs.setFillBackgroundColor(new XSSFColor(java.awt.Color.GREEN));或者,对于 SOLID_FILL 的特殊情况: cs.setFillPattern(XSSFCellStyle.SOLID_FOREGROUND ); cs.setFillForegroundColor(new XSSFColor(java.awt.Color.GREEN));必须设置填充样式才能在单元格中显示颜色。)
color
- - the color to use
(color - - 要使用的颜色)
public void setFillBackgroundColor(short bg)
For example:
cs.setFillPattern(XSSFCellStyle.FINE_DOTS ); cs.setFillBackgroundXSSFColor(IndexedColors.RED.getIndex());optionally a Foreground and background fill can be applied: Note: Ensure Foreground color is set prior to background
cs.setFillPattern(XSSFCellStyle.FINE_DOTS ); cs.setFillForegroundColor(IndexedColors.BLUE.getIndex()); cs.setFillBackgroundColor(IndexedColors.RED.getIndex());or, for the special case of SOLID_FILL:
cs.setFillPattern(XSSFCellStyle.SOLID_FOREGROUND ); cs.setFillForegroundColor(IndexedColors.RED.getIndex());It is necessary to set the fill style in order for the color to be shown in the cell. (设置表示为索引颜色值的背景填充颜色。例如:cs.setFillPattern(XSSFCellStyle.FINE_DOTS); cs.setFillBackgroundXSSFColor(IndexedColors.RED.getIndex());可以选择应用前景和背景填充:注意:确保在背景之前设置前景色 cs.setFillPattern(XSSFCellStyle.FINE_DOTS); cs.setFillForegroundColor(IndexedColors.BLUE.getIndex()); cs.setFillBackgroundColor(IndexedColors.RED.getIndex());或者,对于 SOLID_FILL 的特殊情况: cs.setFillPattern(XSSFCellStyle.SOLID_FOREGROUND ); cs.setFillForegroundColor(IndexedColors.RED.getIndex());必须设置填充样式才能在单元格中显示颜色。)
setFillBackgroundColor
in interface
CellStyle
(接口 CellStyle 中的 setFillBackgroundColor)
bg
- - the color to use
(bg - - 要使用的颜色)
IndexedColors
public void setFillForegroundColor(XSSFColor color)
XSSFColor
value.
color
- the color to use
(color - 要使用的颜色)
)
public void setFillForegroundColor(short fg)
setFillForegroundColor
in interface
CellStyle
(接口 CellStyle 中的 setFillForegroundColor)
fg
- the color to use
(fg - 要使用的颜色)
IndexedColors
public void setReadingOrder(ReadingOrder order)
order
- - the reading order
(order - - 阅读顺序)
public ReadingOrder getReadingOrder()
public void setFillPattern(FillPatternType pattern)
setFillPattern
in interface
CellStyle
(接口 CellStyle 中的 setFillPattern)
pattern
- the fill pattern to use
(pattern - 要使用的填充图案)
setFillBackgroundColor(XSSFColor)
,
setFillForegroundColor(XSSFColor)
,
FillPatternType
public void setFont(Font font)
setFont
in interface
CellStyle
(接口 CellStyle 中的 setFont)
font
- a font object created or retrieved from the XSSFWorkbook object
(font - 从 XSSFWorkbook 对象创建或检索的字体对象)
XSSFWorkbook.createFont()
,
XSSFWorkbook.getFontAt(int)
public void setHidden(boolean hidden)
public void setIndention(short indent)
setIndention
in interface
CellStyle
(接口 CellStyle 中的 setIndention)
indent
- - number of spaces
(缩进 - - 空格数)
public void setLeftBorderColor(short color)
setLeftBorderColor
in interface
CellStyle
(接口 CellStyle 中的 setLeftBorderColor)
color
- the index of the color definition
(color - 颜色定义的索引)
IndexedColors
public void setLeftBorderColor(XSSFColor color)
XSSFColor
value
(将用于左边框的颜色设置为 XSSFColor 值)
color
- the color to use
(color - 要使用的颜色)
public void setLocked(boolean locked)
public void setQuotePrefixed(boolean quotePrefix)
setQuotePrefixed
in interface
CellStyle
(接口 CellStyle 中的 setQuotePrefixed)
public void setRightBorderColor(short color)
setRightBorderColor
in interface
CellStyle
(接口 CellStyle 中的 setRightBorderColor)
color
- the index of the color definition
(color - 颜色定义的索引)
IndexedColors
public void setRightBorderColor(XSSFColor color)
XSSFColor
value
(将用于右边框的颜色设置为 XSSFColor 值)
color
- the color to use
(color - 要使用的颜色)
public void setRotation(short rotation)
Expressed in degrees. Values range from 0 to 180. The first letter of the text is considered the center-point of the arc.
For 0 - 90, the value represents degrees above horizon. For 91-180 the degrees below the horizon is calculated as:
[degrees below horizon] = 90 - textRotation.
setRotation
in interface
CellStyle
(界面 CellStyle 中的 setRotation)
rotation
- - the rotation degrees (between 0 and 180 degrees)
(rotation - - 旋转度数(0 到 180 度之间))
public void setTopBorderColor(short color)
setTopBorderColor
in interface
CellStyle
(接口 CellStyle 中的 setTopBorderColor)
color
- the index of the color definition
(color - 颜色定义的索引)
IndexedColors
public void setTopBorderColor(XSSFColor color)
XSSFColor
value
(将用于上边框的颜色设置为 XSSFColor 值)
color
- the color to use
(color - 要使用的颜色)
public void setVerticalAlignment(VerticalAlignment align)
setVerticalAlignment
in interface
CellStyle
(接口 CellStyle 中的 setVerticalAlignment)
align
- - the type of alignment
(align - - 对齐类型)
public void setWrapText(boolean wrapped)
Setting this flag to true
make all content visible within a cell by displaying it on multiple lines
setWrapText
in interface
CellStyle
(接口 CellStyle 中的 setWrapText)
wrapped
- a boolean value indicating if the text in a cell should be line-wrapped within the cell.
(Wrapped - 一个布尔值,指示单元格中的文本是否应在单元格内换行。)
public XSSFColor getBorderColor(XSSFCellBorder.BorderSide side)
side
- the border side
(side - 边界边)
public void setBorderColor(XSSFCellBorder.BorderSide side, XSSFColor color)
side
- - where to apply the color definition
(side - - 应用颜色定义的位置)
color
- - the color to use
(color - - 要使用的颜色)
public void setShrinkToFit(boolean shrinkToFit)
CellStyle
setShrinkToFit
in interface
CellStyle
(接口 CellStyle 中的 setShrinkToFit)
protected XSSFCellAlignment getCellAlignment()
public int hashCode()
hashCode
in class
java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class
java.lang.Object
o
- the style to check
(o - 要检查的样式)
public XSSFCellStyle copy()
copy
in interface
Duplicatable
(复制到界面 Duplicatable)
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.