org.apache.poi.ss.usermodel.CellStyle.getFontIndexAsInt()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(3.9k)|赞(0)|评价(0)|浏览(453)

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

CellStyle.getFontIndexAsInt介绍

[英]gets the index of the font for this style
[中]获取此样式的字体索引

代码示例

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

  1. cellType = cell.getCachedFormulaResultType();
  2. Font font = wb.getFontAt(style.getFontIndexAsInt());

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

  1. put(properties, FILL_FOREGROUND_COLOR, style.getFillForegroundColor());
  2. put(properties, FILL_BACKGROUND_COLOR, style.getFillBackgroundColor());
  3. put(properties, FONT, style.getFontIndexAsInt());
  4. put(properties, HIDDEN, style.getHidden());
  5. put(properties, INDENTION, style.getIndention());

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

  1. private void fontStyle(CellStyle style) {
  2. Font font = wb.getFontAt(style.getFontIndexAsInt());
  3. if (font.getBold()) {
  4. out.format(" font-weight: bold;%n");
  5. }
  6. if (font.getItalic()) {
  7. out.format(" font-style: italic;%n");
  8. }
  9. int fontheight = font.getFontHeightInPoints();
  10. if (fontheight == 9) {
  11. //fix for stupid ol Windows
  12. fontheight = 10;
  13. }
  14. out.format(" font-size: %dpt;%n", fontheight);
  15. // Font color is handled with the other colors
  16. }

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

  1. @Override
  2. public ICellFont getFont(int row, int column) {
  3. Font font = workbook.getFontAt(getCell(row, column).getCellStyle().getFontIndexAsInt());
  4. return new XlsCellFont(font, workbook);
  5. }

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

  1. public static Font getCellFont(Cell cell) {
  2. Font font = null;
  3. if (cell != null) {
  4. CellStyle style = cell.getCellStyle();
  5. int fontIndex = style.getFontIndexAsInt();
  6. font = cell.getSheet().getWorkbook().getFontAt(fontIndex);
  7. }
  8. return font;
  9. }

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

  1. System.out.print("BG=" + renderColor(style.getFillBackgroundColorColor()) + " ");
  2. Font font = wb.getFontAt(style.getFontIndexAsInt());
  3. System.out.print("Font=" + font.getFontName() + " ");
  4. System.out.print("FontColor=");

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

  1. public ICellFont getFont() {
  2. Cell cell = getCell();
  3. if (cell == null) return null;
  4. Font font = gridModel.getSheetSource().getSheet().getWorkbook().getFontAt(cell.getCellStyle().getFontIndexAsInt());
  5. return new XlsCellFont(font, gridModel.getSheetSource().getSheet().getWorkbook());
  6. }

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

  1. cellType = cell.getCachedFormulaResultType();
  2. Font font = wb.getFontAt(style.getFontIndexAsInt());

代码示例来源:origin: apache/metamodel

  1. final int fontIndex = cellStyle.getFontIndexAsInt();
  2. final Font font = workbook.getFontAt(fontIndex);
  3. final StyleBuilder styleBuilder = new StyleBuilder();

代码示例来源:origin: org.apache.metamodel/MetaModel-excel

  1. final int fontIndex = cellStyle.getFontIndexAsInt();
  2. final Font font = workbook.getFontAt(fontIndex);
  3. final StyleBuilder styleBuilder = new StyleBuilder();

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

  1. public static Font cloneFontFrom(Cell cell) {
  2. Font newFont = null;
  3. if (cell != null) {
  4. Workbook workbook = cell.getSheet().getWorkbook();
  5. newFont = workbook.createFont();
  6. int fontIndex = cell.getCellStyle().getFontIndexAsInt();
  7. Font fromFont = workbook.getFontAt(fontIndex);
  8. newFont.setBold(fromFont.getBold());
  9. newFont.setColor(fromFont.getColor());
  10. newFont.setFontHeight(fromFont.getFontHeight());
  11. newFont.setFontName(fromFont.getFontName());
  12. newFont.setItalic(fromFont.getItalic());
  13. newFont.setStrikeout(fromFont.getStrikeout());
  14. newFont.setTypeOffset(fromFont.getTypeOffset());
  15. newFont.setUnderline(fromFont.getUnderline());
  16. newFont.setCharSet(fromFont.getCharSet());
  17. }
  18. return newFont;
  19. }

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

  1. put(properties, FILL_FOREGROUND_COLOR, style.getFillForegroundColor());
  2. put(properties, FILL_BACKGROUND_COLOR, style.getFillBackgroundColor());
  3. put(properties, FONT, style.getFontIndexAsInt());
  4. put(properties, HIDDEN, style.getHidden());
  5. put(properties, INDENTION, style.getIndention());

相关文章