@Override public boolean isSetSolidFill() { return props.isSetSolidFill(); }
/** * 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 = getCellProperties(true); if (color == null) { if (spPr.isSetSolidFill()) { spPr.unsetSolidFill(); } } else { CTSolidColorFillProperties fill = spPr.isSetSolidFill() ? spPr.getSolidFill() : spPr.addNewSolidFill(); XSLFColor c = new XSLFColor(fill, getSheet().getTheme(), fill.getSchemeClr()); c.setColor(color); } }
@Override public boolean isSetSolidFill() { return props.isSetSolidFill(); }
/** * 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); } }
/** * * @return solid fill color of null if not set */ @Override public Color getFillColor(){ CTTableCellProperties spPr = getXmlObject().getTcPr(); if(!spPr.isSetSolidFill() ) return null; CTSolidColorFillProperties fill = spPr.getSolidFill(); if(!fill.isSetSrgbClr()) { // TODO for now return null for all colors except explicit RGB return null; } byte[] val = fill.getSrgbClr().getVal(); return new Color(0xFF & val[0], 0xFF & val[1], 0xFF & val[2]); }
/** * 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 = getCellProperties(true); if (color == null) { if (spPr.isSetSolidFill()) { spPr.unsetSolidFill(); } } else { CTSolidColorFillProperties fill = spPr.isSetSolidFill() ? spPr.getSolidFill() : spPr.addNewSolidFill(); XSLFColor c = new XSLFColor(fill, getSheet().getTheme(), fill.getSchemeClr()); c.setColor(color); } }