Class ThemesTable

java.lang.Object
org.apache.poi.ooxml.POIXMLDocumentPart
org.apache.poi.xssf.model.ThemesTable
All Implemented Interfaces:
Themes

public class ThemesTable extends POIXMLDocumentPart implements Themes
Class that represents theme of XLSX document. The theme includes specific colors and fonts.
  • Constructor Details

    • ThemesTable

      public ThemesTable()
      Create a new, empty ThemesTable
    • ThemesTable

      public ThemesTable(PackagePart part) throws IOException
      Construct a ThemesTable.
      Parameters:
      part - A PackagePart.
      Throws:
      IOException
      Since:
      POI 3.14-Beta1
    • ThemesTable

      public ThemesTable(InputStream stream) throws IOException
      Construct a ThemesTable.
      Parameters:
      stream - input stream.
      Throws:
      IOException
      Since:
      POI 5.2.0
    • ThemesTable

      public ThemesTable(ThemeDocument theme)
      Construct a ThemesTable from an existing ThemeDocument.
      Parameters:
      theme - A ThemeDocument.
  • Method Details

    • readFrom

      public void readFrom(InputStream is) throws IOException
      Read this themes table from an XML file.
      Parameters:
      is - The input stream containing the XML document.
      Throws:
      IOException - if an error occurs while reading.
      Since:
      POI 5.2.0
    • getThemeColor

      public XSSFColor getThemeColor(int idx)
      Convert a theme "index" (as used by fonts etc) into a color.
      Specified by:
      getThemeColor in interface Themes
      Parameters:
      idx - A theme "index"
      Returns:
      The mapped XSSFColor, or null if not mapped.
    • inheritFromThemeAsRequired

      public void inheritFromThemeAsRequired(XSSFColor color)
      If the colour is based on a theme, then inherit information (currently just colours) from it as required.
      Specified by:
      inheritFromThemeAsRequired in interface Themes
    • writeTo

      public void writeTo(OutputStream out) throws IOException
      Write this table out as XML.
      Parameters:
      out - The stream to write to.
      Throws:
      IOException - if an error occurs while writing.