/** * @param color font color index */ @Override public void setFontColorIndex(short color){ _font.setColorArray(null); if(color != -1){ _font.addNewColor().setIndexed(color); } }
/** * set the theme color for the font to use * * @param theme - theme color to use */ public void setThemeColor(short theme) { CTColor ctColor = _ctFont.sizeOfColorArray() == 0 ? _ctFont.addNewColor() : _ctFont.getColorArray(0); ctColor.setTheme(theme); }
@Override public void setFontColor(Color color) { XSSFColor xcolor = XSSFColor.toXSSFColor(color); if (xcolor == null) { _font.getColorList().clear(); } else if(_font.sizeOfColorArray() == 0) { _font.addNewColor().setRgb(xcolor.getRGB()); } else { _font.setColorArray(0, xcolor.getCTColor()); } }
/** * set the color for the font in Standard Alpha Red Green Blue color value * * @param color - color to use */ public void setColor(XSSFColor color) { if(color == null) _ctFont.setColorArray(null); else { CTColor ctColor = _ctFont.sizeOfColorArray() == 0 ? _ctFont.addNewColor() : _ctFont.getColorArray(0); if (ctColor.isSetIndexed()) { ctColor.unsetIndexed(); } ctColor.setRgb(color.getRGB()); } }
/** * set the indexed color for the font * * @param color - color to use * @see #DEFAULT_FONT_COLOR - Note: default font color * @see IndexedColors */ public void setColor(short color) { CTColor ctColor = _ctFont.sizeOfColorArray() == 0 ? _ctFont.addNewColor() : _ctFont.getColorArray(0); switch (color) { case Font.COLOR_NORMAL: { ctColor.setIndexed(XSSFFont.DEFAULT_FONT_COLOR); break; } case Font.COLOR_RED: { ctColor.setIndexed(IndexedColors.RED.getIndex()); break; } default: ctColor.setIndexed(color); } }
if(pr.sizeOfColorArray() > 0) { CTColor c1 = pr.getColorArray(0); CTColor c2 = ctFont.addNewColor(); if(c1.isSetAuto()) c2.setAuto(c1.getAuto()); if(c1.isSetIndexed()) c2.setIndexed(c1.getIndexed());
/** * @param color font color index */ public void setFontColorIndex(short color){ _font.setColorArray(null); if(color != -1){ _font.addNewColor().setIndexed(color); } }
/** * @param color font color index */ @Override public void setFontColorIndex(short color){ _font.setColorArray(null); if(color != -1){ _font.addNewColor().setIndexed(color); } }
/** * set the theme color for the font to use * * @param theme - theme color to use */ public void setThemeColor(short theme) { CTColor ctColor = _ctFont.sizeOfColorArray() == 0 ? _ctFont.addNewColor() : _ctFont.getColorArray(0); ctColor.setTheme(theme); }
/** * set the theme color for the font to use * * @param theme - theme color to use */ public void setThemeColor(short theme) { CTColor ctColor = _ctFont.sizeOfColorArray() == 0 ? _ctFont.addNewColor() : _ctFont.getColorArray(0); ctColor.setTheme(theme); }
@Override public void setFontColor(Color color) { XSSFColor xcolor = XSSFColor.toXSSFColor(color); if (xcolor == null) { _font.getColorList().clear(); } else if(_font.sizeOfColorArray() == 0) { _font.addNewColor().setRgb(xcolor.getRGB()); } else { _font.setColorArray(0, xcolor.getCTColor()); } }
/** * set the color for the font in Standard Alpha Red Green Blue color value * * @param color - color to use */ public void setColor(XSSFColor color) { if(color == null) _ctFont.setColorArray(null); else { CTColor ctColor = _ctFont.sizeOfColorArray() == 0 ? _ctFont.addNewColor() : _ctFont.getColorArray(0); ctColor.setRgb(color.getRgb()); } }
/** * set the indexed color for the font * * @param color - color to use * @see #DEFAULT_FONT_COLOR - Note: default font color * @see IndexedColors */ public void setColor(short color) { CTColor ctColor = _ctFont.sizeOfColorArray() == 0 ? _ctFont.addNewColor() : _ctFont.getColorArray(0); switch (color) { case Font.COLOR_NORMAL: { ctColor.setIndexed(XSSFFont.DEFAULT_FONT_COLOR); break; } case Font.COLOR_RED: { ctColor.setIndexed(IndexedColors.RED.getIndex()); break; } default: ctColor.setIndexed(color); } }
/** * set the indexed color for the font * * @param color - color to use * @see #DEFAULT_FONT_COLOR - Note: default font color * @see IndexedColors */ public void setColor(short color) { CTColor ctColor = _ctFont.sizeOfColorArray() == 0 ? _ctFont.addNewColor() : _ctFont.getColorArray(0); switch (color) { case Font.COLOR_NORMAL: { ctColor.setIndexed(XSSFFont.DEFAULT_FONT_COLOR); break; } case Font.COLOR_RED: { ctColor.setIndexed(IndexedColors.RED.getIndex()); break; } default: ctColor.setIndexed(color); } }
/** * set the color for the font in Standard Alpha Red Green Blue color value * * @param color - color to use */ public void setColor(XSSFColor color) { if(color == null) _ctFont.setColorArray(null); else { CTColor ctColor = _ctFont.sizeOfColorArray() == 0 ? _ctFont.addNewColor() : _ctFont.getColorArray(0); if (ctColor.isSetIndexed()) { ctColor.unsetIndexed(); } ctColor.setRgb(color.getRGB()); } }
if(pr.sizeOfColorArray() > 0) { CTColor c1 = pr.getColorArray(0); CTColor c2 = ctFont.addNewColor(); if(c1.isSetAuto()) c2.setAuto(c1.getAuto()); if(c1.isSetIndexed()) c2.setIndexed(c1.getIndexed());
if(pr.sizeOfColorArray() > 0) { CTColor c1 = pr.getColorArray(0); CTColor c2 = ctFont.addNewColor(); if(c1.isSetAuto()) c2.setAuto(c1.getAuto()); if(c1.isSetIndexed()) c2.setIndexed(c1.getIndexed());