Package org.apache.poi.xssf.model
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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ThemesTable.ThemeElement
-
Nested classes/interfaces inherited from class org.apache.poi.ooxml.POIXMLDocumentPart
POIXMLDocumentPart.RelationPart
-
-
Constructor Summary
Constructors Constructor Description ThemesTable()
Create a new, empty ThemesTableThemesTable(PackagePart part)
Construct a ThemesTable.ThemesTable(ThemeDocument theme)
Construct a ThemesTable from an existing ThemeDocument.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description XSSFColor
getThemeColor(int idx)
Convert a theme "index" (as used by fonts etc) into a color.void
inheritFromThemeAsRequired(XSSFColor color)
If the colour is based on a theme, then inherit information (currently just colours) from it as required.void
writeTo(java.io.OutputStream out)
Write this table out as XML.-
Methods inherited from class org.apache.poi.ooxml.POIXMLDocumentPart
_invokeOnDocumentRead, addRelation, createRelationship, createRelationship, createRelationship, getPackagePart, getParent, getRelationById, getRelationId, getRelationPartById, getRelationParts, getRelations, isCommited, setCommited, toString
-
-
-
-
Constructor Detail
-
ThemesTable
public ThemesTable()
Create a new, empty ThemesTable
-
ThemesTable
public ThemesTable(PackagePart part) throws java.io.IOException
Construct a ThemesTable.- Parameters:
part
- A PackagePart.- Throws:
java.io.IOException
- Since:
- POI 3.14-Beta1
-
ThemesTable
public ThemesTable(ThemeDocument theme)
Construct a ThemesTable from an existing ThemeDocument.- Parameters:
theme
- A ThemeDocument.
-
-
Method Detail
-
getThemeColor
public XSSFColor getThemeColor(int idx)
Convert a theme "index" (as used by fonts etc) into a color.- Specified by:
getThemeColor
in interfaceThemes
- 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 interfaceThemes
-
writeTo
public void writeTo(java.io.OutputStream out) throws java.io.IOException
Write this table out as XML.- Parameters:
out
- The stream to write to.- Throws:
java.io.IOException
- if an error occurs while writing.
-
-