public XDDFPresetLineDash getPresetDash() { if (props.isSetPrstDash()) { return new XDDFPresetLineDash(props.getPrstDash()); } else { return null; } }
@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)); }
@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()); }
/** * * @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)); } }
/** * @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; }
public XDDFPresetLineDash getPresetDash() { if (props.isSetPrstDash()) { return new XDDFPresetLineDash(props.getPrstDash()); } else { return null; } }
@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)); }
@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; } };
public boolean fetch(XSLFSimpleShape shape) { CTShapeProperties spPr = shape.getSpPr(); CTLineProperties ln = spPr.getLn(); if (ln != null) { CTPresetLineDashProperties ctDash = ln.getPrstDash(); if (ctDash != null) { setValue(LineDash.values()[ctDash.getVal().intValue() - 1]); return true; } } return false; } };
@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()); }
/** * * @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)); } }
CTLineProperties defaultLn = getDefaultLineProperties(); if (defaultLn != null) { CTPresetLineDashProperties ctDash = defaultLn.getPrstDash(); if (ctDash != null) { dash = LineDash.values()[ctDash.getVal().intValue() - 1];
/** * @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; }