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

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

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

XSSFColor.equals介绍

暂无

代码示例

代码示例来源:origin: kiegroup/optaplanner

  1. protected XSSFColor extractColor(XSSFCell cell, XSSFColor... acceptableColors) {
  2. XSSFCellStyle cellStyle = cell.getCellStyle();
  3. FillPatternType fillPattern = cellStyle.getFillPatternEnum();
  4. if (fillPattern == null || fillPattern == FillPatternType.NO_FILL) {
  5. return null;
  6. }
  7. if (fillPattern != FillPatternType.SOLID_FOREGROUND) {
  8. throw new IllegalStateException(currentPosition() + ": The fill pattern (" + fillPattern
  9. + ") should be either " + FillPatternType.NO_FILL
  10. + " or " + FillPatternType.SOLID_FOREGROUND + ".");
  11. }
  12. XSSFColor color = cellStyle.getFillForegroundColorColor();
  13. for (XSSFColor acceptableColor : acceptableColors) {
  14. if (acceptableColor.equals(color)) {
  15. return acceptableColor;
  16. }
  17. }
  18. throw new IllegalStateException(currentPosition() + ": The fill color (" + color
  19. + ") is not one of the acceptableColors (" + Arrays.toString(acceptableColors) + ").");
  20. }
  21. }

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

  1. /**
  2. * Finds a font that matches the one with the supplied attributes,
  3. * where color is the actual Color-value, not the indexed color
  4. */
  5. public XSSFFont findFont(boolean bold, Color color, short fontHeight, String name, boolean italic, boolean strikeout, short typeOffset, byte underline) {
  6. for (XSSFFont font : fonts) {
  7. if ( (font.getBold() == bold)
  8. && font.getXSSFColor().equals(color)
  9. && font.getFontHeight() == fontHeight
  10. && font.getFontName().equals(name)
  11. && font.getItalic() == italic
  12. && font.getStrikeout() == strikeout
  13. && font.getTypeOffset() == typeOffset
  14. && font.getUnderline() == underline)
  15. {
  16. return font;
  17. }
  18. }
  19. return null;
  20. }

代码示例来源:origin: org.optaplanner/optaplanner-examples

  1. protected XSSFColor extractColor(XSSFCell cell, XSSFColor... acceptableColors) {
  2. XSSFCellStyle cellStyle = cell.getCellStyle();
  3. FillPatternType fillPattern = cellStyle.getFillPatternEnum();
  4. if (fillPattern == null || fillPattern == FillPatternType.NO_FILL) {
  5. return null;
  6. }
  7. if (fillPattern != FillPatternType.SOLID_FOREGROUND) {
  8. throw new IllegalStateException(currentPosition() + ": The fill pattern (" + fillPattern
  9. + ") should be either " + FillPatternType.NO_FILL
  10. + " or " + FillPatternType.SOLID_FOREGROUND + ".");
  11. }
  12. XSSFColor color = cellStyle.getFillForegroundColorColor();
  13. for (XSSFColor acceptableColor : acceptableColors) {
  14. if (acceptableColor.equals(color)) {
  15. return acceptableColor;
  16. }
  17. }
  18. throw new IllegalStateException(currentPosition() + ": The fill color (" + color
  19. + ") is not one of the acceptableColors (" + Arrays.toString(acceptableColors) + ").");
  20. }
  21. }

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

  1. /**
  2. * Finds a font that matches the one with the supplied attributes,
  3. * where color is the actual Color-value, not the indexed color
  4. */
  5. public XSSFFont findFont(boolean bold, Color color, short fontHeight, String name, boolean italic, boolean strikeout, short typeOffset, byte underline) {
  6. for (XSSFFont font : fonts) {
  7. if ( (font.getBold() == bold)
  8. && font.getXSSFColor().equals(color)
  9. && font.getFontHeight() == fontHeight
  10. && font.getFontName().equals(name)
  11. && font.getItalic() == italic
  12. && font.getStrikeout() == strikeout
  13. && font.getTypeOffset() == typeOffset
  14. && font.getUnderline() == underline)
  15. {
  16. return font;
  17. }
  18. }
  19. return null;
  20. }

代码示例来源:origin: openl-tablets/openl-tablets

  1. if (font == null || color != null && !font.getXSSFColor().equals(color) ||
  2. color == null && font.getXSSFColor().getIndexed() != indexedColor) {
  3. font = workbook.createFont();

代码示例来源:origin: org.openl.rules/org.openl.rules.webstudio

  1. if (font == null || color != null && !font.getXSSFColor().equals(color) ||
  2. color == null && font.getXSSFColor().getIndexed() != indexedColor) {
  3. font = workbook.createFont();

相关文章