Class OdsCellStyle

java.lang.Object
org.spdx.spreadsheetstore.ods.OdsCellStyle
All Implemented Interfaces:
org.apache.poi.ss.usermodel.CellStyle

public class OdsCellStyle extends Object implements org.apache.poi.ss.usermodel.CellStyle
Adapter for Apache POI CellStyle over the SODS Style. Manages borders, fonts, alignments, and backgrounds mapping for ODS cells.
  • Constructor Details

    • OdsCellStyle

      public OdsCellStyle(OdsWorkbook workbook)
      Creates an ODS cell style adapter.
      Parameters:
      workbook - Parent ODS workbook.
  • Method Details

    • setAlignment

      public void setAlignment(org.apache.poi.ss.usermodel.HorizontalAlignment align)
      Specified by:
      setAlignment in interface org.apache.poi.ss.usermodel.CellStyle
    • getAlignment

      public org.apache.poi.ss.usermodel.HorizontalAlignment getAlignment()
      Specified by:
      getAlignment in interface org.apache.poi.ss.usermodel.CellStyle
    • setVerticalAlignment

      public void setVerticalAlignment(org.apache.poi.ss.usermodel.VerticalAlignment align)
      Specified by:
      setVerticalAlignment in interface org.apache.poi.ss.usermodel.CellStyle
    • getVerticalAlignment

      public org.apache.poi.ss.usermodel.VerticalAlignment getVerticalAlignment()
      Specified by:
      getVerticalAlignment in interface org.apache.poi.ss.usermodel.CellStyle
    • setBorderBottom

      public void setBorderBottom(org.apache.poi.ss.usermodel.BorderStyle border)
      Specified by:
      setBorderBottom in interface org.apache.poi.ss.usermodel.CellStyle
    • getBorderBottom

      public org.apache.poi.ss.usermodel.BorderStyle getBorderBottom()
      Specified by:
      getBorderBottom in interface org.apache.poi.ss.usermodel.CellStyle
    • setBorderLeft

      public void setBorderLeft(org.apache.poi.ss.usermodel.BorderStyle border)
      Specified by:
      setBorderLeft in interface org.apache.poi.ss.usermodel.CellStyle
    • getBorderLeft

      public org.apache.poi.ss.usermodel.BorderStyle getBorderLeft()
      Specified by:
      getBorderLeft in interface org.apache.poi.ss.usermodel.CellStyle
    • setBorderRight

      public void setBorderRight(org.apache.poi.ss.usermodel.BorderStyle border)
      Specified by:
      setBorderRight in interface org.apache.poi.ss.usermodel.CellStyle
    • getBorderRight

      public org.apache.poi.ss.usermodel.BorderStyle getBorderRight()
      Specified by:
      getBorderRight in interface org.apache.poi.ss.usermodel.CellStyle
    • setBorderTop

      public void setBorderTop(org.apache.poi.ss.usermodel.BorderStyle border)
      Specified by:
      setBorderTop in interface org.apache.poi.ss.usermodel.CellStyle
    • getBorderTop

      public org.apache.poi.ss.usermodel.BorderStyle getBorderTop()
      Specified by:
      getBorderTop in interface org.apache.poi.ss.usermodel.CellStyle
    • setFillForegroundColor

      public void setFillForegroundColor(short bg)
      Specified by:
      setFillForegroundColor in interface org.apache.poi.ss.usermodel.CellStyle
    • getFillForegroundColor

      public short getFillForegroundColor()
      Specified by:
      getFillForegroundColor in interface org.apache.poi.ss.usermodel.CellStyle
    • setFillPattern

      public void setFillPattern(org.apache.poi.ss.usermodel.FillPatternType fp)
      Specified by:
      setFillPattern in interface org.apache.poi.ss.usermodel.CellStyle
    • getFillPattern

      public org.apache.poi.ss.usermodel.FillPatternType getFillPattern()
      Specified by:
      getFillPattern in interface org.apache.poi.ss.usermodel.CellStyle
    • setFont

      public void setFont(org.apache.poi.ss.usermodel.Font font)
      Specified by:
      setFont in interface org.apache.poi.ss.usermodel.CellStyle
    • setDataFormat

      public void setDataFormat(short fmt)
      Sets the data format for the cell.

      Due to limitations in the underlying SODS library, exact POI data format patterns are not fully supported. If the provided format index corresponds to a recognized Date format, it will be mapped to the ISO date style ("YYYY-MM-DD") to ensure dates are properly displayed. Other formats are currently stored but may not affect the final ODS cell rendering.

      This is display-only: the full HH:mm:ss timestamp is still stored in office:date-value and returned unchanged by Cell.getDateCellValue(), even though time-inclusive formats render as date-only in spreadsheet applications.

      Specified by:
      setDataFormat in interface org.apache.poi.ss.usermodel.CellStyle
      Parameters:
      fmt - the data format index
    • getDataFormat

      public short getDataFormat()
      Specified by:
      getDataFormat in interface org.apache.poi.ss.usermodel.CellStyle
    • setWrapText

      public void setWrapText(boolean wrapped)
      Specified by:
      setWrapText in interface org.apache.poi.ss.usermodel.CellStyle
    • getWrapText

      public boolean getWrapText()
      Specified by:
      getWrapText in interface org.apache.poi.ss.usermodel.CellStyle
    • getFontIndex

      public int getFontIndex()
      Specified by:
      getFontIndex in interface org.apache.poi.ss.usermodel.CellStyle
    • getFontIndexAsInt

      public int getFontIndexAsInt()
      Specified by:
      getFontIndexAsInt in interface org.apache.poi.ss.usermodel.CellStyle
    • getIndex

      public short getIndex()
      Specified by:
      getIndex in interface org.apache.poi.ss.usermodel.CellStyle
    • cloneStyleFrom

      public void cloneStyleFrom(org.apache.poi.ss.usermodel.CellStyle source)
      Specified by:
      cloneStyleFrom in interface org.apache.poi.ss.usermodel.CellStyle
    • setBottomBorderColor

      public void setBottomBorderColor(short color)
      Specified by:
      setBottomBorderColor in interface org.apache.poi.ss.usermodel.CellStyle
    • getBottomBorderColor

      public short getBottomBorderColor()
      Specified by:
      getBottomBorderColor in interface org.apache.poi.ss.usermodel.CellStyle
    • setLeftBorderColor

      public void setLeftBorderColor(short color)
      Specified by:
      setLeftBorderColor in interface org.apache.poi.ss.usermodel.CellStyle
    • getLeftBorderColor

      public short getLeftBorderColor()
      Specified by:
      getLeftBorderColor in interface org.apache.poi.ss.usermodel.CellStyle
    • setRightBorderColor

      public void setRightBorderColor(short color)
      Specified by:
      setRightBorderColor in interface org.apache.poi.ss.usermodel.CellStyle
    • getRightBorderColor

      public short getRightBorderColor()
      Specified by:
      getRightBorderColor in interface org.apache.poi.ss.usermodel.CellStyle
    • setTopBorderColor

      public void setTopBorderColor(short color)
      Specified by:
      setTopBorderColor in interface org.apache.poi.ss.usermodel.CellStyle
    • getTopBorderColor

      public short getTopBorderColor()
      Specified by:
      getTopBorderColor in interface org.apache.poi.ss.usermodel.CellStyle
    • setFillBackgroundColor

      public void setFillBackgroundColor(short bg)
      Specified by:
      setFillBackgroundColor in interface org.apache.poi.ss.usermodel.CellStyle
    • getFillBackgroundColor

      public short getFillBackgroundColor()
      Specified by:
      getFillBackgroundColor in interface org.apache.poi.ss.usermodel.CellStyle
    • setHidden

      public void setHidden(boolean hidden)
      Specified by:
      setHidden in interface org.apache.poi.ss.usermodel.CellStyle
    • getHidden

      public boolean getHidden()
      Specified by:
      getHidden in interface org.apache.poi.ss.usermodel.CellStyle
    • setLocked

      public void setLocked(boolean locked)
      Specified by:
      setLocked in interface org.apache.poi.ss.usermodel.CellStyle
    • getLocked

      public boolean getLocked()
      Specified by:
      getLocked in interface org.apache.poi.ss.usermodel.CellStyle
    • setQuotePrefixed

      public void setQuotePrefixed(boolean quotePrefix)
      Specified by:
      setQuotePrefixed in interface org.apache.poi.ss.usermodel.CellStyle
    • getQuotePrefixed

      public boolean getQuotePrefixed()
      Specified by:
      getQuotePrefixed in interface org.apache.poi.ss.usermodel.CellStyle
    • setIndention

      public void setIndention(short indent)
      Specified by:
      setIndention in interface org.apache.poi.ss.usermodel.CellStyle
    • getIndention

      public short getIndention()
      Specified by:
      getIndention in interface org.apache.poi.ss.usermodel.CellStyle
    • setRotation

      public void setRotation(short rotation)
      Specified by:
      setRotation in interface org.apache.poi.ss.usermodel.CellStyle
    • getRotation

      public short getRotation()
      Specified by:
      getRotation in interface org.apache.poi.ss.usermodel.CellStyle
    • getDataFormatString

      public String getDataFormatString()
      Specified by:
      getDataFormatString in interface org.apache.poi.ss.usermodel.CellStyle
    • setShrinkToFit

      public void setShrinkToFit(boolean shrinkToFit)
      Specified by:
      setShrinkToFit in interface org.apache.poi.ss.usermodel.CellStyle
    • getShrinkToFit

      public boolean getShrinkToFit()
      Specified by:
      getShrinkToFit in interface org.apache.poi.ss.usermodel.CellStyle
    • invalidateCachedProperties

      public void invalidateCachedProperties()
      Specified by:
      invalidateCachedProperties in interface org.apache.poi.ss.usermodel.CellStyle
    • getFormatProperties

      public EnumMap<org.apache.poi.ss.usermodel.CellPropertyType,Object> getFormatProperties()
      Specified by:
      getFormatProperties in interface org.apache.poi.ss.usermodel.CellStyle
    • getFillForegroundColorColor

      public org.apache.poi.ss.usermodel.Color getFillForegroundColorColor()
      Specified by:
      getFillForegroundColorColor in interface org.apache.poi.ss.usermodel.CellStyle
    • getFillBackgroundColorColor

      public org.apache.poi.ss.usermodel.Color getFillBackgroundColorColor()
      Specified by:
      getFillBackgroundColorColor in interface org.apache.poi.ss.usermodel.CellStyle
    • setFillForegroundColor

      public void setFillForegroundColor(org.apache.poi.ss.usermodel.Color color)
      Specified by:
      setFillForegroundColor in interface org.apache.poi.ss.usermodel.CellStyle
    • setFillBackgroundColor

      public void setFillBackgroundColor(org.apache.poi.ss.usermodel.Color color)
      Specified by:
      setFillBackgroundColor in interface org.apache.poi.ss.usermodel.CellStyle