Class CellBorderStyle
java.lang.Object
org.miaixz.bus.office.excel.style.CellBorderStyle
- All Implemented Interfaces:
Serializable
单元格边框样式和颜色封装,边框按照“上右下左”的顺序定义,与CSS一致
- Since:
- Java 17+
- Author:
- Kimi Liu
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription获取底边框的颜色org.apache.poi.ss.usermodel.BorderStyle获取底边框的样式获取左边框的颜色org.apache.poi.ss.usermodel.BorderStyle获取左边框的样式获取右边框的颜色org.apache.poi.ss.usermodel.BorderStyle获取右边框的样式。获取上边框的颜色org.apache.poi.ss.usermodel.BorderStyle获取上边框的样式static CellBorderStyleof(org.apache.poi.ss.usermodel.BorderStyle borderStyle, org.apache.poi.ss.usermodel.IndexedColors colorIndex) 创建单元格边框样式对象,四边框样式保持一致。static CellBorderStyleof(org.apache.poi.ss.usermodel.CellStyle cellStyle) 根据CellStyle创建单元格边框样式对象。setBottomColor(Short bottomColor) 设置底边框的颜色setBottomStyle(org.apache.poi.ss.usermodel.BorderStyle bottomStyle) 设置底边框的样式setLeftColor(Short leftColor) 设置左边框的颜色setLeftStyle(org.apache.poi.ss.usermodel.BorderStyle leftStyle) 设置左边框的样式setRightColor(Short rightColor) 设置右边框的颜色setRightStyle(org.apache.poi.ss.usermodel.BorderStyle rightStyle) 设置右边框的样式org.apache.poi.ss.usermodel.CellStylesetTo(org.apache.poi.ss.usermodel.CellStyle cellStyle) 将边框样式和颜色设置到CellStyle中setTopColor(Short topColor) 设置上边框的颜色setTopStyle(org.apache.poi.ss.usermodel.BorderStyle topStyle) 设置上边框的样式
-
Constructor Details
-
CellBorderStyle
public CellBorderStyle()
-
-
Method Details
-
of
根据CellStyle创建单元格边框样式对象。- Parameters:
cellStyle- 单元格样式- Returns:
- CellBorderStyle
-
of
public static CellBorderStyle of(org.apache.poi.ss.usermodel.BorderStyle borderStyle, org.apache.poi.ss.usermodel.IndexedColors colorIndex) 创建单元格边框样式对象,四边框样式保持一致。- Parameters:
borderStyle- 边框样式colorIndex- 颜色- Returns:
- 单元格边框样式对象
-
getTopStyle
public org.apache.poi.ss.usermodel.BorderStyle getTopStyle()获取上边框的样式- Returns:
- 上边框的样式
-
setTopStyle
设置上边框的样式- Parameters:
topStyle- 上边框的样式- Returns:
- 当前的单元格边框样式对象,支持链式调用。
-
getTopColor
获取上边框的颜色- Returns:
- 上边框的颜色
-
setTopColor
设置上边框的颜色- Parameters:
topColor- 上边框的颜色- Returns:
- 当前的单元格边框样式对象,支持链式调用。
-
getRightStyle
public org.apache.poi.ss.usermodel.BorderStyle getRightStyle()获取右边框的样式。- Returns:
- 右边框的样式。
-
setRightStyle
设置右边框的样式- Parameters:
rightStyle- 右边框的样式- Returns:
- 当前的单元格边框样式对象,支持链式调用。
-
getRightColor
获取右边框的颜色- Returns:
- 右边框的颜色
-
setRightColor
设置右边框的颜色- Parameters:
rightColor- 右边框的颜色- Returns:
- 当前的单元格边框样式对象,支持链式调用。
-
getBottomStyle
public org.apache.poi.ss.usermodel.BorderStyle getBottomStyle()获取底边框的样式- Returns:
- 底边框的样式
-
setBottomStyle
设置底边框的样式- Parameters:
bottomStyle- 底边框的样式- Returns:
- 当前的单元格边框样式对象,支持链式调用。
-
getBottomColor
获取底边框的颜色- Returns:
- 底边框的颜色
-
setBottomColor
设置底边框的颜色- Parameters:
bottomColor- 底边框的颜色- Returns:
- 当前的单元格边框样式对象,支持链式调用
-
getLeftStyle
public org.apache.poi.ss.usermodel.BorderStyle getLeftStyle()获取左边框的样式- Returns:
- 左边框的样式
-
setLeftStyle
设置左边框的样式- Parameters:
leftStyle- 左边框的样式- Returns:
- 当前的单元格边框样式对象,支持链式调用
-
getLeftColor
获取左边框的颜色- Returns:
- 左边框的颜色
-
setLeftColor
设置左边框的颜色- Parameters:
leftColor- 左边框的颜色- Returns:
- 当前的单元格边框样式对象,支持链式调用
-
setTo
public org.apache.poi.ss.usermodel.CellStyle setTo(org.apache.poi.ss.usermodel.CellStyle cellStyle) 将边框样式和颜色设置到CellStyle中- Parameters:
cellStyle-CellStyle- Returns:
CellStyle
-