Search in sources :

Example 1 with CTPresetLineDashProperties

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));
    }
}
Also used : CTLineProperties(org.openxmlformats.schemas.drawingml.x2006.main.CTLineProperties) CTPresetLineDashProperties(org.openxmlformats.schemas.drawingml.x2006.main.CTPresetLineDashProperties)

Example 2 with CTPresetLineDashProperties

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);
}
Also used : CTShapeProperties(org.openxmlformats.schemas.drawingml.x2006.main.CTShapeProperties) CTLineProperties(org.openxmlformats.schemas.drawingml.x2006.main.CTLineProperties) CTPresetLineDashProperties(org.openxmlformats.schemas.drawingml.x2006.main.CTPresetLineDashProperties)

Aggregations

CTLineProperties (org.openxmlformats.schemas.drawingml.x2006.main.CTLineProperties)2 CTPresetLineDashProperties (org.openxmlformats.schemas.drawingml.x2006.main.CTPresetLineDashProperties)2 CTShapeProperties (org.openxmlformats.schemas.drawingml.x2006.main.CTShapeProperties)1