Class CellBorderStyle

java.lang.Object
org.miaixz.bus.office.excel.style.CellBorderStyle
All Implemented Interfaces:
Serializable

public class CellBorderStyle extends Object implements Serializable
单元格边框样式和颜色封装,边框按照“上右下左”的顺序定义,与CSS一致
Since:
Java 17+
Author:
Kimi Liu
See Also:
  • Constructor Details

    • CellBorderStyle

      public CellBorderStyle()
  • Method Details

    • of

      public static CellBorderStyle of(org.apache.poi.ss.usermodel.CellStyle cellStyle)
      根据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

      public CellBorderStyle setTopStyle(org.apache.poi.ss.usermodel.BorderStyle topStyle)
      设置上边框的样式
      Parameters:
      topStyle - 上边框的样式
      Returns:
      当前的单元格边框样式对象,支持链式调用。
    • getTopColor

      public Short getTopColor()
      获取上边框的颜色
      Returns:
      上边框的颜色
    • setTopColor

      public CellBorderStyle setTopColor(Short topColor)
      设置上边框的颜色
      Parameters:
      topColor - 上边框的颜色
      Returns:
      当前的单元格边框样式对象,支持链式调用。
    • getRightStyle

      public org.apache.poi.ss.usermodel.BorderStyle getRightStyle()
      获取右边框的样式。
      Returns:
      右边框的样式。
    • setRightStyle

      public CellBorderStyle setRightStyle(org.apache.poi.ss.usermodel.BorderStyle rightStyle)
      设置右边框的样式
      Parameters:
      rightStyle - 右边框的样式
      Returns:
      当前的单元格边框样式对象,支持链式调用。
    • getRightColor

      public Short getRightColor()
      获取右边框的颜色
      Returns:
      右边框的颜色
    • setRightColor

      public CellBorderStyle setRightColor(Short rightColor)
      设置右边框的颜色
      Parameters:
      rightColor - 右边框的颜色
      Returns:
      当前的单元格边框样式对象,支持链式调用。
    • getBottomStyle

      public org.apache.poi.ss.usermodel.BorderStyle getBottomStyle()
      获取底边框的样式
      Returns:
      底边框的样式
    • setBottomStyle

      public CellBorderStyle setBottomStyle(org.apache.poi.ss.usermodel.BorderStyle bottomStyle)
      设置底边框的样式
      Parameters:
      bottomStyle - 底边框的样式
      Returns:
      当前的单元格边框样式对象,支持链式调用。
    • getBottomColor

      public Short getBottomColor()
      获取底边框的颜色
      Returns:
      底边框的颜色
    • setBottomColor

      public CellBorderStyle setBottomColor(Short bottomColor)
      设置底边框的颜色
      Parameters:
      bottomColor - 底边框的颜色
      Returns:
      当前的单元格边框样式对象,支持链式调用
    • getLeftStyle

      public org.apache.poi.ss.usermodel.BorderStyle getLeftStyle()
      获取左边框的样式
      Returns:
      左边框的样式
    • setLeftStyle

      public CellBorderStyle setLeftStyle(org.apache.poi.ss.usermodel.BorderStyle leftStyle)
      设置左边框的样式
      Parameters:
      leftStyle - 左边框的样式
      Returns:
      当前的单元格边框样式对象,支持链式调用
    • getLeftColor

      public Short getLeftColor()
      获取左边框的颜色
      Returns:
      左边框的颜色
    • setLeftColor

      public CellBorderStyle setLeftColor(Short leftColor)
      设置左边框的颜色
      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