use of org.openxmlformats.schemas.drawingml.x2006.main.CTBaseStyles in project poi by apache.
the class XSLFSimpleShape method getDefaultLineProperties.
/**
* Get default line properties defined in the theme (if any).
* Used internally to resolve shape properties.
*
* @return line properties from the theme of null
*/
CTLineProperties getDefaultLineProperties() {
CTShapeStyle style = getSpStyle();
if (style == null) {
return null;
}
CTStyleMatrixReference lnRef = style.getLnRef();
if (lnRef == null) {
return null;
}
// 1-based index of a line style within the style matrix
int idx = (int) lnRef.getIdx();
XSLFTheme theme = getSheet().getTheme();
if (theme == null) {
return null;
}
CTBaseStyles styles = theme.getXmlObject().getThemeElements();
if (styles == null) {
return null;
}
CTStyleMatrix styleMatrix = styles.getFmtScheme();
if (styleMatrix == null) {
return null;
}
CTLineStyleList lineStyles = styleMatrix.getLnStyleLst();
if (lineStyles == null || lineStyles.sizeOfLnArray() < idx) {
return null;
}
return lineStyles.getLnArray(idx - 1);
}
use of org.openxmlformats.schemas.drawingml.x2006.main.CTBaseStyles in project poi by apache.
the class XSLFTheme method initialize.
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);
}
}
Aggregations