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

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

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

HSSFFont.<init>介绍

[英]Creates a new instance of HSSFFont
[中]创建HSSFFont的新实例

代码示例

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

  1. @Override
  2. public HSSFFont getFontAt(int idx) {
  3. if(fonts == null) {
  4. fonts = new HashMap<>();
  5. }
  6. // So we don't confuse users, give them back
  7. // the same object every time, but create
  8. // them lazily
  9. Integer sIdx = idx;
  10. if(fonts.containsKey(sIdx)) {
  11. return fonts.get(sIdx);
  12. }
  13. FontRecord font = workbook.getFontRecordAt(idx);
  14. HSSFFont retval = new HSSFFont(idx, font);
  15. fonts.put(sIdx, retval);
  16. return retval;
  17. }

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

  1. public void cloneStyleFrom(HSSFCellStyle source) {
  2. // First we need to clone the extended format
  3. // record
  4. _format.cloneStyleFrom(source._format);
  5. // Handle matching things if we cross workbooks
  6. if(_workbook != source._workbook) {
  7. lastDateFormat.set(Short.MIN_VALUE);
  8. lastFormats.set(null);
  9. getDataFormatStringCache.set(null);
  10. // Then we need to clone the format string,
  11. // and update the format record for this
  12. short fmt = (short)_workbook.createFormat(source.getDataFormatString() );
  13. setDataFormat(fmt);
  14. // Finally we need to clone the font,
  15. // and update the format record for this
  16. FontRecord fr = _workbook.createNewFont();
  17. fr.cloneStyleFrom(
  18. source._workbook.getFontRecordAt(
  19. source.getFontIndexAsInt()
  20. )
  21. );
  22. HSSFFont font = new HSSFFont(
  23. (short)_workbook.getFontIndex(fr), fr
  24. );
  25. setFont(font);
  26. }
  27. }

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

  1. @Override
  2. public HSSFFont getFontAt(int idx) {
  3. if(fonts == null) {
  4. fonts = new HashMap<>();
  5. }
  6. // So we don't confuse users, give them back
  7. // the same object every time, but create
  8. // them lazily
  9. Integer sIdx = idx;
  10. if(fonts.containsKey(sIdx)) {
  11. return fonts.get(sIdx);
  12. }
  13. FontRecord font = workbook.getFontRecordAt(idx);
  14. HSSFFont retval = new HSSFFont(idx, font);
  15. fonts.put(sIdx, retval);
  16. return retval;
  17. }

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

  1. /**
  2. * Get the font at the given index number
  3. * @param idx index number
  4. * @return HSSFFont at the index
  5. */
  6. public HSSFFont getFontAt(short idx) {
  7. if(fonts == null) fonts = new Hashtable();
  8. // So we don't confuse users, give them back
  9. // the same object every time, but create
  10. // them lazily
  11. Short sIdx = Short.valueOf(idx);
  12. if(fonts.containsKey(sIdx)) {
  13. return (HSSFFont)fonts.get(sIdx);
  14. }
  15. FontRecord font = workbook.getFontRecordAt(idx);
  16. HSSFFont retval = new HSSFFont(idx, font);
  17. fonts.put(sIdx, retval);
  18. return retval;
  19. }

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

  1. /**
  2. * Get the font at the given index number
  3. * @param idx index number
  4. * @return HSSFFont at the index
  5. */
  6. public HSSFFont getFontAt(short idx) {
  7. if(fonts == null) fonts = new Hashtable();
  8. // So we don't confuse users, give them back
  9. // the same object every time, but create
  10. // them lazily
  11. Short sIdx = Short.valueOf(idx);
  12. if(fonts.containsKey(sIdx)) {
  13. return (HSSFFont)fonts.get(sIdx);
  14. }
  15. FontRecord font = workbook.getFontRecordAt(idx);
  16. HSSFFont retval = new HSSFFont(idx, font);
  17. fonts.put(sIdx, retval);
  18. return retval;
  19. }

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

  1. public void cloneStyleFrom(HSSFCellStyle source) {
  2. // First we need to clone the extended format
  3. // record
  4. _format.cloneStyleFrom(source._format);
  5. // Handle matching things if we cross workbooks
  6. if(_workbook != source._workbook) {
  7. lastDateFormat.set(Short.MIN_VALUE);
  8. lastFormats.set(null);
  9. getDataFormatStringCache.set(null);
  10. // Then we need to clone the format string,
  11. // and update the format record for this
  12. short fmt = (short)_workbook.createFormat(source.getDataFormatString() );
  13. setDataFormat(fmt);
  14. // Finally we need to clone the font,
  15. // and update the format record for this
  16. FontRecord fr = _workbook.createNewFont();
  17. fr.cloneStyleFrom(
  18. source._workbook.getFontRecordAt(
  19. source.getFontIndexAsInt()
  20. )
  21. );
  22. HSSFFont font = new HSSFFont(
  23. (short)_workbook.getFontIndex(fr), fr
  24. );
  25. setFont(font);
  26. }
  27. }

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

  1. public void cloneFontFrom(HSSFCellStyle source) {
  2. // Handle matching things if we cross workbooks
  3. if(_workbook != source._workbook) {
  4. // Finally we need to clone the font,
  5. // and update the format record for this
  6. FontRecord fr = _workbook.createNewFont();
  7. fr.cloneStyleFrom(
  8. source._workbook.getFontRecordAt(
  9. source.getFontIndex()
  10. )
  11. );
  12. HSSFFont font = new HSSFFont(
  13. (short)_workbook.getFontIndex(fr), fr
  14. );
  15. setFont(font);
  16. }
  17. }

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

  1. public void cloneStyleFrom(HSSFCellStyle source) {
  2. // First we need to clone the extended format
  3. // record
  4. _format.cloneStyleFrom(source._format);
  5. // Handle matching things if we cross workbooks
  6. if(_workbook != source._workbook) {
  7. // Then we need to clone the format string,
  8. // and update the format record for this
  9. short fmt = (short)_workbook.createFormat(source.getDataFormatString() );
  10. setDataFormat(fmt);
  11. // Finally we need to clone the font,
  12. // and update the format record for this
  13. FontRecord fr = _workbook.createNewFont();
  14. fr.cloneStyleFrom(
  15. source._workbook.getFontRecordAt(
  16. source.getFontIndex()
  17. )
  18. );
  19. HSSFFont font = new HSSFFont(
  20. (short)_workbook.getFontIndex(fr), fr
  21. );
  22. setFont(font);
  23. }
  24. }

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

  1. public void cloneStyleFrom(HSSFCellStyle source) {
  2. // First we need to clone the extended format
  3. // record
  4. _format.cloneStyleFrom(source._format);
  5. // Handle matching things if we cross workbooks
  6. if(_workbook != source._workbook) {
  7. // Then we need to clone the format string,
  8. // and update the format record for this
  9. short fmt = (short)_workbook.createFormat(source.getDataFormatString() );
  10. setDataFormat(fmt);
  11. // Finally we need to clone the font,
  12. // and update the format record for this
  13. FontRecord fr = _workbook.createNewFont();
  14. fr.cloneStyleFrom(
  15. source._workbook.getFontRecordAt(
  16. source.getFontIndex()
  17. )
  18. );
  19. HSSFFont font = new HSSFFont(
  20. (short)_workbook.getFontIndex(fr), fr
  21. );
  22. setFont(font);
  23. }
  24. }

相关文章