本文整理了Java中org.apache.poi.hssf.usermodel.HSSFWorkbook.getNumberOfFontsAsInt()
方法的一些代码示例,展示了HSSFWorkbook.getNumberOfFontsAsInt()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HSSFWorkbook.getNumberOfFontsAsInt()
方法的具体详情如下:
包路径:org.apache.poi.hssf.usermodel.HSSFWorkbook
类名称:HSSFWorkbook
方法名:getNumberOfFontsAsInt
暂无
代码示例来源:origin: org.apache.poi/poi
@Override
@Deprecated
public short getNumberOfFonts() {
return (short)getNumberOfFontsAsInt();
}
代码示例来源:origin: org.apache.poi/poi
/**
* create a new Font and add it to the workbook's font table
* @return new font object
*/
@Override
public HSSFFont createFont()
{
/*FontRecord font =*/ workbook.createNewFont();
int fontindex = getNumberOfFontsAsInt() - 1;
if (fontindex > 3)
{
fontindex++; // THERE IS NO FOUR!!
}
if(fontindex >= Short.MAX_VALUE){
throw new IllegalArgumentException("Maximum number of fonts was exceeded");
}
// Ask getFontAt() to build it for us,
// so it gets properly cached
return getFontAt(fontindex);
}
代码示例来源:origin: org.apache.poi/poi
/**
* Finds a font that matches the one with the supplied attributes
*/
@Override
public HSSFFont findFont(boolean bold, short color, short fontHeight,
String name, boolean italic, boolean strikeout,
short typeOffset, byte underline)
{
int numberOfFonts = getNumberOfFontsAsInt();
for (int i = 0; i <= numberOfFonts; i++) {
// Remember - there is no 4!
if(i == 4) {
continue;
}
HSSFFont hssfFont = getFontAt(i);
if (hssfFont.getBold() == bold
&& hssfFont.getColor() == color
&& hssfFont.getFontHeight() == fontHeight
&& hssfFont.getFontName().equals(name)
&& hssfFont.getItalic() == italic
&& hssfFont.getStrikeout() == strikeout
&& hssfFont.getTypeOffset() == typeOffset
&& hssfFont.getUnderline() == underline)
{
return hssfFont;
}
}
return null;
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi
@Override
@Deprecated
public short getNumberOfFonts() {
return (short)getNumberOfFontsAsInt();
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi
/**
* create a new Font and add it to the workbook's font table
* @return new font object
*/
@Override
public HSSFFont createFont()
{
/*FontRecord font =*/ workbook.createNewFont();
int fontindex = getNumberOfFontsAsInt() - 1;
if (fontindex > 3)
{
fontindex++; // THERE IS NO FOUR!!
}
if(fontindex >= Short.MAX_VALUE){
throw new IllegalArgumentException("Maximum number of fonts was exceeded");
}
// Ask getFontAt() to build it for us,
// so it gets properly cached
return getFontAt(fontindex);
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi
/**
* Finds a font that matches the one with the supplied attributes
*/
@Override
public HSSFFont findFont(boolean bold, short color, short fontHeight,
String name, boolean italic, boolean strikeout,
short typeOffset, byte underline)
{
int numberOfFonts = getNumberOfFontsAsInt();
for (int i = 0; i <= numberOfFonts; i++) {
// Remember - there is no 4!
if(i == 4) {
continue;
}
HSSFFont hssfFont = getFontAt(i);
if (hssfFont.getBold() == bold
&& hssfFont.getColor() == color
&& hssfFont.getFontHeight() == fontHeight
&& hssfFont.getFontName().equals(name)
&& hssfFont.getItalic() == italic
&& hssfFont.getStrikeout() == strikeout
&& hssfFont.getTypeOffset() == typeOffset
&& hssfFont.getUnderline() == underline)
{
return hssfFont;
}
}
return null;
}
内容来源于网络,如有侵权,请联系作者删除!