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

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

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

HSSFFont.getIndex介绍

[英]get the index within the HSSFWorkbook (sequence within the collection of Font objects)
[中]获取HSSF工作簿中的索引(字体对象集合中的顺序)

代码示例

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

  1. public void setFont(HSSFFont font) {
  2. _format.setIndentNotParentFont(true);
  3. short fontindex = font.getIndex();
  4. _format.setFontIndex(fontindex);
  5. }

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

  1. public boolean equals(Object o)
  2. {
  3. StyleInfo s = (StyleInfo) o;
  4. return s.mode == mode
  5. && s.backcolor == backcolor
  6. && s.horizontalAlignment == horizontalAlignment
  7. && s.verticalAlignment == verticalAlignment
  8. && s.rotation == rotation
  9. && (s.font == null ? font == null : (font != null && s.font.getIndex() == font.getIndex()))
  10. && (s.box == null ? box == null : (box != null && s.box.equals(box)))
  11. && s.rotation == rotation;
  12. }

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

  1. /**
  2. * Applies a font to the specified characters of a string.
  3. *
  4. * @param startIndex The start index to apply the font to (inclusive)
  5. * @param endIndex The end index to apply to font to (exclusive)
  6. * @param font The index of the font to use.
  7. */
  8. public void applyFont(int startIndex, int endIndex, Font font)
  9. {
  10. applyFont(startIndex, endIndex, ((HSSFFont) font).getIndex());
  11. }

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

  1. protected int computeHash()
  2. {
  3. int hash = mode;
  4. hash = 31*hash + backcolor;
  5. hash = 31*hash + horizontalAlignment;
  6. hash = 31*hash + verticalAlignment;
  7. hash = 31*hash + rotation;
  8. hash = 31*hash + (font == null ? 0 : font.getIndex());
  9. hash = 31*hash + (box == null ? 0 : box.hashCode());
  10. hash = 31*hash + dataFormat;
  11. return hash;
  12. }

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

  1. /**
  2. * Applies a font to the specified characters of a string.
  3. *
  4. * @param startIndex The start index to apply the font to (inclusive)
  5. * @param endIndex The end index to apply to font to (exclusive)
  6. * @param font The index of the font to use.
  7. */
  8. public void applyFont(int startIndex, int endIndex, Font font)
  9. {
  10. applyFont(startIndex, endIndex, ((HSSFFont) font).getIndex());
  11. }

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

  1. public void setFont(HSSFFont font) {
  2. _format.setIndentNotParentFont(true);
  3. short fontindex = font.getIndex();
  4. _format.setFontIndex(fontindex);
  5. }

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

  1. public void setFont(HSSFFont font) {
  2. _format.setIndentNotParentFont(true);
  3. short fontindex = font.getIndex();
  4. _format.setFontIndex(fontindex);
  5. }

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

  1. public void setFont(HSSFFont font) {
  2. _format.setIndentNotParentFont(true);
  3. short fontindex = font.getIndex();
  4. _format.setFontIndex(fontindex);
  5. }

代码示例来源:origin: com.haulmont.cuba/cuba-gui

  1. private FontMetrics getFontMetrics(HSSFFont hf){
  2. FontMetrics fm;
  3. Short pFont = hf.getIndex();
  4. fm = fontMetrics.get(pFont);
  5. if (fm == null) {
  6. int style;
  7. if (hf.getBold() || hf.getItalic()) {
  8. style = 0;
  9. if (hf.getBold()) style ^= Font.BOLD;
  10. if (hf.getItalic()) style ^= Font.ITALIC;
  11. } else {
  12. style = Font.PLAIN;
  13. }
  14. Font f = new java.awt.Font(hf.getFontName(), style, hf.getFontHeightInPoints());
  15. if (graphics == null) {
  16. BufferedImage i = new BufferedImage(1, 1, BufferedImage.TYPE_BYTE_GRAY);
  17. graphics = i.createGraphics();
  18. }
  19. fm = graphics.getFontMetrics(f);
  20. fontMetrics.put(pFont, fm);
  21. }
  22. return fm;
  23. }

相关文章