@Override public CTSolidColorFillProperties addNewSolidFill() { return props.addNewSolidFill(); }
@Override public void setBorderColor(BorderEdge edge, Color color) { if (color == null) { throw new IllegalArgumentException("Colors need to be specified."); } CTLineProperties ln = setBorderDefaults(edge); CTSolidColorFillProperties fill = ln.addNewSolidFill(); XSLFColor c = new XSLFColor(fill, getSheet().getTheme(), fill.getSchemeClr()); c.setColor(color); }
@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); }
/** * @param color the color to paint the shape outline. * A <code>null</code> value turns off the shape outline. */ public void setLineColor(Color color) { CTLineProperties ln = getLn(this, true); if (ln == null) { return; } if (ln.isSetSolidFill()) { ln.unsetSolidFill(); } if (ln.isSetGradFill()) { ln.unsetGradFill(); } if (ln.isSetPattFill()) { ln.unsetPattFill(); } if (ln.isSetNoFill()) { ln.unsetNoFill(); } if (color == null) { ln.addNewNoFill(); } else { CTSolidColorFillProperties fill = ln.addNewSolidFill(); XSLFColor col = new XSLFColor(fill, getSheet().getTheme(), fill.getSchemeClr()); col.setColor(color); } }
@Override public CTSolidColorFillProperties addNewSolidFill() { return props.addNewSolidFill(); }
@Override public void setBorderColor(BorderEdge edge, Color color) { if (color == null) { throw new IllegalArgumentException("Colors need to be specified."); } CTLineProperties ln = setBorderDefaults(edge); CTSolidColorFillProperties fill = ln.addNewSolidFill(); XSLFColor c = new XSLFColor(fill, getSheet().getTheme(), fill.getSchemeClr()); c.setColor(color); }
@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); }
/** * 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); }
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); } }
/** * @param color the color to paint the shape outline. * A <code>null</code> value turns off the shape outline. */ public void setLineColor(Color color) { CTShapeProperties spPr = getSpPr(); if (color == null) { if (spPr.isSetLn() && spPr.getLn().isSetSolidFill()) spPr.getLn().unsetSolidFill(); } else { CTLineProperties ln = spPr.isSetLn() ? spPr.getLn() : spPr .addNewLn(); CTSRgbColor rgb = CTSRgbColor.Factory.newInstance(); rgb.setVal(new byte[]{(byte) color.getRed(), (byte) color.getGreen(), (byte) color.getBlue()}); CTSolidColorFillProperties fill = ln.isSetSolidFill() ? ln .getSolidFill() : ln.addNewSolidFill(); 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(); } }
/** * @param color the color to paint the shape outline. * A <code>null</code> value turns off the shape outline. */ public void setLineColor(Color color) { CTLineProperties ln = getLn(this, true); if (ln == null) { return; } if (ln.isSetSolidFill()) { ln.unsetSolidFill(); } if (ln.isSetGradFill()) { ln.unsetGradFill(); } if (ln.isSetPattFill()) { ln.unsetPattFill(); } if (ln.isSetNoFill()) { ln.unsetNoFill(); } if (color == null) { ln.addNewNoFill(); } else { CTSolidColorFillProperties fill = ln.addNewSolidFill(); XSLFColor col = new XSLFColor(fill, getSheet().getTheme(), fill.getSchemeClr()); col.setColor(color); } }