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

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

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

public void setFont(HSSFFont font) {
  _format.setIndentNotParentFont(true);
  short fontindex = font.getIndex();
  _format.setFontIndex(fontindex);
}

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

public boolean equals(Object o)
{
  StyleInfo s = (StyleInfo) o;
  return s.mode == mode
      && s.backcolor == backcolor
      && s.horizontalAlignment == horizontalAlignment
      && s.verticalAlignment == verticalAlignment
      && s.rotation == rotation
      && (s.font == null ? font == null : (font != null && s.font.getIndex() == font.getIndex()))
      && (s.box == null ? box == null : (box != null && s.box.equals(box)))
      && s.rotation == rotation;
}

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

/**
 * Applies a font to the specified characters of a string.
 *
 * @param startIndex    The start index to apply the font to (inclusive)
 * @param endIndex      The end index to apply to font to (exclusive)
 * @param font          The index of the font to use.
 */
public void applyFont(int startIndex, int endIndex, Font font)
{
  applyFont(startIndex, endIndex, ((HSSFFont) font).getIndex());
}

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

protected int computeHash()
{
  int hash = mode;
  hash = 31*hash + backcolor;
  hash = 31*hash + horizontalAlignment;
  hash = 31*hash + verticalAlignment;
  hash = 31*hash + rotation;
  hash = 31*hash + (font == null ? 0 : font.getIndex());
  hash = 31*hash + (box == null ? 0 : box.hashCode());
  hash = 31*hash + dataFormat;
  return hash;
}

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

/**
 * Applies a font to the specified characters of a string.
 *
 * @param startIndex    The start index to apply the font to (inclusive)
 * @param endIndex      The end index to apply to font to (exclusive)
 * @param font          The index of the font to use.
 */
public void applyFont(int startIndex, int endIndex, Font font)
{
  applyFont(startIndex, endIndex, ((HSSFFont) font).getIndex());
}

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

public void setFont(HSSFFont font) {
  _format.setIndentNotParentFont(true);
  short fontindex = font.getIndex();
  _format.setFontIndex(fontindex);
}

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

public void setFont(HSSFFont font) {
  _format.setIndentNotParentFont(true);
  short fontindex = font.getIndex();
  _format.setFontIndex(fontindex);
}

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

public void setFont(HSSFFont font) {
  _format.setIndentNotParentFont(true);
  short fontindex = font.getIndex();
  _format.setFontIndex(fontindex);
}

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

private FontMetrics getFontMetrics(HSSFFont hf){
  FontMetrics fm;
  Short pFont = hf.getIndex();
  fm = fontMetrics.get(pFont);
  if (fm == null) {
    int style;
    if (hf.getBold() || hf.getItalic()) {
      style = 0;
      if (hf.getBold()) style ^= Font.BOLD;
      if (hf.getItalic()) style ^= Font.ITALIC;
    } else {
      style = Font.PLAIN;
    }
    Font f = new java.awt.Font(hf.getFontName(), style, hf.getFontHeightInPoints());
    if (graphics == null) {
      BufferedImage i = new BufferedImage(1, 1, BufferedImage.TYPE_BYTE_GRAY);
      graphics = i.createGraphics();
    }
    fm = graphics.getFontMetrics(f);
    fontMetrics.put(pFont, fm);
  }
  return fm;
}

相关文章