Search in sources :

Example 1 with CTLineEndProperties

use of org.openxmlformats.schemas.drawingml.x2006.main.CTLineEndProperties in project poi by apache.

the class XSLFTableCell method setBorderDefaults.

private CTLineProperties setBorderDefaults(BorderEdge edge) {
    CTLineProperties ln = getCTLine(edge, true);
    if (ln.isSetNoFill()) {
        ln.unsetNoFill();
    }
    if (!ln.isSetPrstDash()) {
        ln.addNewPrstDash().setVal(STPresetLineDashVal.SOLID);
    }
    if (!ln.isSetCmpd()) {
        ln.setCmpd(STCompoundLine.SNG);
    }
    if (!ln.isSetAlgn()) {
        ln.setAlgn(STPenAlignment.CTR);
    }
    if (!ln.isSetCap()) {
        ln.setCap(STLineCap.FLAT);
    }
    if (!ln.isSetRound()) {
        ln.addNewRound();
    }
    if (!ln.isSetHeadEnd()) {
        CTLineEndProperties hd = ln.addNewHeadEnd();
        hd.setType(STLineEndType.NONE);
        hd.setW(STLineEndWidth.MED);
        hd.setLen(STLineEndLength.MED);
    }
    if (!ln.isSetTailEnd()) {
        CTLineEndProperties tl = ln.addNewTailEnd();
        tl.setType(STLineEndType.NONE);
        tl.setW(STLineEndWidth.MED);
        tl.setLen(STLineEndLength.MED);
    }
    return ln;
}
Also used : CTLineEndProperties(org.openxmlformats.schemas.drawingml.x2006.main.CTLineEndProperties) CTLineProperties(org.openxmlformats.schemas.drawingml.x2006.main.CTLineProperties)

Example 2 with CTLineEndProperties

use of org.openxmlformats.schemas.drawingml.x2006.main.CTLineEndProperties in project poi by apache.

the class XSLFSimpleShape method setLineTailDecoration.

/**
     * Specifies the line end decoration, such as a triangle or arrowhead.
     */
public void setLineTailDecoration(DecorationShape style) {
    CTLineProperties ln = getLn(this, true);
    if (ln == null) {
        return;
    }
    CTLineEndProperties lnEnd = ln.isSetTailEnd() ? ln.getTailEnd() : ln.addNewTailEnd();
    if (style == null) {
        if (lnEnd.isSetType()) {
            lnEnd.unsetType();
        }
    } else {
        lnEnd.setType(STLineEndType.Enum.forInt(style.ooxmlId));
    }
}
Also used : CTLineEndProperties(org.openxmlformats.schemas.drawingml.x2006.main.CTLineEndProperties) CTLineProperties(org.openxmlformats.schemas.drawingml.x2006.main.CTLineProperties)

Example 3 with CTLineEndProperties

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

Example 4 with CTLineEndProperties

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

Example 5 with CTLineEndProperties

use of org.openxmlformats.schemas.drawingml.x2006.main.CTLineEndProperties in project poi by apache.

the class XSLFSimpleShape method setLineHeadDecoration.

/**
     * Specifies the line end decoration, such as a triangle or arrowhead.
     * 
     * @param style the line end docoration style
     */
public void setLineHeadDecoration(DecorationShape style) {
    CTLineProperties ln = getLn(this, true);
    if (ln == null) {
        return;
    }
    CTLineEndProperties lnEnd = ln.isSetHeadEnd() ? ln.getHeadEnd() : ln.addNewHeadEnd();
    if (style == null) {
        if (lnEnd.isSetType()) {
            lnEnd.unsetType();
        }
    } else {
        lnEnd.setType(STLineEndType.Enum.forInt(style.ooxmlId));
    }
}
Also used : CTLineEndProperties(org.openxmlformats.schemas.drawingml.x2006.main.CTLineEndProperties) CTLineProperties(org.openxmlformats.schemas.drawingml.x2006.main.CTLineProperties)

Aggregations

CTLineEndProperties (org.openxmlformats.schemas.drawingml.x2006.main.CTLineEndProperties)7 CTLineProperties (org.openxmlformats.schemas.drawingml.x2006.main.CTLineProperties)7