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; }
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()); }
@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; } };
/** * @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; }
@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()); }