public XDDFPresetLineDash getPresetDash() { if (props.isSetPrstDash()) { return new XDDFPresetLineDash(props.getPrstDash()); } else { return null; } }
public void setPresetDash(XDDFPresetLineDash properties) { if (properties == null) { if (props.isSetPrstDash()) { props.unsetPrstDash(); } } else { props.setPrstDash(properties.getXmlObject()); } }
@Override public void setBorderDash(BorderEdge edge, LineDash dash) { if (dash == null) { throw new IllegalArgumentException("LineDash need to be specified."); } CTLineProperties ln = setBorderDefaults(edge); if (!ln.isSetPrstDash()) { ln.addNewPrstDash(); } ln.getPrstDash().setVal(STPresetLineDashVal.Enum.forInt(dash.ooxmlId)); }
/** * * @param dash a preset line dashing scheme to stroke thr shape outline */ @SuppressWarnings("WeakerAccess") 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)); } }
@Override public boolean fetch(XSLFShape shape) { CTLineProperties ln = getLn(shape, false); if (ln == null || !ln.isSetPrstDash()) { return false; } setValue(LineDash.fromOoxmlId(ln.getPrstDash().getVal().intValue())); return true; } };
@SuppressWarnings("WeakerAccess") public LineDash getBorderDash(BorderEdge edge) { CTLineProperties ln = getCTLine(edge, false); if (ln == null || ln.isSetNoFill() || !ln.isSetSolidFill() || !ln.isSetPrstDash()) { return null; } return LineDash.fromOoxmlId(ln.getPrstDash().getVal().intValue()); }
/** * @return a preset line dashing scheme to stroke the shape outline */ @SuppressWarnings("WeakerAccess") public LineDash getLineDash() { PropertyFetcher<LineDash> fetcher = new PropertyFetcher<LineDash>() { @Override public boolean fetch(XSLFShape shape) { CTLineProperties ln = getLn(shape, false); if (ln == null || !ln.isSetPrstDash()) { return false; } setValue(LineDash.fromOoxmlId(ln.getPrstDash().getVal().intValue())); return true; } }; fetchShapeProperty(fetcher); LineDash dash = fetcher.getValue(); if (dash == null) { CTLineProperties defaultLn = getDefaultLineProperties(); if (defaultLn != null && defaultLn.isSetPrstDash()) { dash = LineDash.fromOoxmlId(defaultLn.getPrstDash().getVal().intValue()); } } return dash; }
if (!ln.isSetPrstDash()) { ln.addNewPrstDash().setVal(STPresetLineDashVal.SOLID);
public XDDFPresetLineDash getPresetDash() { if (props.isSetPrstDash()) { return new XDDFPresetLineDash(props.getPrstDash()); } else { return null; } }
public void setPresetDash(XDDFPresetLineDash properties) { if (properties == null) { if (props.isSetPrstDash()) { props.unsetPrstDash(); } } else { props.setPrstDash(properties.getXmlObject()); } }
@Override public void setBorderDash(BorderEdge edge, LineDash dash) { if (dash == null) { throw new IllegalArgumentException("LineDash need to be specified."); } CTLineProperties ln = setBorderDefaults(edge); if (!ln.isSetPrstDash()) { ln.addNewPrstDash(); } ln.getPrstDash().setVal(STPresetLineDashVal.Enum.forInt(dash.ooxmlId)); }
/** * * @param dash a preset line dashing scheme to stroke thr shape outline */ @SuppressWarnings("WeakerAccess") 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)); } }
@Override public boolean fetch(XSLFShape shape) { CTLineProperties ln = getLn(shape, false); if (ln == null || !ln.isSetPrstDash()) { return false; } setValue(LineDash.fromOoxmlId(ln.getPrstDash().getVal().intValue())); return true; } };
@SuppressWarnings("WeakerAccess") public LineDash getBorderDash(BorderEdge edge) { CTLineProperties ln = getCTLine(edge, false); if (ln == null || ln.isSetNoFill() || !ln.isSetSolidFill() || !ln.isSetPrstDash()) { return null; } return LineDash.fromOoxmlId(ln.getPrstDash().getVal().intValue()); }
/** * @return a preset line dashing scheme to stroke the shape outline */ @SuppressWarnings("WeakerAccess") public LineDash getLineDash() { PropertyFetcher<LineDash> fetcher = new PropertyFetcher<LineDash>() { @Override public boolean fetch(XSLFShape shape) { CTLineProperties ln = getLn(shape, false); if (ln == null || !ln.isSetPrstDash()) { return false; } setValue(LineDash.fromOoxmlId(ln.getPrstDash().getVal().intValue())); return true; } }; fetchShapeProperty(fetcher); LineDash dash = fetcher.getValue(); if (dash == null) { CTLineProperties defaultLn = getDefaultLineProperties(); if (defaultLn != null && defaultLn.isSetPrstDash()) { dash = LineDash.fromOoxmlId(defaultLn.getPrstDash().getVal().intValue()); } } return dash; }
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); } }
if (!ln.isSetPrstDash()) { ln.addNewPrstDash().setVal(STPresetLineDashVal.SOLID);