/** * set a boolean value for the boldness to use. If omitted, the default value is true. * * @param bold - boldness to use */ public void setBold(boolean bold) { if(bold){ CTBooleanProperty ctBold = _ctFont.sizeOfBArray() == 0 ? _ctFont.addNewB() : _ctFont.getBArray(0); ctBold.setVal(true); } else { _ctFont.setBArray(null); } }
/** * set font style options. * * @param italic - if true, set posture style to italic, otherwise to normal * @param bold if true, set font weight to bold, otherwise to normal */ @Override public void setFontStyle(boolean italic, boolean bold){ _font.setIArray(null); _font.setBArray(null); if(italic) _font.addNewI().setVal(true); if(bold) _font.addNewB().setVal(true); }
if(pr.sizeOfBArray() > 0) ctFont.addNewB().setVal(pr.getBArray(0).getVal()); if(pr.sizeOfUArray() > 0) ctFont.addNewU().setVal(pr.getUArray(0).getVal()); if(pr.sizeOfIArray() > 0) ctFont.addNewI().setVal(pr.getIArray(0).getVal());
/** * set a boolean value for the boldness to use. If omitted, the default value is true. * * @param bold - boldness to use */ public void setBold(boolean bold) { if(bold){ CTBooleanProperty ctBold = _ctFont.sizeOfBArray() == 0 ? _ctFont.addNewB() : _ctFont.getBArray(0); ctBold.setVal(bold); } else { _ctFont.setBArray(null); } }
/** * set a boolean value for the boldness to use. If omitted, the default value is true. * * @param bold - boldness to use */ public void setBold(boolean bold) { if(bold){ CTBooleanProperty ctBold = _ctFont.sizeOfBArray() == 0 ? _ctFont.addNewB() : _ctFont.getBArray(0); ctBold.setVal(true); } else { _ctFont.setBArray(null); } }
/** * set font style options. * * @param italic - if true, set posture style to italic, otherwise to normal * @param bold if true, set font weight to bold, otherwise to normal */ public void setFontStyle(boolean italic, boolean bold){ _font.setIArray(null); _font.setBArray(null); if(italic) _font.addNewI().setVal(true); if(bold) _font.addNewB().setVal(true); }
/** * set font style options. * * @param italic - if true, set posture style to italic, otherwise to normal * @param bold if true, set font weight to bold, otherwise to normal */ @Override public void setFontStyle(boolean italic, boolean bold){ _font.setIArray(null); _font.setBArray(null); if(italic) _font.addNewI().setVal(true); if(bold) _font.addNewB().setVal(true); }
bold.setFont(font); bold.setAlignment(HorizontalAlignment.CENTER); font.getCTFont().addNewB();
private void metricsHeader(final XSSFSheet sheet, final EvaluationMetadata metadata) { final XSSFRow header = sheet.createRow(1); final CellStyle bold = sheet.getWorkbook().createCellStyle(); final XSSFFont font = sheet.getWorkbook().createFont(); font.setBold(true); bold.setFont(font); bold.setAlignment(HorizontalAlignment.CENTER); font.getCTFont().addNewB(); final AtomicInteger counter = new AtomicInteger(0); metadata.metrics .forEach(name -> { final int columnIndex = 3 + (counter.getAndIncrement() * ((metadata.howManyVersions() * 2) - 1)); final Cell qgHeaderCell = header.createCell(columnIndex, CellType.STRING); qgHeaderCell.setCellValue(name); qgHeaderCell.setCellStyle(bold); try { sheet.addMergedRegion( new CellRangeAddress( header.getRowNum(), header.getRowNum(), columnIndex, columnIndex + ((metadata.howManyVersions() * 2) - 2))); } catch (final Exception ignore) { } }); }
CTFont ctFont = CTFont.Factory.newInstance(); if(pr.sizeOfBArray() > 0) ctFont.addNewB().setVal(pr.getBArray(0).getVal()); if(pr.sizeOfUArray() > 0) ctFont.addNewU().setVal(pr.getUArray(0).getVal()); if(pr.sizeOfIArray() > 0) ctFont.addNewI().setVal(pr.getIArray(0).getVal());
if(pr.sizeOfBArray() > 0) ctFont.addNewB().setVal(pr.getBArray(0).getVal()); if(pr.sizeOfUArray() > 0) ctFont.addNewU().setVal(pr.getUArray(0).getVal()); if(pr.sizeOfIArray() > 0) ctFont.addNewI().setVal(pr.getIArray(0).getVal());