org.apache.poi.hssf.usermodel.HSSFFont.getUnderline()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(4.7k)|赞(0)|评价(0)|浏览(194)

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

HSSFFont.getUnderline介绍

[英]get type of text underlining to use
[中]获取要使用的文本下划线类型

代码示例

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

  1. /**
  2. * Finds a font that matches the one with the supplied attributes
  3. */
  4. @Override
  5. public HSSFFont findFont(boolean bold, short color, short fontHeight,
  6. String name, boolean italic, boolean strikeout,
  7. short typeOffset, byte underline)
  8. {
  9. int numberOfFonts = getNumberOfFontsAsInt();
  10. for (int i = 0; i <= numberOfFonts; i++) {
  11. // Remember - there is no 4!
  12. if(i == 4) {
  13. continue;
  14. }
  15. HSSFFont hssfFont = getFontAt(i);
  16. if (hssfFont.getBold() == bold
  17. && hssfFont.getColor() == color
  18. && hssfFont.getFontHeight() == fontHeight
  19. && hssfFont.getFontName().equals(name)
  20. && hssfFont.getItalic() == italic
  21. && hssfFont.getStrikeout() == strikeout
  22. && hssfFont.getTypeOffset() == typeOffset
  23. && hssfFont.getUnderline() == underline)
  24. {
  25. return hssfFont;
  26. }
  27. }
  28. return null;
  29. }

代码示例来源:origin: QihooTest/Leo

  1. byte underline = cell.getCellStyle().getFont(workbook).getUnderline();
  2. if (underline == 1) {
  3. primaryKeyList.add(columnName);

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

  1. /**
  2. * Finds a font that matches the one with the supplied attributes
  3. */
  4. public HSSFFont findFont(short boldWeight, short color, short fontHeight,
  5. String name, boolean italic, boolean strikeout,
  6. short typeOffset, byte underline)
  7. {
  8. for (short i=0; i<=getNumberOfFonts(); i++) {
  9. // Remember - there is no 4!
  10. if(i == 4) continue;
  11. HSSFFont hssfFont = getFontAt(i);
  12. if (hssfFont.getBoldweight() == boldWeight
  13. && hssfFont.getColor() == color
  14. && hssfFont.getFontHeight() == fontHeight
  15. && hssfFont.getFontName().equals(name)
  16. && hssfFont.getItalic() == italic
  17. && hssfFont.getStrikeout() == strikeout
  18. && hssfFont.getTypeOffset() == typeOffset
  19. && hssfFont.getUnderline() == underline)
  20. {
  21. return hssfFont;
  22. }
  23. }
  24. return null;
  25. }

代码示例来源:origin: com.haulmont.thirdparty/poi

  1. /**
  2. * Finds a font that matches the one with the supplied attributes
  3. */
  4. public HSSFFont findFont(short boldWeight, short color, short fontHeight,
  5. String name, boolean italic, boolean strikeout,
  6. short typeOffset, byte underline)
  7. {
  8. for (short i=0; i<=getNumberOfFonts(); i++) {
  9. // Remember - there is no 4!
  10. if(i == 4) continue;
  11. HSSFFont hssfFont = getFontAt(i);
  12. if (hssfFont.getBoldweight() == boldWeight
  13. && hssfFont.getColor() == color
  14. && hssfFont.getFontHeight() == fontHeight
  15. && hssfFont.getFontName().equals(name)
  16. && hssfFont.getItalic() == italic
  17. && hssfFont.getStrikeout() == strikeout
  18. && hssfFont.getTypeOffset() == typeOffset
  19. && hssfFont.getUnderline() == underline)
  20. {
  21. return hssfFont;
  22. }
  23. }
  24. return null;
  25. }

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

  1. /**
  2. * Finds a font that matches the one with the supplied attributes
  3. */
  4. @Override
  5. public HSSFFont findFont(boolean bold, short color, short fontHeight,
  6. String name, boolean italic, boolean strikeout,
  7. short typeOffset, byte underline)
  8. {
  9. int numberOfFonts = getNumberOfFontsAsInt();
  10. for (int i = 0; i <= numberOfFonts; i++) {
  11. // Remember - there is no 4!
  12. if(i == 4) {
  13. continue;
  14. }
  15. HSSFFont hssfFont = getFontAt(i);
  16. if (hssfFont.getBold() == bold
  17. && hssfFont.getColor() == color
  18. && hssfFont.getFontHeight() == fontHeight
  19. && hssfFont.getFontName().equals(name)
  20. && hssfFont.getItalic() == italic
  21. && hssfFont.getStrikeout() == strikeout
  22. && hssfFont.getTypeOffset() == typeOffset
  23. && hssfFont.getUnderline() == underline)
  24. {
  25. return hssfFont;
  26. }
  27. }
  28. return null;
  29. }

代码示例来源:origin: stackoverflow.com

  1. fontNew.setStrikeout(fontOld.getStrikeout());
  2. fontNew.setTypeOffset(fontOld.getTypeOffset());
  3. fontNew.setUnderline(fontOld.getUnderline());
  4. return fontNew;

代码示例来源:origin: jasperreports/jasperreports

  1. (cf.getColor() == forecolor) &&
  2. (cf.getFontHeightInPoints() == fontSize) &&
  3. ((cf.getUnderline() == HSSFFont.U_SINGLE)?(font.isUnderline()):(!font.isUnderline())) &&
  4. (cf.getStrikeout() == font.isStrikeThrough()) &&
  5. ((cf.getBoldweight() == HSSFFont.BOLDWEIGHT_BOLD)?(font.isBold()):(!font.isBold())) &&

代码示例来源:origin: cuba-platform/yarg

  1. newFont.setCharSet(cellFont.getCharSet());
  2. newFont.setColor(cellFont.getColor());
  3. newFont.setUnderline(cellFont.getUnderline());
  4. newFont.setFontHeight(cellFont.getFontHeight());
  5. newFont.setFontHeightInPoints(cellFont.getFontHeightInPoints());

代码示例来源:origin: com.haulmont.yarg/yarg

  1. newFont.setCharSet(cellFont.getCharSet());
  2. newFont.setColor(cellFont.getColor());
  3. newFont.setUnderline(cellFont.getUnderline());
  4. newFont.setFontHeight(cellFont.getFontHeight());
  5. newFont.setFontHeightInPoints(cellFont.getFontHeightInPoints());

代码示例来源:origin: com.bstek.ureport/ureport2-console

  1. style.setItalic(true);
  2. if(font.getUnderline()!=Font.U_NONE){
  3. style.setUnderline(true);

相关文章