org.apache.poi.xssf.usermodel.XSSFColor.setIndexed()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(6.9k)|赞(0)|评价(0)|浏览(363)

本文整理了Java中org.apache.poi.xssf.usermodel.XSSFColor.setIndexed()方法的一些代码示例,展示了XSSFColor.setIndexed()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XSSFColor.setIndexed()方法的具体详情如下:
包路径:org.apache.poi.xssf.usermodel.XSSFColor
类名称:XSSFColor
方法名:setIndexed

XSSFColor.setIndexed介绍

[英]Indexed ctColor value. Only used for backwards compatibility. References a ctColor in indexedColors.
[中]索引颜色值。仅用于向后兼容。在IndexedColor中引用ctColor。

代码示例

代码示例来源:origin: org.apache.poi/poi-ooxml

  1. /**
  2. * Set the color to use for the right border
  3. *
  4. * @param color the index of the color definition
  5. * @see org.apache.poi.ss.usermodel.IndexedColors
  6. */
  7. @Override
  8. public void setRightBorderColor(short color) {
  9. XSSFColor clr = XSSFColor.from(CTColor.Factory.newInstance(), _stylesSource.getIndexedColors());
  10. clr.setIndexed(color);
  11. setRightBorderColor(clr);
  12. }

代码示例来源:origin: org.apache.poi/poi-ooxml

  1. /**
  2. * Set the foreground fill color as a indexed color value
  3. * <br>
  4. * <i>Note: Ensure Foreground color is set prior to background color.</i>
  5. * @param fg the color to use
  6. * @see org.apache.poi.ss.usermodel.IndexedColors
  7. */
  8. @Override
  9. public void setFillForegroundColor(short fg) {
  10. XSSFColor clr = XSSFColor.from(CTColor.Factory.newInstance(), _stylesSource.getIndexedColors());
  11. clr.setIndexed(fg);
  12. setFillForegroundColor(clr);
  13. }

代码示例来源:origin: org.apache.poi/poi-ooxml

  1. /**
  2. * Set the color to use for the bottom border
  3. * @param color the index of the color definition
  4. * @see org.apache.poi.ss.usermodel.IndexedColors
  5. */
  6. @Override
  7. public void setBottomBorderColor(short color) {
  8. XSSFColor clr = XSSFColor.from(CTColor.Factory.newInstance(), _stylesSource.getIndexedColors());
  9. clr.setIndexed(color);
  10. setBottomBorderColor(clr);
  11. }

代码示例来源:origin: org.apache.poi/poi-ooxml

  1. /**
  2. * Set the color to use for the left border as a indexed color value
  3. *
  4. * @param color the index of the color definition
  5. * @see org.apache.poi.ss.usermodel.IndexedColors
  6. */
  7. @Override
  8. public void setLeftBorderColor(short color) {
  9. XSSFColor clr = XSSFColor.from(CTColor.Factory.newInstance(), _stylesSource.getIndexedColors());
  10. clr.setIndexed(color);
  11. setLeftBorderColor(clr);
  12. }

代码示例来源:origin: org.apache.poi/poi-ooxml

  1. /**
  2. * Set the color to use for the top border
  3. *
  4. * @param color the index of the color definition
  5. * @see org.apache.poi.ss.usermodel.IndexedColors
  6. */
  7. @Override
  8. public void setTopBorderColor(short color) {
  9. XSSFColor clr = XSSFColor.from(CTColor.Factory.newInstance(), _stylesSource.getIndexedColors());
  10. clr.setIndexed(color);
  11. setTopBorderColor(clr);
  12. }

代码示例来源:origin: org.apache.poi/poi-ooxml

  1. public void setFillBackgroundColor(short bg) {
  2. XSSFColor clr = XSSFColor.from(CTColor.Factory.newInstance(), _stylesSource.getIndexedColors());
  3. clr.setIndexed(bg);
  4. setFillBackgroundColor(clr);

代码示例来源:origin: org.openl.rules/org.openl.lib.poi.dev

  1. /**
  2. * Set the color to use for the bottom border
  3. * @param color the index of the color definition
  4. * @see org.apache.poi.ss.usermodel.IndexedColors
  5. */
  6. public void setBottomBorderColor(short color) {
  7. XSSFColor clr = new XSSFColor();
  8. clr.setIndexed(color);
  9. setBottomBorderColor(clr);
  10. }

代码示例来源:origin: org.openl.rules/org.openl.lib.poi.dev

  1. /**
  2. * Set the foreground fill color as a indexed color value
  3. * <br/>
  4. * <i>Note: Ensure Foreground color is set prior to background color.</i>
  5. * @param fg the color to use
  6. * @see org.apache.poi.ss.usermodel.IndexedColors
  7. */
  8. public void setFillForegroundColor(short fg) {
  9. XSSFColor clr = new XSSFColor();
  10. clr.setIndexed(fg);
  11. setFillForegroundColor(clr);
  12. }

代码示例来源:origin: org.openl.rules/org.openl.lib.poi.dev

  1. /**
  2. * Set the color to use for the left border as a indexed color value
  3. *
  4. * @param color the index of the color definition
  5. * @see org.apache.poi.ss.usermodel.IndexedColors
  6. */
  7. public void setLeftBorderColor(short color) {
  8. XSSFColor clr = new XSSFColor();
  9. clr.setIndexed(color);
  10. setLeftBorderColor(clr);
  11. }

代码示例来源:origin: org.openl.rules/org.openl.lib.poi.dev

  1. /**
  2. * Set the color to use for the top border
  3. *
  4. * @param color the index of the color definition
  5. * @see org.apache.poi.ss.usermodel.IndexedColors
  6. */
  7. public void setTopBorderColor(short color) {
  8. XSSFColor clr = new XSSFColor();
  9. clr.setIndexed(color);
  10. setTopBorderColor(clr);
  11. }

代码示例来源:origin: org.openl.rules/org.openl.lib.poi.dev

  1. /**
  2. * Set the color to use for the right border
  3. *
  4. * @param color the index of the color definition
  5. * @see org.apache.poi.ss.usermodel.IndexedColors
  6. */
  7. public void setRightBorderColor(short color) {
  8. XSSFColor clr = new XSSFColor();
  9. clr.setIndexed(color);
  10. setRightBorderColor(clr);
  11. }

代码示例来源:origin: org.openl.rules/org.openl.lib.poi.dev

  1. clr.setIndexed(bg);
  2. setFillBackgroundColor(clr);

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi

  1. /**
  2. * Set the color to use for the left border as a indexed color value
  3. *
  4. * @param color the index of the color definition
  5. * @see org.apache.poi.ss.usermodel.IndexedColors
  6. */
  7. @Override
  8. public void setLeftBorderColor(short color) {
  9. XSSFColor clr = XSSFColor.from(CTColor.Factory.newInstance(), _stylesSource.getIndexedColors());
  10. clr.setIndexed(color);
  11. setLeftBorderColor(clr);
  12. }

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi

  1. /**
  2. * Set the color to use for the top border
  3. *
  4. * @param color the index of the color definition
  5. * @see org.apache.poi.ss.usermodel.IndexedColors
  6. */
  7. @Override
  8. public void setTopBorderColor(short color) {
  9. XSSFColor clr = XSSFColor.from(CTColor.Factory.newInstance(), _stylesSource.getIndexedColors());
  10. clr.setIndexed(color);
  11. setTopBorderColor(clr);
  12. }

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi

  1. /**
  2. * Set the color to use for the bottom border
  3. * @param color the index of the color definition
  4. * @see org.apache.poi.ss.usermodel.IndexedColors
  5. */
  6. @Override
  7. public void setBottomBorderColor(short color) {
  8. XSSFColor clr = XSSFColor.from(CTColor.Factory.newInstance(), _stylesSource.getIndexedColors());
  9. clr.setIndexed(color);
  10. setBottomBorderColor(clr);
  11. }

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi

  1. /**
  2. * Set the color to use for the right border
  3. *
  4. * @param color the index of the color definition
  5. * @see org.apache.poi.ss.usermodel.IndexedColors
  6. */
  7. @Override
  8. public void setRightBorderColor(short color) {
  9. XSSFColor clr = XSSFColor.from(CTColor.Factory.newInstance(), _stylesSource.getIndexedColors());
  10. clr.setIndexed(color);
  11. setRightBorderColor(clr);
  12. }

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi

  1. /**
  2. * Set the foreground fill color as a indexed color value
  3. * <br>
  4. * <i>Note: Ensure Foreground color is set prior to background color.</i>
  5. * @param fg the color to use
  6. * @see org.apache.poi.ss.usermodel.IndexedColors
  7. */
  8. @Override
  9. public void setFillForegroundColor(short fg) {
  10. XSSFColor clr = XSSFColor.from(CTColor.Factory.newInstance(), _stylesSource.getIndexedColors());
  11. clr.setIndexed(fg);
  12. setFillForegroundColor(clr);
  13. }

代码示例来源:origin: caryyu/excel2pdf

  1. public static int getBorderRBG(Workbook wb , short index){
  2. int result = 0;
  3. if(wb instanceof HSSFWorkbook){
  4. HSSFWorkbook hwb = (HSSFWorkbook)wb;
  5. HSSFColor color = hwb.getCustomPalette().getColor(index);
  6. if(color != null){
  7. result = getRGB(color);
  8. }
  9. }
  10. if(wb instanceof XSSFWorkbook){
  11. XSSFColor color = new XSSFColor();
  12. color.setIndexed(index);
  13. result = getRGB(color);
  14. }
  15. return result;
  16. }

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi

  1. public void setFillBackgroundColor(short bg) {
  2. XSSFColor clr = XSSFColor.from(CTColor.Factory.newInstance(), _stylesSource.getIndexedColors());
  3. clr.setIndexed(bg);
  4. setFillBackgroundColor(clr);

相关文章