@Override public CTSolidColorFillProperties addNewSolidFill() { return props.addNewSolidFill(); }
@Override public void setFillColor(int red, int green, int blue) { CTShapeProperties props = getShapeProperties(); CTSolidColorFillProperties fill = props.isSetSolidFill() ? props.getSolidFill() : props.addNewSolidFill(); CTSRgbColor rgb = CTSRgbColor.Factory.newInstance(); rgb.setVal(new byte[]{(byte)red, (byte)green, (byte)blue}); fill.setSrgbClr(rgb); }
@Override public CTSolidColorFillProperties addNewSolidFill() { return props.addNewSolidFill(); }
@Override public void setFillColor(int red, int green, int blue) { CTShapeProperties props = getShapeProperties(); CTSolidColorFillProperties fill = props.isSetSolidFill() ? props.getSolidFill() : props.addNewSolidFill(); CTSRgbColor rgb = CTSRgbColor.Factory.newInstance(); rgb.setVal(new byte[]{(byte)red, (byte)green, (byte)blue}); fill.setSrgbClr(rgb); }
/** * Sets the color used to fill this shape using the solid fill pattern. */ public void setFillColor(int red, int green, int blue) { CTShapeProperties props = getShapeProperties(); CTSolidColorFillProperties fill = props.isSetSolidFill() ? props.getSolidFill() : props.addNewSolidFill(); CTSRgbColor rgb = CTSRgbColor.Factory.newInstance(); rgb.setVal(new byte[]{(byte)red, (byte)green, (byte)blue}); fill.setSrgbClr(rgb); }
/** * Specifies a solid color fill. The shape is filled entirely with the * specified color. * * @param color the solid color fill. The value of <code>null</code> unsets * the solidFIll attribute from the underlying xml */ public void setFillColor(Color color) { CTShapeProperties spPr = getSpPr(); if (color == null) { if (spPr.isSetSolidFill()) spPr.unsetSolidFill(); if (!spPr.isSetNoFill()) spPr.addNewNoFill(); } else { if (spPr.isSetNoFill()) spPr.unsetNoFill(); CTSolidColorFillProperties fill = spPr.isSetSolidFill() ? spPr .getSolidFill() : spPr.addNewSolidFill(); CTSRgbColor rgb = CTSRgbColor.Factory.newInstance(); rgb.setVal(new byte[]{(byte) color.getRed(), (byte) color.getGreen(), (byte) color.getBlue()}); fill.setSrgbClr(rgb); if(fill.isSetHslClr()) fill.unsetHslClr(); if(fill.isSetPrstClr()) fill.unsetPrstClr(); if(fill.isSetSchemeClr()) fill.unsetSchemeClr(); if(fill.isSetScrgbClr()) fill.unsetScrgbClr(); if(fill.isSetSysClr()) fill.unsetSysClr(); } }