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

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

本文整理了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

/**
 * Set the color to use for the right border
 *
 * @param color the index of the color definition
 * @see org.apache.poi.ss.usermodel.IndexedColors
 */
@Override
public void setRightBorderColor(short color) {
  XSSFColor clr = XSSFColor.from(CTColor.Factory.newInstance(), _stylesSource.getIndexedColors());
  clr.setIndexed(color);
  setRightBorderColor(clr);
}

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

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

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

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

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

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

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

/**
 * Set the color to use for the top border
 *
 * @param color the index of the color definition
 * @see org.apache.poi.ss.usermodel.IndexedColors
 */
@Override
public void setTopBorderColor(short color) {
  XSSFColor clr = XSSFColor.from(CTColor.Factory.newInstance(), _stylesSource.getIndexedColors());
  clr.setIndexed(color);
  setTopBorderColor(clr);
}

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

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

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

/**
 * Set the color to use for the bottom border
 * @param color the index of the color definition
 * @see org.apache.poi.ss.usermodel.IndexedColors
 */
public void setBottomBorderColor(short color) {
  XSSFColor clr = new XSSFColor();
  clr.setIndexed(color);
  setBottomBorderColor(clr);
}

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

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

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

/**
 * Set the color to use for the left border as a indexed color value
 *
 * @param color the index of the color definition
 * @see org.apache.poi.ss.usermodel.IndexedColors
 */
public void setLeftBorderColor(short color) {
  XSSFColor clr = new XSSFColor();
  clr.setIndexed(color);
  setLeftBorderColor(clr);
}

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

/**
 * Set the color to use for the top border
 *
 * @param color the index of the color definition
 * @see org.apache.poi.ss.usermodel.IndexedColors
 */
public void setTopBorderColor(short color) {
  XSSFColor clr = new XSSFColor();
  clr.setIndexed(color);
  setTopBorderColor(clr);
}

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

/**
 * Set the color to use for the right border
 *
 * @param color the index of the color definition
 * @see org.apache.poi.ss.usermodel.IndexedColors
 */
public void setRightBorderColor(short color) {
  XSSFColor clr = new XSSFColor();
  clr.setIndexed(color);
  setRightBorderColor(clr);
}

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

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

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

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

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

/**
 * Set the color to use for the top border
 *
 * @param color the index of the color definition
 * @see org.apache.poi.ss.usermodel.IndexedColors
 */
@Override
public void setTopBorderColor(short color) {
  XSSFColor clr = XSSFColor.from(CTColor.Factory.newInstance(), _stylesSource.getIndexedColors());
  clr.setIndexed(color);
  setTopBorderColor(clr);
}

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

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

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

/**
 * Set the color to use for the right border
 *
 * @param color the index of the color definition
 * @see org.apache.poi.ss.usermodel.IndexedColors
 */
@Override
public void setRightBorderColor(short color) {
  XSSFColor clr = XSSFColor.from(CTColor.Factory.newInstance(), _stylesSource.getIndexedColors());
  clr.setIndexed(color);
  setRightBorderColor(clr);
}

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

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

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

public static int getBorderRBG(Workbook wb  , short index){
  int result = 0;
  if(wb instanceof HSSFWorkbook){
    HSSFWorkbook hwb = (HSSFWorkbook)wb;
    HSSFColor color =  hwb.getCustomPalette().getColor(index);
    if(color != null){
      result = getRGB(color);
    }
  }
  if(wb instanceof XSSFWorkbook){
    XSSFColor color = new XSSFColor();
    color.setIndexed(index);
    result = getRGB(color);
  }
  return result;
}

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

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

相关文章