public void setWidth(LineEndWidth width) { props.setW(width.underlying); } }
/** * specifies decorations which can be added to the tail of a line. */ @SuppressWarnings("WeakerAccess") 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)); } }
/** * specifies decoration width of the head of a line. * * @param style the decoration width */ @SuppressWarnings("WeakerAccess") public void setLineHeadWidth(DecorationSize style) { CTLineProperties ln = getLn(this, true); if (ln == null) { return; } CTLineEndProperties lnEnd = ln.isSetHeadEnd() ? ln.getHeadEnd() : ln.addNewHeadEnd(); if (style == null) { if (lnEnd.isSetW()) { lnEnd.unsetW(); } } else { lnEnd.setW(STLineEndWidth.Enum.forInt(style.ooxmlId)); } }
public void setWidth(LineEndWidth width) { props.setW(width.underlying); } }
/** * specifies decorations which can be added to the tail of a line. */ @SuppressWarnings("WeakerAccess") 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)); } }
/** * specifies decorations which can be added to the tail of a line. */ public void setLineTailWidth(LineEndWidth style) { CTLineProperties ln = getSpPr().getLn(); CTLineEndProperties lnEnd = ln.isSetTailEnd() ? ln.getTailEnd() : ln.addNewTailEnd(); if (style == null) { if (lnEnd.isSetW()) lnEnd.unsetW(); } else { lnEnd.setW(STLineEndWidth.Enum.forInt(style.ordinal() + 1)); } }
/** * specifies decorations which can be added to the head of a line. */ public void setLineHeadWidth(LineEndWidth style) { CTLineProperties ln = getSpPr().getLn(); CTLineEndProperties lnEnd = ln.isSetHeadEnd() ? ln.getHeadEnd() : ln.addNewHeadEnd(); if (style == null) { if (lnEnd.isSetW()) lnEnd.unsetW(); } else { lnEnd.setW(STLineEndWidth.Enum.forInt(style.ordinal() + 1)); } }
/** * specifies decoration width of the head of a line. * * @param style the decoration width */ @SuppressWarnings("WeakerAccess") public void setLineHeadWidth(DecorationSize style) { CTLineProperties ln = getLn(this, true); if (ln == null) { return; } CTLineEndProperties lnEnd = ln.isSetHeadEnd() ? ln.getHeadEnd() : ln.addNewHeadEnd(); if (style == null) { if (lnEnd.isSetW()) { lnEnd.unsetW(); } } else { lnEnd.setW(STLineEndWidth.Enum.forInt(style.ooxmlId)); } }
private void setLineColor(CTLineProperties ln, Color color){ if(color == null){ ln.addNewNoFill(); if(ln.isSetSolidFill()) ln.unsetSolidFill(); } else { if(ln.isSetNoFill()) ln.unsetNoFill(); if(!ln.isSetPrstDash()) ln.addNewPrstDash().setVal(STPresetLineDashVal.SOLID); ln.setCmpd(STCompoundLine.SNG); ln.setAlgn(STPenAlignment.CTR); ln.setCap(STLineCap.FLAT); ln.addNewRound(); CTLineEndProperties hd = ln.addNewHeadEnd(); hd.setType(STLineEndType.NONE); hd.setW(STLineEndWidth.MED); hd.setLen(STLineEndLength.MED); CTLineEndProperties tl = ln.addNewTailEnd(); tl.setType(STLineEndType.NONE); tl.setW(STLineEndWidth.MED); tl.setLen(STLineEndLength.MED); CTSRgbColor rgb = CTSRgbColor.Factory.newInstance(); rgb.setVal(new byte[]{(byte)color.getRed(), (byte)color.getGreen(), (byte)color.getBlue()}); ln.addNewSolidFill().setSrgbClr(rgb); } }
lineEndProperties.setType(STLineEndType.TRIANGLE); lineEndProperties.setLen(STLineEndLength.LG); lineEndProperties.setW(STLineEndWidth.LG);