/** * @since POI 3.14-Beta1 */ public XSLFTheme(PackagePart part) throws IOException, XmlException { super(part); ThemeDocument doc = ThemeDocument.Factory.parse(getPackagePart().getInputStream(), DEFAULT_XML_OPTIONS); _theme = doc.getTheme(); initialize(); }
/** * Create a new, empty ThemesTable */ public ThemesTable() { super(); theme = ThemeDocument.Factory.newInstance(); theme.addNewTheme().addNewThemeElements(); }
/** * Write this table out as XML. * * @param out The stream to write to. * @throws IOException if an error occurs while writing. */ public void writeTo(OutputStream out) throws IOException { theme.save(out, DEFAULT_XML_OPTIONS); }
CTColorScheme colorScheme = theme.getTheme().getThemeElements().getClrScheme(); CTColor ctColor; switch (ThemeElement.byId(idx)) {
/** * Create a new, empty ThemesTable */ public ThemesTable() { super(); theme = ThemeDocument.Factory.newInstance(); theme.addNewTheme().addNewThemeElements(); }
/** * Write this table out as XML. * * @param out The stream to write to. * @throws IOException if an error occurs while writing. */ public void writeTo(OutputStream out) throws IOException { theme.save(out, DEFAULT_XML_OPTIONS); }
public CTOfficeStyleSheet getTheme(){ return doc.getTheme(); }
private CTFontCollection getFontCollection( ThemeDocument themeDocument, Enum asciiTheme ) { CTFontScheme fontScheme = themeDocument.getTheme().getThemeElements().getFontScheme(); if ( fontScheme != null ) { if ( asciiTheme.equals( STTheme.MINOR_ASCII ) || asciiTheme.equals( STTheme.MINOR_BIDI ) || asciiTheme.equals( STTheme.MINOR_EAST_ASIA ) || asciiTheme.equals( STTheme.MINOR_H_ANSI ) ) { return fontScheme.getMinorFont(); } return fontScheme.getMajorFont(); } return null; }
private CTFontCollection getFontCollection( ThemeDocument themeDocument, Enum asciiTheme ) { CTFontScheme fontScheme = themeDocument.getTheme().getThemeElements().getFontScheme(); if ( fontScheme != null ) { if ( asciiTheme.equals( STTheme.MINOR_ASCII ) || asciiTheme.equals( STTheme.MINOR_BIDI ) || asciiTheme.equals( STTheme.MINOR_EAST_ASIA ) || asciiTheme.equals( STTheme.MINOR_H_ANSI ) ) { return fontScheme.getMinorFont(); } return fontScheme.getMajorFont(); } return null; }
private CTFontCollection getFontCollection( ThemeDocument themeDocument, Enum asciiTheme ) { CTFontScheme fontScheme = themeDocument.getTheme().getThemeElements().getFontScheme(); if ( fontScheme != null ) { if ( asciiTheme.equals( STTheme.MINOR_ASCII ) || asciiTheme.equals( STTheme.MINOR_BIDI ) || asciiTheme.equals( STTheme.MINOR_EAST_ASIA ) || asciiTheme.equals( STTheme.MINOR_H_ANSI ) ) { return fontScheme.getMinorFont(); } return fontScheme.getMajorFont(); } return null; }
private CTFontCollection getFontCollection( ThemeDocument themeDocument, Enum asciiTheme ) { CTFontScheme fontScheme = themeDocument.getTheme().getThemeElements().getFontScheme(); if ( fontScheme != null ) { if ( asciiTheme.equals( STTheme.MINOR_ASCII ) || asciiTheme.equals( STTheme.MINOR_BIDI ) || asciiTheme.equals( STTheme.MINOR_EAST_ASIA ) || asciiTheme.equals( STTheme.MINOR_H_ANSI ) ) { return fontScheme.getMinorFont(); } return fontScheme.getMajorFont(); } return null; }
/** * @since POI 3.14-Beta1 */ public XSLFTheme(PackagePart part) throws IOException, XmlException { super(part); ThemeDocument doc = ThemeDocument.Factory.parse(getPackagePart().getInputStream(), DEFAULT_XML_OPTIONS); _theme = doc.getTheme(); initialize(); }
public XSLFTheme(PackagePart part, PackageRelationship rel) throws IOException, XmlException { super(part, rel); ThemeDocument doc = ThemeDocument.Factory.parse(getPackagePart().getInputStream()); _theme = doc.getTheme(); initialize(); }
public XSSFColor getThemeColor(int idx) { CTColorScheme colorScheme = theme.getTheme().getThemeElements().getClrScheme(); CTColor ctColor = null; int cnt = 0; for (XmlObject obj : colorScheme.selectPath("./*")) { if (obj instanceof org.openxmlformats.schemas.drawingml.x2006.main.CTColor) { if (cnt == idx) { ctColor = (org.openxmlformats.schemas.drawingml.x2006.main.CTColor) obj; byte[] rgb = null; if (ctColor.getSrgbClr() != null) { // Colour is a regular one rgb = ctColor.getSrgbClr().getVal(); } else if (ctColor.getSysClr() != null) { // Colour is a tint of white or black rgb = ctColor.getSysClr().getLastClr(); } return new XSSFColor(rgb); } cnt++; } } return null; }
CTColorScheme colorScheme = theme.getTheme().getThemeElements().getClrScheme(); CTColor ctColor; switch (ThemeElement.byId(idx)) {