public XDDFGradientStop getGradientStop(int index) { if (props.isSetGsLst()) { return new XDDFGradientStop(props.getGsLst().getGsArray(index)); } else { return null; } }
public XDDFGradientStop addGradientStop() { if (!props.isSetGsLst()) { props.addNewGsLst(); } return new XDDFGradientStop(props.getGsLst().addNewGs()); }
public List<XDDFGradientStop> getGradientStops() { if (props.isSetGsLst()) { return Collections.unmodifiableList(props .getGsLst() .getGsList() .stream() .map(gs -> new XDDFGradientStop(gs)) .collect(Collectors.toList())); } else { return Collections.emptyList(); } }
/** * gradients with type=shape are enot supported by Java graphics. * We approximate it with a radial gradient. */ private static Paint toRadialGradientPaint( CTGradientFillProperties gradFill, Rectangle2D anchor, XSLFTheme theme, CTSchemeColor phClr) { @SuppressWarnings("deprecation") CTGradientStop[] gs = gradFill.getGsLst().getGsArray(); Arrays.sort(gs, new Comparator<CTGradientStop>() { public int compare(CTGradientStop o1, CTGradientStop o2) { Integer pos1 = o1.getPos(); Integer pos2 = o2.getPos(); return pos1.compareTo(pos2); } }); gs[1].setPos(50000); CTGradientFillProperties g = CTGradientFillProperties.Factory.newInstance(); g.set(gradFill); g.getGsLst().setGsArray(new CTGradientStop[]{gs[0], gs[1]}); return createRadialGradientPaint(g, anchor, theme, phClr); }
public XDDFGradientStop insertGradientStop(int index) { if (!props.isSetGsLst()) { props.addNewGsLst(); } return new XDDFGradientStop(props.getGsLst().insertNewGs(index)); }
public void removeGradientStop(int index) { if (props.isSetGsLst()) { props.getGsLst().removeGs(index); } }
public int countGradientStops() { if (props.isSetGsLst()) { return props.getGsLst().sizeOfGsArray(); } else { return 0; } }
public XDDFGradientStop insertGradientStop(int index) { if (!props.isSetGsLst()) { props.addNewGsLst(); } return new XDDFGradientStop(props.getGsLst().insertNewGs(index)); }
public void removeGradientStop(int index) { if (props.isSetGsLst()) { props.getGsLst().removeGs(index); } }
public int countGradientStops() { if (props.isSetGsLst()) { return props.getGsLst().sizeOfGsArray(); } else { return 0; } }
final CTGradientStop[] gs = gradFill.getGsLst().getGsArray();
public XDDFGradientStop addGradientStop() { if (!props.isSetGsLst()) { props.addNewGsLst(); } return new XDDFGradientStop(props.getGsLst().addNewGs()); }
public List<XDDFGradientStop> getGradientStops() { if (props.isSetGsLst()) { return Collections.unmodifiableList(props .getGsLst() .getGsList() .stream() .map(gs -> new XDDFGradientStop(gs)) .collect(Collectors.toList())); } else { return Collections.emptyList(); } }
XSLFTheme theme, CTSchemeColor phClr) { @SuppressWarnings("deprecation") CTGradientStop[] gs = gradFill.getGsLst().getGsArray();
public XDDFGradientStop getGradientStop(int index) { if (props.isSetGsLst()) { return new XDDFGradientStop(props.getGsLst().getGsArray(index)); } else { return null; } }
double angle = gradFill.getLin().getAng() / 60000; @SuppressWarnings("deprecation") CTGradientStop[] gs = gradFill.getGsLst().getGsArray();
final CTGradientStop[] gs = gradFill.getGsLst().getGsArray();