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);
}