Class XSSFDxfCellStyle

    • Constructor Detail

      • XSSFDxfCellStyle

        public XSSFDxfCellStyle​(StylesTable stylesSource,
                                ThemesTable theme)
        Creates an empty Cell Style with theme
        Since:
        3.8.2
    • Method Detail

      • setIndex

        public void setIndex​(int dxfId)
      • getDxf

        public org.openxmlformats.schemas.spreadsheetml.x2006.main.CTDxf getDxf()
      • getIndex

        public short getIndex()
        Description copied from interface: CellStyle
        get the index within the Workbook (sequence within the collection of ExtendedFormat objects)
        Specified by:
        getIndex in interface CellStyle
        Overrides:
        getIndex in class XSSFCellStyle
        Returns:
        unique index number of the underlying record this style represents (probably you don't care unless you're comparing which one is which)
      • getRawDataFormatString

        public java.lang.String getRawDataFormatString()
      • getOrCreateFont

        public XSSFFont getOrCreateFont()
        Gets or create the font for this style
        Returns:
        XSSFFont - font
      • setHidden

        public void setHidden​(boolean hidden)
        Description copied from interface: CellStyle
        set the cell's using this style to be hidden
        Specified by:
        setHidden in interface CellStyle
        Overrides:
        setHidden in class XSSFCellStyle
        Parameters:
        hidden - - whether the cell using this style should be hidden
      • getHidden

        public boolean getHidden()
        Description copied from interface: CellStyle
        get whether the cell's using this style are to be hidden
        Specified by:
        getHidden in interface CellStyle
        Overrides:
        getHidden in class XSSFCellStyle
        Returns:
        hidden - whether the cell using this style should be hidden
      • setLocked

        public void setLocked​(boolean locked)
        Description copied from interface: CellStyle
        set the cell's using this style to be locked
        Specified by:
        setLocked in interface CellStyle
        Overrides:
        setLocked in class XSSFCellStyle
        Parameters:
        locked - - whether the cell using this style should be locked
      • getLocked

        public boolean getLocked()
        Description copied from interface: CellStyle
        get whether the cell's using this style are to be locked
        Specified by:
        getLocked in interface CellStyle
        Overrides:
        getLocked in class XSSFCellStyle
        Returns:
        hidden - whether the cell using this style should be locked
      • setWrapText

        public void setWrapText​(boolean wrapped)
        Description copied from interface: CellStyle
        Set whether the text should be wrapped. Setting this flag to true make all content visible within a cell by displaying it on multiple lines
        Specified by:
        setWrapText in interface CellStyle
        Overrides:
        setWrapText in class XSSFCellStyle
        Parameters:
        wrapped - wrap text or not
      • setRotation

        public void setRotation​(short rotation)
        Description copied from interface: CellStyle
        set the degree of rotation for the text in the cell. Note: HSSF uses values from -90 to 90 degrees, whereas XSSF uses values from 0 to 180 degrees. The implementations of this method will map between these two value-ranges accordingly, however the corresponding getter is returning values in the range mandated by the current type of Excel file-format that this CellStyle is applied to.
        Specified by:
        setRotation in interface CellStyle
        Overrides:
        setRotation in class XSSFCellStyle
        Parameters:
        rotation - degrees (see note above)
      • getRotation

        public short getRotation()
        Description copied from interface: CellStyle
        get the degree of rotation for the text in the cell. Note: HSSF uses values from -90 to 90 degrees, whereas XSSF uses values from 0 to 180 degrees. The implementations of this method will map between these two value-ranges value-range as used by the type of Excel file-format that this CellStyle is applied to.
        Specified by:
        getRotation in interface CellStyle
        Overrides:
        getRotation in class XSSFCellStyle
        Returns:
        rotation degrees (see note above)
      • setIndention

        public void setIndention​(short indent)
        Description copied from interface: CellStyle
        set the number of spaces to indent the text in the cell
        Specified by:
        setIndention in interface CellStyle
        Overrides:
        setIndention in class XSSFCellStyle
        Parameters:
        indent - - number of spaces
      • getIndention

        public short getIndention()
        Description copied from interface: CellStyle
        get the number of spaces to indent the text in the cell
        Specified by:
        getIndention in interface CellStyle
        Overrides:
        getIndention in class XSSFCellStyle
        Returns:
        indent - number of spaces
      • setBorderHorizontal

        public void setBorderHorizontal​(BorderStyle border)
        Description copied from interface: DxfCellStyle
        set the type of border to use for the horizontal border of the cell
        Specified by:
        setBorderHorizontal in interface DxfCellStyle
        Parameters:
        border - type
      • setHorizontalBorderColor

        public void setHorizontalBorderColor​(short color)
        Description copied from interface: DxfCellStyle
        set the color to use for the horizontal border
        Specified by:
        setHorizontalBorderColor in interface DxfCellStyle
        Parameters:
        color - The index of the color definition
      • setBorderVertical

        public void setBorderVertical​(BorderStyle border)
        Description copied from interface: DxfCellStyle
        set the type of border to use for the horizontal border of the cell
        Specified by:
        setBorderVertical in interface DxfCellStyle
        Parameters:
        border - type
      • setVerticalBorderColor

        public void setVerticalBorderColor​(short color)
        Description copied from interface: DxfCellStyle
        set the color to use for the vertical border
        Specified by:
        setVerticalBorderColor in interface DxfCellStyle
        Parameters:
        color - The index of the color definition
      • setBorderDiagonal

        public void setBorderDiagonal​(BorderStyle border)
        Description copied from interface: DxfCellStyle
        set the type of border to use for the diagonal border of the cell
        Specified by:
        setBorderDiagonal in interface DxfCellStyle
        Parameters:
        border - type
      • setDiagonalBorderColor

        public void setDiagonalBorderColor​(short color)
        Description copied from interface: DxfCellStyle
        set the color to use for the diagonal border
        Specified by:
        setDiagonalBorderColor in interface DxfCellStyle
        Parameters:
        color - The index of the color definition
      • setHorizontalBorderColor

        public void setHorizontalBorderColor​(XSSFColor color)
        Set the color to use for the left border as a XSSFColor value
        Parameters:
        color - the color to use
      • setVerticalBorderColor

        public void setVerticalBorderColor​(XSSFColor color)
        Set the color to use for the left border as a XSSFColor value
        Parameters:
        color - the color to use
      • setDiagonalBorderColor

        public void setDiagonalBorderColor​(XSSFColor color)
        Set the color to use for the left border as a XSSFColor value
        Parameters:
        color - the color to use
      • getHorizontalBorderXSSFColor

        public XSSFColor getHorizontalBorderXSSFColor()
        Get the color to use for the horizontal border
        Returns:
        the index of the color definition or null if not set
        See Also:
        IndexedColors
      • getVerticalBorderXSSFColor

        public XSSFColor getVerticalBorderXSSFColor()
        Get the color to use for the vertical border
        Returns:
        the index of the color definition or null if not set
        See Also:
        IndexedColors
      • getDiagonalBorderXSSFColor

        public XSSFColor getDiagonalBorderXSSFColor()
        Get the color to use for the diagonal border
        Returns:
        the index of the color definition or null if not set
        See Also:
        IndexedColors
      • setFillForegroundColor

        public void setFillForegroundColor​(XSSFColor color)
        Set the foreground fill color represented as a XSSFColor value.
        Note: Ensure Foreground color is set prior to background color.
        Overrides:
        setFillForegroundColor in class XSSFCellStyle
        Parameters:
        color - the color to use
        See Also:
        )
      • setFillBackgroundColor

        public void setFillBackgroundColor​(XSSFColor color)
        Set the background fill color represented as a 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.
        Overrides:
        setFillBackgroundColor in class XSSFCellStyle
        Parameters:
        color - - the color to use
      • setFill

        public void setFill​(Color fillColor,
                            Color backColor,
                            short patternType)
      • getDxfIndex

        public int getDxfIndex()