use of org.openxmlformats.schemas.drawingml.x2006.main.CTLineProperties in project poi by apache.
the class XSLFSimpleShape method getLineHeadLength.
/**
* @return the line end decoration length
*/
public DecorationSize getLineHeadLength() {
CTLineProperties ln = getLn(this, false);
DecorationSize ds = DecorationSize.MEDIUM;
if (ln != null && ln.isSetHeadEnd() && ln.getHeadEnd().isSetLen()) {
ds = DecorationSize.fromOoxmlId(ln.getHeadEnd().getLen().intValue());
}
return ds;
}
use of org.openxmlformats.schemas.drawingml.x2006.main.CTLineProperties in project poi by apache.
the class XSLFSimpleShape method setLineHeadLength.
/**
* Specifies the line end width in relation to the line width.
*/
public void setLineHeadLength(DecorationSize style) {
CTLineProperties ln = getLn(this, true);
if (ln == null) {
return;
}
CTLineEndProperties lnEnd = ln.isSetHeadEnd() ? ln.getHeadEnd() : ln.addNewHeadEnd();
if (style == null) {
if (lnEnd.isSetLen()) {
lnEnd.unsetLen();
}
} else {
lnEnd.setLen(STLineEndLength.Enum.forInt(style.ooxmlId));
}
}
use of org.openxmlformats.schemas.drawingml.x2006.main.CTLineProperties in project poi by apache.
the class XSLFSimpleShape method setLineTailWidth.
/**
* specifies decorations which can be added to the tail of a line.
*/
public void setLineTailWidth(DecorationSize style) {
CTLineProperties ln = getLn(this, true);
if (ln == null) {
return;
}
CTLineEndProperties lnEnd = ln.isSetTailEnd() ? ln.getTailEnd() : ln.addNewTailEnd();
if (style == null) {
if (lnEnd.isSetW()) {
lnEnd.unsetW();
}
} else {
lnEnd.setW(STLineEndWidth.Enum.forInt(style.ooxmlId));
}
}
use of org.openxmlformats.schemas.drawingml.x2006.main.CTLineProperties in project poi by apache.
the class XSLFSimpleShape method getLineTailDecoration.
/**
* @return the line end decoration shape
*/
public DecorationShape getLineTailDecoration() {
CTLineProperties ln = getLn(this, false);
DecorationShape ds = DecorationShape.NONE;
if (ln != null && ln.isSetTailEnd() && ln.getTailEnd().isSetType()) {
ds = DecorationShape.fromOoxmlId(ln.getTailEnd().getType().intValue());
}
return ds;
}
use of org.openxmlformats.schemas.drawingml.x2006.main.CTLineProperties 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);
}
Aggregations