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); } }
/** * * @return name of this theme, e.g. "Office Theme" */ public String getName(){ return _theme.getName(); }
@Override protected final void commit() throws IOException { XmlOptions xmlOptions = new XmlOptions(DEFAULT_XML_OPTIONS); xmlOptions.setSaveSyntheticDocumentElement( new QName(XSLFRelation.NS_DRAWINGML, "theme")); PackagePart part = getPackagePart(); OutputStream out = part.getOutputStream(); getXmlObject().save(out, xmlOptions); out.close(); }
/** * Set name of this theme * * @param name name of this theme */ public void setName(String name){ _theme.setName(name); }
/** * Create a new, empty ThemesTable */ public ThemesTable() { super(); theme = ThemeDocument.Factory.newInstance(); theme.addNewTheme().addNewThemeElements(); }
public ColorHelper(CTOfficeStyleSheet office) { if(office != null){ int index = 0; NodeList nodes = office.getDomNode().getOwnerDocument().getElementsByTagNameNS("*", "sysClr"); for (int i = 0; i < nodes.getLength(); ++i,index++) { Element e = (Element) nodes.item(i); String val = e.getAttribute("val"); if("window".equals(val)){ themeColors.put(index,0x000000); }else { themeColors.put(index,0xFFFFFF); } } nodes = office.getDomNode().getOwnerDocument().getElementsByTagNameNS("*", "srgbClr"); for (int i = 0; i < nodes.getLength(); ++i,index++) { Element e = (Element) nodes.item(i); String val = e.getAttribute("val"); themeColors.put(index, Integer.parseInt(val, 16)); } } }
/** * Set name of this theme * * @param name name of this theme */ public void setName(String name){ _theme.setName(name); }
/** * Create a new, empty ThemesTable */ public ThemesTable() { super(); theme = ThemeDocument.Factory.newInstance(); theme.addNewTheme().addNewThemeElements(); }
/** * @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(); } }
/** * Set name of this theme * * @param name name of this theme */ public void setName(String name){ _theme.setName(name); }
/** * * @return name of this theme, e.g. "Office Theme" */ public String getName(){ return _theme.getName(); }
protected final void commit() throws IOException { XmlOptions xmlOptions = new XmlOptions(DEFAULT_XML_OPTIONS); Map<String, String> map = new HashMap<String, String>(); map.put("http://schemas.openxmlformats.org/drawingml/2006/main", "a"); xmlOptions.setSaveSuggestedPrefixes(map); xmlOptions.setSaveSyntheticDocumentElement( new QName("http://schemas.openxmlformats.org/drawingml/2006/main", "theme")); PackagePart part = getPackagePart(); OutputStream out = part.getOutputStream(); getXmlObject().save(out, xmlOptions); out.close(); }
/** * @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 name of this theme, e.g. "Office Theme" */ public String getName(){ return _theme.getName(); }
@Override protected final void commit() throws IOException { XmlOptions xmlOptions = new XmlOptions(DEFAULT_XML_OPTIONS); xmlOptions.setSaveSyntheticDocumentElement( new QName(XSLFRelation.NS_DRAWINGML, "theme")); PackagePart part = getPackagePart(); OutputStream out = part.getOutputStream(); getXmlObject().save(out, xmlOptions); out.close(); }
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); } };
CTFontScheme fontTheme = theme.getXmlObject().getThemeElements().getFontScheme(); CTFontCollection coll = typeface.startsWith("+mj-") ? fontTheme.getMajorFont() : fontTheme.getMinorFont();
return null; CTBaseStyles styles = theme.getXmlObject().getThemeElements(); if (styles == null) { return null;
CTStyleMatrix styleMatrix = getSheet().getTheme().getXmlObject().getThemeElements().getFmtScheme(); CTEffectStyleItem ef = styleMatrix.getEffectStyleLst().getEffectStyleArray(idx - 1); obj = ef.getEffectLst().getOuterShdw();
CTStyleMatrix matrix = theme.getXmlObject().getThemeElements().getFmtScheme(); final XmlObject styleLst; int childIdx;