本文整理了Java中org.apache.poi.hssf.usermodel.HSSFFont.<init>()
方法的一些代码示例,展示了HSSFFont.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HSSFFont.<init>()
方法的具体详情如下:
包路径:org.apache.poi.hssf.usermodel.HSSFFont
类名称:HSSFFont
方法名:<init>
[英]Creates a new instance of HSSFFont
[中]创建HSSFFont的新实例
代码示例来源:origin: org.apache.poi/poi
@Override
public HSSFFont getFontAt(int idx) {
if(fonts == null) {
fonts = new HashMap<>();
}
// So we don't confuse users, give them back
// the same object every time, but create
// them lazily
Integer sIdx = idx;
if(fonts.containsKey(sIdx)) {
return fonts.get(sIdx);
}
FontRecord font = workbook.getFontRecordAt(idx);
HSSFFont retval = new HSSFFont(idx, font);
fonts.put(sIdx, retval);
return retval;
}
代码示例来源:origin: org.apache.poi/poi
public void cloneStyleFrom(HSSFCellStyle source) {
// First we need to clone the extended format
// record
_format.cloneStyleFrom(source._format);
// Handle matching things if we cross workbooks
if(_workbook != source._workbook) {
lastDateFormat.set(Short.MIN_VALUE);
lastFormats.set(null);
getDataFormatStringCache.set(null);
// Then we need to clone the format string,
// and update the format record for this
short fmt = (short)_workbook.createFormat(source.getDataFormatString() );
setDataFormat(fmt);
// Finally we need to clone the font,
// and update the format record for this
FontRecord fr = _workbook.createNewFont();
fr.cloneStyleFrom(
source._workbook.getFontRecordAt(
source.getFontIndexAsInt()
)
);
HSSFFont font = new HSSFFont(
(short)_workbook.getFontIndex(fr), fr
);
setFont(font);
}
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi
@Override
public HSSFFont getFontAt(int idx) {
if(fonts == null) {
fonts = new HashMap<>();
}
// So we don't confuse users, give them back
// the same object every time, but create
// them lazily
Integer sIdx = idx;
if(fonts.containsKey(sIdx)) {
return fonts.get(sIdx);
}
FontRecord font = workbook.getFontRecordAt(idx);
HSSFFont retval = new HSSFFont(idx, font);
fonts.put(sIdx, retval);
return retval;
}
代码示例来源:origin: com.haulmont.thirdparty/poi
/**
* Get the font at the given index number
* @param idx index number
* @return HSSFFont at the index
*/
public HSSFFont getFontAt(short idx) {
if(fonts == null) fonts = new Hashtable();
// So we don't confuse users, give them back
// the same object every time, but create
// them lazily
Short sIdx = Short.valueOf(idx);
if(fonts.containsKey(sIdx)) {
return (HSSFFont)fonts.get(sIdx);
}
FontRecord font = workbook.getFontRecordAt(idx);
HSSFFont retval = new HSSFFont(idx, font);
fonts.put(sIdx, retval);
return retval;
}
代码示例来源:origin: org.openl.rules/org.openl.lib.poi.dev
/**
* Get the font at the given index number
* @param idx index number
* @return HSSFFont at the index
*/
public HSSFFont getFontAt(short idx) {
if(fonts == null) fonts = new Hashtable();
// So we don't confuse users, give them back
// the same object every time, but create
// them lazily
Short sIdx = Short.valueOf(idx);
if(fonts.containsKey(sIdx)) {
return (HSSFFont)fonts.get(sIdx);
}
FontRecord font = workbook.getFontRecordAt(idx);
HSSFFont retval = new HSSFFont(idx, font);
fonts.put(sIdx, retval);
return retval;
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi
public void cloneStyleFrom(HSSFCellStyle source) {
// First we need to clone the extended format
// record
_format.cloneStyleFrom(source._format);
// Handle matching things if we cross workbooks
if(_workbook != source._workbook) {
lastDateFormat.set(Short.MIN_VALUE);
lastFormats.set(null);
getDataFormatStringCache.set(null);
// Then we need to clone the format string,
// and update the format record for this
short fmt = (short)_workbook.createFormat(source.getDataFormatString() );
setDataFormat(fmt);
// Finally we need to clone the font,
// and update the format record for this
FontRecord fr = _workbook.createNewFont();
fr.cloneStyleFrom(
source._workbook.getFontRecordAt(
source.getFontIndexAsInt()
)
);
HSSFFont font = new HSSFFont(
(short)_workbook.getFontIndex(fr), fr
);
setFont(font);
}
}
代码示例来源:origin: com.haulmont.thirdparty/poi
public void cloneFontFrom(HSSFCellStyle source) {
// Handle matching things if we cross workbooks
if(_workbook != source._workbook) {
// Finally we need to clone the font,
// and update the format record for this
FontRecord fr = _workbook.createNewFont();
fr.cloneStyleFrom(
source._workbook.getFontRecordAt(
source.getFontIndex()
)
);
HSSFFont font = new HSSFFont(
(short)_workbook.getFontIndex(fr), fr
);
setFont(font);
}
}
代码示例来源:origin: com.haulmont.thirdparty/poi
public void cloneStyleFrom(HSSFCellStyle source) {
// First we need to clone the extended format
// record
_format.cloneStyleFrom(source._format);
// Handle matching things if we cross workbooks
if(_workbook != source._workbook) {
// Then we need to clone the format string,
// and update the format record for this
short fmt = (short)_workbook.createFormat(source.getDataFormatString() );
setDataFormat(fmt);
// Finally we need to clone the font,
// and update the format record for this
FontRecord fr = _workbook.createNewFont();
fr.cloneStyleFrom(
source._workbook.getFontRecordAt(
source.getFontIndex()
)
);
HSSFFont font = new HSSFFont(
(short)_workbook.getFontIndex(fr), fr
);
setFont(font);
}
}
代码示例来源:origin: org.openl.rules/org.openl.lib.poi.dev
public void cloneStyleFrom(HSSFCellStyle source) {
// First we need to clone the extended format
// record
_format.cloneStyleFrom(source._format);
// Handle matching things if we cross workbooks
if(_workbook != source._workbook) {
// Then we need to clone the format string,
// and update the format record for this
short fmt = (short)_workbook.createFormat(source.getDataFormatString() );
setDataFormat(fmt);
// Finally we need to clone the font,
// and update the format record for this
FontRecord fr = _workbook.createNewFont();
fr.cloneStyleFrom(
source._workbook.getFontRecordAt(
source.getFontIndex()
)
);
HSSFFont font = new HSSFFont(
(short)_workbook.getFontIndex(fr), fr
);
setFont(font);
}
}
内容来源于网络,如有侵权,请联系作者删除!