use of org.openxmlformats.schemas.drawingml.x2006.main.CTPresetLineDashProperties in project poi by apache.
the class XSLFSimpleShape method setLineDash.
/**
*
* @param dash a preset line dashing scheme to stroke thr shape outline
*/
public void setLineDash(LineDash dash) {
CTLineProperties ln = getLn(this, true);
if (ln == null) {
return;
}
if (dash == null) {
if (ln.isSetPrstDash()) {
ln.unsetPrstDash();
}
} else {
CTPresetLineDashProperties ldp = ln.isSetPrstDash() ? ln.getPrstDash() : ln.addNewPrstDash();
ldp.setVal(STPresetLineDashVal.Enum.forInt(dash.ooxmlId));
}
}
use of org.openxmlformats.schemas.drawingml.x2006.main.CTPresetLineDashProperties in project poi by apache.
the class XSSFShape method setLineStyle.
/**
* Sets the line style.
*
* @param lineStyle
*/
public void setLineStyle(int lineStyle) {
CTShapeProperties props = getShapeProperties();
CTLineProperties ln = props.isSetLn() ? props.getLn() : props.addNewLn();
CTPresetLineDashProperties dashStyle = CTPresetLineDashProperties.Factory.newInstance();
dashStyle.setVal(STPresetLineDashVal.Enum.forInt(lineStyle + 1));
ln.setPrstDash(dashStyle);
}
Aggregations