public void setValue(byte[] value) { color.setVal(value); }
/** * Set the color to be used on bullet characters within a given paragraph. * * @param color the bullet color */ public void setBulletFontColor(Color color){ CTTextParagraphProperties pr = _p.isSetPPr() ? _p.getPPr() : _p.addNewPPr(); CTColor c = pr.isSetBuClr() ? pr.getBuClr() : pr.addNewBuClr(); CTSRgbColor clr = c.isSetSrgbClr() ? c.getSrgbClr() : c.addNewSrgbClr(); clr.setVal(new byte[]{(byte) color.getRed(), (byte) color.getGreen(), (byte) color.getBlue()}); }
@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); }
/** * Set the color to be used on bullet characters within a given paragraph. * * @param color the bullet color */ @SuppressWarnings("WeakerAccess") public void setBulletFontColor(PaintStyle color) { if (!(color instanceof SolidPaint)) { throw new IllegalArgumentException("Currently XSLF only supports SolidPaint"); } // TODO: implement setting bullet color to null SolidPaint sp = (SolidPaint)color; Color col = DrawPaint.applyColorTransform(sp.getSolidColor()); CTTextParagraphProperties pr = _p.isSetPPr() ? _p.getPPr() : _p.addNewPPr(); CTColor c = pr.isSetBuClr() ? pr.getBuClr() : pr.addNewBuClr(); CTSRgbColor clr = c.isSetSrgbClr() ? c.getSrgbClr() : c.addNewSrgbClr(); clr.setVal(new byte[]{(byte) col.getRed(), (byte) col.getGreen(), (byte) col.getBlue()}); }
public void setFontColor(Color color){ CTTextCharacterProperties rPr = getRPr(); CTSolidColorFillProperties fill = rPr.isSetSolidFill() ? rPr.getSolidFill() : rPr.addNewSolidFill(); CTSRgbColor clr = fill.isSetSrgbClr() ? fill.getSrgbClr() : fill.addNewSrgbClr(); clr.setVal(new byte[]{(byte)color.getRed(), (byte)color.getGreen(), (byte)color.getBlue()}); 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(); }
@Override public void setLineStyleColor( int red, int green, int blue ) { CTShapeProperties props = getShapeProperties(); CTLineProperties ln = props.isSetLn() ? props.getLn() : props.addNewLn(); CTSolidColorFillProperties fill = ln.isSetSolidFill() ? ln.getSolidFill() : ln.addNewSolidFill(); CTSRgbColor rgb = CTSRgbColor.Factory.newInstance(); rgb.setVal(new byte[]{(byte)red, (byte)green, (byte)blue}); fill.setSrgbClr(rgb); }
rgb.setVal(rgbBytes); alphaPct = (addAlpha) ? rgb.addNewAlpha() : null; } else {
if (xlsColor.isSetRgb()) { CTSRgbColor clr = fill.isSetSrgbClr() ? fill.getSrgbClr() : fill.addNewSrgbClr(); clr.setVal(xlsColor.getRgb()); } else if (xlsColor.isSetIndexed()) { HSSFColor indexed = HSSFColor.getIndexHash().get((int) xlsColor.getIndexed()); rgb[2] = (byte) indexed.getTriplet()[2]; CTSRgbColor clr = fill.isSetSrgbClr() ? fill.getSrgbClr() : fill.addNewSrgbClr(); clr.setVal(rgb);
public void setValue(byte[] value) { color.setVal(value); }
/** * Set the color to be used on bullet characters within a given paragraph. * * @param color the bullet color */ public void setBulletFontColor(Color color){ CTTextParagraphProperties pr = _p.isSetPPr() ? _p.getPPr() : _p.addNewPPr(); CTColor c = pr.isSetBuClr() ? pr.getBuClr() : pr.addNewBuClr(); CTSRgbColor clr = c.isSetSrgbClr() ? c.getSrgbClr() : c.addNewSrgbClr(); clr.setVal(new byte[]{(byte) color.getRed(), (byte) color.getGreen(), (byte) color.getBlue()}); }
/** * Set the color to be used on bullet characters within a given paragraph. * * @param color the bullet color */ public void setBulletFontColor(Color color){ CTTextParagraphProperties pr = _p.isSetPPr() ? _p.getPPr() : _p.addNewPPr(); CTColor c = pr.isSetBuClr() ? pr.getBuClr() : pr.addNewBuClr(); CTSRgbColor clr = c.isSetSrgbClr() ? c.getSrgbClr() : c.addNewSrgbClr(); clr.setVal(new byte[]{(byte) color.getRed(), (byte) color.getGreen(), (byte) color.getBlue()}); }
/** * 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 */ @Override public void setFillColor(Color color) { CTTableCellProperties spPr = getXmlObject().getTcPr(); if (color == null) { if(spPr.isSetSolidFill()) spPr.unsetSolidFill(); } else { 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); } }
/** * Set the color to be used on bullet characters within a given paragraph. * * @param color the bullet color */ @SuppressWarnings("WeakerAccess") public void setBulletFontColor(PaintStyle color) { if (!(color instanceof SolidPaint)) { throw new IllegalArgumentException("Currently XSLF only supports SolidPaint"); } // TODO: implement setting bullet color to null SolidPaint sp = (SolidPaint)color; Color col = DrawPaint.applyColorTransform(sp.getSolidColor()); CTTextParagraphProperties pr = _p.isSetPPr() ? _p.getPPr() : _p.addNewPPr(); CTColor c = pr.isSetBuClr() ? pr.getBuClr() : pr.addNewBuClr(); CTSRgbColor clr = c.isSetSrgbClr() ? c.getSrgbClr() : c.addNewSrgbClr(); clr.setVal(new byte[]{(byte) col.getRed(), (byte) col.getGreen(), (byte) col.getBlue()}); }
@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); }
public void setFontColor(Color color){ CTTextCharacterProperties rPr = getRPr(); CTSolidColorFillProperties fill = rPr.isSetSolidFill() ? rPr.getSolidFill() : rPr.addNewSolidFill(); CTSRgbColor clr = fill.isSetSrgbClr() ? fill.getSrgbClr() : fill.addNewSrgbClr(); clr.setVal(new byte[]{(byte)color.getRed(), (byte)color.getGreen(), (byte)color.getBlue()}); 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(); }
public void setFontColor(Color color){ CTTextCharacterProperties rPr = getRPr(); CTSolidColorFillProperties fill = rPr.isSetSolidFill() ? rPr.getSolidFill() : rPr.addNewSolidFill(); CTSRgbColor clr = fill.isSetSrgbClr() ? fill.getSrgbClr() : fill.addNewSrgbClr(); clr.setVal(new byte[]{(byte)color.getRed(), (byte)color.getGreen(), (byte)color.getBlue()}); 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(); }
/** * The color applied to the lines of this shape. */ public void setLineStyleColor( int red, int green, int blue ) { CTShapeProperties props = getShapeProperties(); CTLineProperties ln = props.isSetLn() ? props.getLn() : props.addNewLn(); CTSolidColorFillProperties fill = ln.isSetSolidFill() ? ln.getSolidFill() : ln.addNewSolidFill(); CTSRgbColor rgb = CTSRgbColor.Factory.newInstance(); rgb.setVal(new byte[]{(byte)red, (byte)green, (byte)blue}); fill.setSrgbClr(rgb); }
@Override public void setLineStyleColor( int red, int green, int blue ) { CTShapeProperties props = getShapeProperties(); CTLineProperties ln = props.isSetLn() ? props.getLn() : props.addNewLn(); CTSolidColorFillProperties fill = ln.isSetSolidFill() ? ln.getSolidFill() : ln.addNewSolidFill(); CTSRgbColor rgb = CTSRgbColor.Factory.newInstance(); rgb.setVal(new byte[]{(byte)red, (byte)green, (byte)blue}); fill.setSrgbClr(rgb); }
private void setLineColor(CTLineProperties ln, Color color){ if(color == null){ ln.addNewNoFill(); if(ln.isSetSolidFill()) ln.unsetSolidFill(); } else { if(ln.isSetNoFill()) ln.unsetNoFill(); if(!ln.isSetPrstDash()) ln.addNewPrstDash().setVal(STPresetLineDashVal.SOLID); ln.setCmpd(STCompoundLine.SNG); ln.setAlgn(STPenAlignment.CTR); ln.setCap(STLineCap.FLAT); ln.addNewRound(); CTLineEndProperties hd = ln.addNewHeadEnd(); hd.setType(STLineEndType.NONE); hd.setW(STLineEndWidth.MED); hd.setLen(STLineEndLength.MED); CTLineEndProperties tl = ln.addNewTailEnd(); tl.setType(STLineEndType.NONE); tl.setW(STLineEndWidth.MED); tl.setLen(STLineEndLength.MED); CTSRgbColor rgb = CTSRgbColor.Factory.newInstance(); rgb.setVal(new byte[]{(byte)color.getRed(), (byte)color.getGreen(), (byte)color.getBlue()}); ln.addNewSolidFill().setSrgbClr(rgb); } }