/** * @return typeface of the minor font to use in a document. * Typically the monor font is used for normal text or paragraph areas. * */ @SuppressWarnings("WeakerAccess") public String getMinorFont(){ return _theme.getThemeElements().getFontScheme().getMinorFont().getLatin().getTypeface(); } }
private void initialize(){ CTBaseStyles elems = _theme.getThemeElements(); CTColorScheme scheme = elems.getClrScheme(); // The color scheme is responsible for defining a list of twelve colors. _schemeColors = new HashMap<>(12); for(XmlObject o : scheme.selectPath("*")){ CTColor c = (CTColor)o; String name = c.getDomNode().getLocalName(); _schemeColors.put(name, c); } }
PaintStyle getThemePaint(CTShapeStyle style, PackagePart pp) { // get a reference to a line style within the style matrix. CTStyleMatrixReference lnRef = style.getLnRef(); if (lnRef == null) { return null; } int idx = (int)lnRef.getIdx(); CTSchemeColor phClr = lnRef.getSchemeClr(); if(idx <= 0){ return null; } CTLineProperties props = theme.getXmlObject().getThemeElements().getFmtScheme().getLnStyleLst().getLnArray(idx - 1); XSLFFillProperties fp = XSLFPropertiesDelegate.getFillDelegate(props); return selectPaint(fp, phClr, pp, theme, hasPlaceholder); } };
/** * @return typeface of the major font to use in a document. * Typically the major font is used for heading areas of a document. * */ @SuppressWarnings("WeakerAccess") public String getMajorFont(){ return _theme.getThemeElements().getFontScheme().getMajorFont().getLatin().getTypeface(); }
return null; CTStyleMatrix styleMatrix = styles.getFmtScheme(); if (styleMatrix == null) { return null;
CTColorScheme colorScheme = theme.getTheme().getThemeElements().getClrScheme(); CTColor ctColor; switch (ThemeElement.byId(idx)) {
CTFontScheme fontTheme = theme.getXmlObject().getThemeElements().getFontScheme(); CTFontCollection coll = typeface.startsWith("+mj-") ? fontTheme.getMajorFont() : fontTheme.getMinorFont();
CTStyleMatrix styleMatrix = getSheet().getTheme().getXmlObject().getThemeElements().getFmtScheme(); CTEffectStyleItem ef = styleMatrix.getEffectStyleLst().getEffectStyleArray(idx - 1); obj = ef.getEffectLst().getOuterShdw();
private void initialize(){ CTBaseStyles elems = _theme.getThemeElements(); CTColorScheme scheme = elems.getClrScheme(); // The color scheme is responsible for defining a list of twelve colors. _schemeColors = new HashMap<>(12); for(XmlObject o : scheme.selectPath("*")){ CTColor c = (CTColor)o; String name = c.getDomNode().getLocalName(); _schemeColors.put(name, c); } }
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; }
CTStyleMatrix matrix = theme.getXmlObject().getThemeElements().getFmtScheme(); final XmlObject styleLst; int childIdx;
private void initialize(){ CTBaseStyles elems = _theme.getThemeElements(); CTColorScheme scheme = elems.getClrScheme(); // The color scheme is responsible for defining a list of twelve colors. _schemeColors = new HashMap<String, CTColor>(12); for(XmlObject o : scheme.selectPath("*")){ CTColor c = (CTColor)o; String name = c.getDomNode().getLocalName(); _schemeColors.put(name, c); } }
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; }
/** * Get default line properties defined in the theme (if any). * Used internally to resolve shape properties. * * @return line propeties from the theme of null */ CTLineProperties getDefaultLineProperties() { CTLineProperties ln = null; CTShapeStyle style = getSpStyle(); if (style != null) { // 1-based index of a line style within the style matrix int idx = (int) style.getLnRef().getIdx(); CTStyleMatrix styleMatrix = _sheet.getTheme().getXmlObject().getThemeElements().getFmtScheme(); ln = styleMatrix.getLnStyleLst().getLnArray(idx - 1); } return ln; }
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; }
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; }
PaintStyle getThemePaint(CTShapeStyle style, PackagePart pp) { // get a reference to a line style within the style matrix. CTStyleMatrixReference lnRef = style.getLnRef(); if (lnRef == null) { return null; } int idx = (int)lnRef.getIdx(); CTSchemeColor phClr = lnRef.getSchemeClr(); if(idx <= 0){ return null; } CTLineProperties props = theme.getXmlObject().getThemeElements().getFmtScheme().getLnStyleLst().getLnArray(idx - 1); XSLFFillProperties fp = XSLFPropertiesDelegate.getFillDelegate(props); return selectPaint(fp, phClr, pp, theme, hasPlaceholder); } };
CTColorScheme colorScheme = theme.getTheme().getThemeElements().getClrScheme(); CTColor ctColor; switch (ThemeElement.byId(idx)) {
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; }
return null; CTStyleMatrix styleMatrix = styles.getFmtScheme(); if (styleMatrix == null) { return null;