public void removeGradientStop(int index) { if (props.isSetGsLst()) { props.getGsLst().removeGs(index); } }
@Override public GradientType getGradientType() { if (gradFill.isSetLin()) { return GradientType.linear; } if (gradFill.isSetPath()) { /* TODO: handle rect path */ STPathShadeType.Enum ps = gradFill.getPath().getPath(); if (ps == STPathShadeType.CIRCLE) { return GradientType.circular; } else if (ps == STPathShadeType.SHAPE) { return GradientType.shape; } } return GradientType.linear; } };
public Boolean isRotatingWithShape() { if (props.isSetRotWithShape()) { return props.getRotWithShape(); } else { return null; } }
public void setRotatingWithShape(Boolean rotating) { if (rotating == null) { if (props.isSetRotWithShape()) { props.unsetRotWithShape(); } } else { props.setRotWithShape(rotating); } }
CTGradientFillProperties gradFill, Rectangle2D anchor, XSLFTheme theme, CTSchemeColor phClr) { double angle = gradFill.getLin().getAng() / 60000; @SuppressWarnings("deprecation") CTGradientStop[] gs = gradFill.getGsLst().getGsArray(); if(gradFill.isSetRotWithShape() || !gradFill.getRotWithShape()) { double rotation = _shape.getRotation(); if (rotation != 0.) {
public XDDFGradientStop addGradientStop() { if (!props.isSetGsLst()) { props.addNewGsLst(); } return new XDDFGradientStop(props.getGsLst().addNewGs()); }
public XDDFRelativeRectangle getTileRectangle() { if (props.isSetTileRect()) { return new XDDFRelativeRectangle(props.getTileRect()); } else { return null; } } public void setTileRectangle(XDDFRelativeRectangle rectangle) {
/** * 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); }
final CTGradientStop[] gs = gradFill.getGsLst().getGsArray();
@Override public boolean isRotatedWithShape() { return gradFill.getRotWithShape(); }
public XDDFGradientStop insertGradientStop(int index) { if (!props.isSetGsLst()) { props.addNewGsLst(); } return new XDDFGradientStop(props.getGsLst().insertNewGs(index)); }
public void setRotatingWithShape(Boolean rotating) { if (rotating == null) { if (props.isSetRotWithShape()) { props.unsetRotWithShape(); } } else { props.setRotWithShape(rotating); } }
public Boolean isRotatingWithShape() { if (props.isSetRotWithShape()) { return props.getRotWithShape(); } else { return null; } }