类 AbstractStyleRender

java.lang.Object
cn.toutatis.xvoid.axolotl.excel.writer.style.AbstractStyleRender
所有已实现的接口:
ExcelStyleRender
直接已知子类:
AxolotlAdministrationRedTheme, AxolotlClassicalTheme, AxolotlHazeBlueTheme, AxolotlIndustrialOrangeTheme, SimpleBlackTheme

public abstract class AbstractStyleRender extends Object implements ExcelStyleRender
样式渲染器抽象类 继承此抽象类可以获取环境变量实现自定义样式渲染
作者:
Toutatis_Gc
  • 字段详细资料

  • 构造器详细资料

    • AbstractStyleRender

      public AbstractStyleRender(org.slf4j.Logger LOGGER)
  • 方法详细资料

    • globalFontName

      public String globalFontName()
    • setGlobalFontName

      public void setGlobalFontName(String globalFontName)
    • isFirstBatch

      public boolean isFirstBatch()
      是否是第一批次数据
      返回:
      true/false
    • checkedAndUseCustomTheme

      public void checkedAndUseCustomTheme(String themeFont, AxolotlColor themeColor)
      检查并使用自定义字体 如果自定义字体不为空,则使用自定义字体,否则使用默认主题字体
      参数:
      themeFont - 主题字体
    • init

      public AxolotlWriteResult init(org.apache.poi.xssf.streaming.SXSSFSheet sheet)
      从接口复制的说明: ExcelStyleRender
      初始化。 多次写入时,该方法只会被调用一次。 可以用于创建全局样式等。
      指定者:
      init 在接口中 ExcelStyleRender
      参数:
      sheet - SXSSFSheet 表示工作表对象,用于设置表头样式。
    • fillWhiteCell

      public void fillWhiteCell(org.apache.poi.ss.usermodel.Sheet sheet, String fontName)
      填充空白单元格
      参数:
      sheet - 工作表
      fontName - 字体名称
    • createTitleRow

      public AxolotlWriteResult createTitleRow(org.apache.poi.xssf.streaming.SXSSFSheet sheet)
      Part.1 表头 Step.1 创建标题行
      参数:
      sheet - 工作表
      返回:
      渲染结果
    • mergeTitleRegion

      public void mergeTitleRegion(org.apache.poi.xssf.streaming.SXSSFSheet sheet, int titleColumnCount, org.apache.poi.ss.usermodel.CellStyle titleStyle)
      Part.1 表头 Step.3 合并标题栏单元格并赋予样式
      参数:
      sheet - 工作表
    • defaultRenderHeaders

      public AxolotlWriteResult defaultRenderHeaders(org.apache.poi.xssf.streaming.SXSSFSheet sheet, org.apache.poi.ss.usermodel.CellStyle headerDefaultCellStyle)
      Part.1 表头 Step.2 递归表头
      参数:
      sheet - 工作表
      headerDefaultCellStyle - 表头默认样式
    • getCellStyle

      public org.apache.poi.ss.usermodel.CellStyle getCellStyle(Header header, org.apache.poi.ss.usermodel.CellStyle usedCellStyle)
      Part.1 表头 辅助方法 获取表头Header样式
      参数:
      header - 表头
      usedCellStyle - 使用样式
      返回:
      表头样式
    • defaultRenderNextData

      public void defaultRenderNextData(org.apache.poi.xssf.streaming.SXSSFSheet sheet, Object data, org.apache.poi.ss.usermodel.CellStyle rowStyle)
      默认行为渲染数据
      参数:
      sheet - 工作表
    • renderColumn

      public void renderColumn(AbstractStyleRender.FieldInfo fieldInfo, org.apache.poi.ss.usermodel.Cell cell)
      渲染列数据
      参数:
      fieldInfo - 字段信息
      cell - 单元格
    • calculateColumns

      public void calculateColumns(AbstractStyleRender.FieldInfo fieldInfo)
      计算列合计
      参数:
      fieldInfo - 字段信息
    • finish

      public AxolotlWriteResult finish(org.apache.poi.xssf.streaming.SXSSFSheet sheet)
      从接口复制的说明: ExcelStyleRender
      在渲染完成后,调用该方法。 在Close()方法中调用。
      指定者:
      finish 在接口中 ExcelStyleRender
    • createFont

      public org.apache.poi.ss.usermodel.Font createFont(String fontName, short fontSize, boolean isBold, org.apache.poi.ss.usermodel.IndexedColors color)
      创建字体
      参数:
      fontName - 字体名称
      fontSize - 字体大小
      isBold - 是否加粗
      color - 颜色
      返回:
      字体
    • createFont

      public org.apache.poi.ss.usermodel.Font createFont(String fontName, short fontSize, boolean isBold, AxolotlColor color)
      创建字体
      参数:
      fontName - 字体名称
      fontSize - 字体大小
      isBold - 是否加粗
      color - 颜色
      返回:
      字体
    • createMainTextFont

      public org.apache.poi.ss.usermodel.Font createMainTextFont(short fontSize, AxolotlColor color)
    • createMainTextFont

      public org.apache.poi.ss.usermodel.Font createMainTextFont(AxolotlColor color)
    • createMainTextFont

      public org.apache.poi.ss.usermodel.Font createMainTextFont(short fontSize, org.apache.poi.ss.usermodel.IndexedColors color)
    • createMainTextFont

      public org.apache.poi.ss.usermodel.Font createMainTextFont(org.apache.poi.ss.usermodel.IndexedColors color)
    • createBlackMainTextFont

      public org.apache.poi.ss.usermodel.Font createBlackMainTextFont()
    • createWhiteMainTextFont

      public org.apache.poi.ss.usermodel.Font createWhiteMainTextFont()
    • createRedMainTextFont

      public org.apache.poi.ss.usermodel.Font createRedMainTextFont()
    • createBlackMainTextCellStyle

      public org.apache.poi.ss.usermodel.CellStyle createBlackMainTextCellStyle(org.apache.poi.ss.usermodel.IndexedColors borderColor, AxolotlColor cellColor)
    • createBlackMainTextCellStyle

      public org.apache.poi.ss.usermodel.CellStyle createBlackMainTextCellStyle(org.apache.poi.ss.usermodel.BorderStyle borderStyle, org.apache.poi.ss.usermodel.IndexedColors borderColor, AxolotlColor cellColor)
    • createStyle

      public org.apache.poi.ss.usermodel.CellStyle createStyle(org.apache.poi.ss.usermodel.BorderStyle borderStyle, org.apache.poi.ss.usermodel.IndexedColors borderColor, AxolotlColor cellColor, org.apache.poi.ss.usermodel.Font font)
    • createStyle

      public org.apache.poi.ss.usermodel.CellStyle createStyle(org.apache.poi.ss.usermodel.BorderStyle borderStyle, org.apache.poi.ss.usermodel.IndexedColors borderColor, AxolotlColor cellColor, String fontName, short fontSize, boolean isBold, Object fontColor)