当前位置: 首页>>代码示例>>Java>>正文


Java WritableFont.BOLD属性代码示例

本文整理汇总了Java中jxl.write.WritableFont.BOLD属性的典型用法代码示例。如果您正苦于以下问题:Java WritableFont.BOLD属性的具体用法?Java WritableFont.BOLD怎么用?Java WritableFont.BOLD使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在jxl.write.WritableFont的用法示例。


在下文中一共展示了WritableFont.BOLD属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setExcelListTitle

/**
 * 设置报表内容头
 * 
 * @param listTitle
 *            报表头
 * @throws IOException
 * @throws WriteException
 */
@Deprecated
public void setExcelListTitle(String[] listTitle) throws WriteException, IOException {
    try {
        irow++;
        long start = System.currentTimeMillis();
        wfont = new WritableFont(WritableFont.createFont("宋体"), 10, WritableFont.BOLD, false,
            UnderlineStyle.NO_UNDERLINE, jxl.format.Colour.BLACK);
        wcfFC = new WritableCellFormat(wfont);
        wcfFC.setBorder(Border.ALL, BorderLineStyle.MEDIUM);
        wcfFC.setAlignment(Alignment.CENTRE);// 对齐方式
        wcfFC.setVerticalAlignment(VerticalAlignment.CENTRE);// 对齐方式
        for (int i = icol; i < listTitle.length; i++) {
            wsheet.addCell(new Label(i, irow, listTitle[i], wcfFC));
        }
        trow = irow;
        logger.info("title use time:" + (System.currentTimeMillis() - start));
    } catch (Exception e) {
        this.close();
    }
}
 
开发者ID:iBase4J,项目名称:iBase4J-Common,代码行数:28,代码来源:DownloadExcelUtil.java

示例2: ExportTLDToXLS

public static void ExportTLDToXLS(String filename, ArrayList<Object> data) throws IOException {
    try {
        WritableFont titleFont = new WritableFont(WritableFont.ARIAL, 10, WritableFont.BOLD, true);
        WritableCellFormat titleformat = new WritableCellFormat(titleFont);
        WritableWorkbook workbook = Workbook.createWorkbook(new File(filename));
        WritableSheet sheet = workbook.createSheet("TLD Expand", 0);
        sheet.addCell(new Label(0, 0, "Domain name", titleformat));
        sheet.addCell(new Label(1, 0, "Name server", titleformat));
        sheet.addCell(new Label(2, 0, "Admin name", titleformat));
        sheet.addCell(new Label(3, 0, "Registrant", titleformat));
        int nextRow = 1;
        Iterator i = data.iterator();
        while (i.hasNext()) {
            DomainResult res = (DomainResult) i.next();
            sheet.addCell(new Label(0, nextRow, res.getDomainName()));
            sheet.addCell(new Label(1, nextRow, res.getNameServer()));
            sheet.addCell(new Label(2, nextRow, res.getAdminName()));
            sheet.addCell(new Label(3, nextRow, res.getRegistrant()));
            nextRow++;
        }
        workbook.write();
        workbook.close();
    } catch (WriteException ex) {
        Logger.getLogger("resultExport.ExportForwardLookupsToXLS").log(Level.SEVERE, null, ex);
    }
}
 
开发者ID:sensepost,项目名称:yeti,代码行数:26,代码来源:ResultExport.java

示例3: ExportCertToXLS

public static void ExportCertToXLS(String filename, ArrayList<Object> data) throws IOException {
    try {
        WritableFont titleFont = new WritableFont(WritableFont.ARIAL, 10, WritableFont.BOLD, true);
        WritableCellFormat titleformat = new WritableCellFormat(titleFont);
        WritableWorkbook workbook = Workbook.createWorkbook(new File(filename));
        WritableSheet sheet = workbook.createSheet("SSLCert CN", 0);
        sheet.addCell(new Label(0, 0, "IP address", titleformat));
        sheet.addCell(new Label(1, 0, "Host name", titleformat));
        sheet.addCell(new Label(2, 0, "Domain name", titleformat));
        int nextRow = 1;
        Iterator i = data.iterator();
        while (i.hasNext()) {
            CertResult res = (CertResult) i.next();
            sheet.addCell(new Label(0, nextRow, res.getIpAddress()));
            sheet.addCell(new Label(1, nextRow, res.getHostName()));
            sheet.addCell(new Label(2, nextRow, res.getDomainName()));
            nextRow++;
        }
        workbook.write();
        workbook.close();
    } catch (WriteException ex) {
        Logger.getLogger("resultExport.ExportForwardLookupsToXLS").log(Level.SEVERE, null, ex);
    }
}
 
开发者ID:sensepost,项目名称:yeti,代码行数:24,代码来源:ResultExport.java

示例4: setReportTitle

/**
 * 设置报表标题
 * 
 * @param reportTitle
 *            报表标题
 * @throws IOException
 * @throws WriteException
 * @throws WriteException
 */
public void setReportTitle(String reportTitle) throws WriteException, IOException {
    try {
        irow++;
        wfont = new WritableFont(WritableFont.createFont("宋体"), 12, WritableFont.BOLD, false,
            UnderlineStyle.NO_UNDERLINE, jxl.format.Colour.BLACK);
        wcfFC = new WritableCellFormat(wfont);
        wcfFC.setAlignment(Alignment.CENTRE);// 对齐方式
        // wcfFC.setBackground(jxl.format.Colour.VERY_LIGHT_YELLOW);// 背景色
        wcfFC.setVerticalAlignment(VerticalAlignment.CENTRE);// 对齐方式
        // wcfFC.setBorder(Border.ALL, BorderLineStyle.MEDIUM,
        // Colour.BLACK);//
        // 边框
        wsheet.addCell(new Label(icol, irow, reportTitle, wcfFC));
        trow = irow;
    } catch (Exception e) {
        this.close();
    }
}
 
开发者ID:iBase4J,项目名称:iBase4J-Common,代码行数:27,代码来源:DownloadExcelUtil.java

示例5: setExcelListTitle

/**
 * 设置报表内容头
 * 
 * @param listTitle
 *            报表头
 * @throws IOException
 * @throws WriteException
 */
@Deprecated
public void setExcelListTitle(String[] listTitle) throws WriteException, IOException {
    try {
        irow++;
        long start = System.currentTimeMillis();
        wfont = new WritableFont(WritableFont.createFont("宋体"), 10, WritableFont.BOLD, false,
            UnderlineStyle.NO_UNDERLINE, jxl.format.Colour.BLACK);
        wcfFC = new WritableCellFormat(wfont);
        wcfFC.setBorder(Border.ALL, BorderLineStyle.MEDIUM);
        wcfFC.setAlignment(Alignment.CENTRE);// 对齐方式
        wcfFC.setVerticalAlignment(VerticalAlignment.CENTRE);// 对齐方式
        for (int i = icol; i < listTitle.length; i++) {
            wsheet.addCell(new Label(i, irow, listTitle[i], wcfFC));
        }
        trow = irow;
        log.info("title use time:" + (System.currentTimeMillis() - start));
    } catch (Exception e) {
        this.close();
    }
}
 
开发者ID:guokezheng,项目名称:automat,代码行数:28,代码来源:DownloadExcelUtil.java

示例6: format

/**
 * 单元格的格式设置 字体大小 颜色 对齐方式、背景颜色等...
 */
public static void format() {
    try {
        arial14font = new WritableFont(WritableFont.ARIAL, 14, WritableFont.BOLD);
        arial14font.setColour(jxl.format.Colour.LIGHT_BLUE);
        arial14format = new WritableCellFormat(arial14font);
        arial14format.setAlignment(jxl.format.Alignment.CENTRE);
        arial14format.setBorder(jxl.format.Border.ALL,jxl.format.BorderLineStyle.THIN);
        arial14format.setBackground(jxl.format.Colour.VERY_LIGHT_YELLOW);

        arial10font = new WritableFont(WritableFont.ARIAL, 10, WritableFont.BOLD);
        arial10format = new WritableCellFormat(arial10font);
        arial10format.setAlignment(jxl.format.Alignment.CENTRE);
        arial10format.setBorder(jxl.format.Border.ALL,jxl.format.BorderLineStyle.THIN);
        arial10format.setBackground(Colour.GRAY_25);

        arial12font = new WritableFont(WritableFont.ARIAL, 10);
        arial12format = new WritableCellFormat(arial12font);
        arial10format.setAlignment(jxl.format.Alignment.CENTRE);//对齐格式
        arial12format.setBorder(jxl.format.Border.ALL,jxl.format.BorderLineStyle.THIN); //设置边框

    } catch (WriteException e) {
        e.printStackTrace();
    }
}
 
开发者ID:HowieTianDev,项目名称:ChenYan,代码行数:27,代码来源:ExcelUtils.java

示例7: format

public static void format() {
    try {
        arial14font = new WritableFont(WritableFont.ARIAL, 14, WritableFont.BOLD);
        arial14font.setColour(jxl.format.Colour.LIGHT_BLUE);
        arial14format = new WritableCellFormat(arial14font);
        arial14format.setAlignment(jxl.format.Alignment.CENTRE);
        arial14format.setBorder(jxl.format.Border.ALL, jxl.format.BorderLineStyle.THIN);
        arial14format.setBackground(jxl.format.Colour.VERY_LIGHT_YELLOW);
        arial10font = new WritableFont(WritableFont.ARIAL, 10, WritableFont.BOLD);
        arial10format = new WritableCellFormat(arial10font);
        arial10format.setAlignment(jxl.format.Alignment.CENTRE);
        arial10format.setBorder(jxl.format.Border.ALL, jxl.format.BorderLineStyle.THIN);
        arial10format.setBackground(jxl.format.Colour.LIGHT_BLUE);
        arial12font = new WritableFont(WritableFont.ARIAL, 12);
        arial12format = new WritableCellFormat(arial12font);
        arial12format.setBorder(jxl.format.Border.ALL, jxl.format.BorderLineStyle.THIN);
    } catch (WriteException e) {

        e.printStackTrace();
    }
}
 
开发者ID:qiu-yongheng,项目名称:Bluetooth_BLE,代码行数:21,代码来源:ExcelUtils.java

示例8: getHeader

public static WritableCellFormat getHeader() {
	WritableFont font = new WritableFont(WritableFont.TIMES, 10,
			WritableFont.BOLD);// 定义字体
	try {
		font.setColour(Colour.BLUE);// 蓝色字体
	} catch (WriteException e1) {
		e1.printStackTrace();
	}
	WritableCellFormat format = new WritableCellFormat(font);
	try {
		format.setAlignment(jxl.format.Alignment.CENTRE);// 左右居中
		format.setVerticalAlignment(jxl.format.VerticalAlignment.CENTRE);// 上下居中
		// format.setBorder(Border.ALL, BorderLineStyle.THIN,
		// Colour.BLACK);// 黑色边框
		// format.setBackground(Colour.YELLOW);// 黄色背景
	} catch (WriteException e) {
		e.printStackTrace();
	}
	return format;
}
 
开发者ID:reallin,项目名称:Android_Excel,代码行数:20,代码来源:ExcelUtil.java

示例9: addColumnName

public void addColumnName(String... columnNames) throws WriteException {
	int columnCount = this.sheet.getColumns();
	// System.err.println("columnCount:" + columnCount);
	for (int i = 0; i < columnNames.length; i++) {
		// 通过函数WritableFont()设置字体样式
		// 第一个参数表示所选字体
		// 第二个参数表示字体大小
		// 第三个参数表示粗体样式,有BOLD和NORMAL两种样式
		// 第四个参数表示是否斜体,此处true表示为斜体
		// 第五个参数表示下划线样式
		// 第六个参数表示颜色样式,此处为Red
		WritableFont wf = new WritableFont(WritableFont.TIMES, 11, WritableFont.BOLD);
		CellFormat cf = new WritableCellFormat(wf);
		Label label = new Label(i + columnCount, 0, columnNames[i], cf);
		sheet.addCell(label);
	}
}
 
开发者ID:tanhaichao,项目名称:leopard,代码行数:17,代码来源:ExcelView.java

示例10: writeCell

/**
 * @param columnPosition - column to place new cell in
 * @param rowPosition - row to place new cell in
 * @param contents - string value to place in cell
 * @param headerCell - whether to give this cell special formatting
 * @param sheet - WritableSheet to place cell in
 * @throws RowsExceededException - thrown if adding cell exceeds .xls row limit
 * @throws WriteException - Idunno, might be thrown
 */
public void writeCell(int columnPosition, int rowPosition, String contents, boolean headerCell,
    WritableSheet sheet) throws RowsExceededException, WriteException{
    //create a new cell with contents at position
    Label newCell = new Label(columnPosition,rowPosition,contents);
 
    if (headerCell){
        //give header cells size 10 Arial bolded 	
        WritableFont headerFont = new WritableFont(WritableFont.ARIAL, 10, WritableFont.BOLD);
        WritableCellFormat headerFormat = new WritableCellFormat(headerFont);
        //center align the cells' contents
        headerFormat.setAlignment(Alignment.CENTRE);
        newCell.setCellFormat(headerFormat);
    }
 
    sheet.addCell(newCell);
}
 
开发者ID:jonathanbsilva,项目名称:Phonegap-XLS-Plugin,代码行数:25,代码来源:Xls.java

示例11: ExportForwardLookupsToXLS

public static void ExportForwardLookupsToXLS(String filename, List<Object> data) throws IOException {
    try {
        WritableFont titleFont = new WritableFont(WritableFont.ARIAL, 10, WritableFont.BOLD, true);
        WritableCellFormat titleformat = new WritableCellFormat(titleFont);
        WritableWorkbook workbook = Workbook.createWorkbook(new File(filename));
        WritableSheet sheet = workbook.createSheet("Forward lookups", 0);
        sheet.addCell(new Label(0, 0, "Domain name", titleformat));
        sheet.addCell(new Label(1, 0, "Host name", titleformat));
        sheet.addCell(new Label(2, 0, "IP address", titleformat));
        sheet.addCell(new Label(3, 0, "Type", titleformat));
        int nextRow = 1;
        Iterator i = data.iterator();
        while (i.hasNext()) {
            ForwardLookupResult res = (ForwardLookupResult) i.next();
            sheet.addCell(new Label(0, nextRow, res.getDomainName()));
            sheet.addCell(new Label(1, nextRow, res.getHostName()));
            sheet.addCell(new Label(2, nextRow, res.getIpAddress()));
            sheet.addCell(new Label(3, nextRow, res.getLookupType()));
            nextRow++;
        }
        workbook.write();
        workbook.close();
    } catch (WriteException ex) {
        Logger.getLogger("resultExport.ExportForwardLookupsToXLS").log(Level.SEVERE, null, ex);
    }
}
 
开发者ID:sensepost,项目名称:yeti,代码行数:26,代码来源:ResultExport.java

示例12: ExportReverseToXLS

public static void ExportReverseToXLS(String filename, ArrayList<Object> data) throws IOException {
    try {
        WritableFont titleFont = new WritableFont(WritableFont.ARIAL, 10, WritableFont.BOLD, true);
        WritableCellFormat titleformat = new WritableCellFormat(titleFont);
        WritableWorkbook workbook = Workbook.createWorkbook(new File(filename));
        WritableSheet sheet = workbook.createSheet("Bing IP search", 0);
        sheet.addCell(new Label(0, 0, "IP address", titleformat));
        sheet.addCell(new Label(1, 0, "Domain name", titleformat));
        sheet.addCell(new Label(2, 0, "Host name", titleformat));
        int nextRow = 1;
        Iterator i = data.iterator();
        while (i.hasNext()) {
            ReverseLookupResult res = (ReverseLookupResult) i.next();
            sheet.addCell(new Label(0, nextRow, res.getIpAddress()));
            sheet.addCell(new Label(1, nextRow, res.getDomainName()));
            sheet.addCell(new Label(2, nextRow, res.getHostName()));
            nextRow++;
        }
        workbook.write();
        workbook.close();
    } catch (WriteException ex) {
        Logger.getLogger("resultExport.ExportReverseToXLS").log(Level.SEVERE, null, ex);
    }
}
 
开发者ID:sensepost,项目名称:yeti,代码行数:24,代码来源:ResultExport.java

示例13: getBoldFormat

/**
 * @return the format to use for bold cells
 * @throws WriteException if the format could not be created
 */
private WritableCellFormat getBoldFormat() throws WriteException {
  WritableFont boldFont = new WritableFont(WritableFont.ARIAL, 8, WritableFont.BOLD);
  WritableCellFormat boldHeading = new WritableCellFormat(boldFont);
  boldHeading.setBorder(Border.BOTTOM, BorderLineStyle.MEDIUM);
  boldHeading.setVerticalAlignment(VerticalAlignment.CENTRE);
  boldHeading.setBackground(Colour.GRAY_25);


  WritableCellFormat boldFormat = new WritableCellFormat(boldFont);
  boldFormat.setVerticalAlignment(VerticalAlignment.TOP);
  return boldFormat;
}
 
开发者ID:alfasoftware,项目名称:morf,代码行数:16,代码来源:TableOutputter.java

示例14: generateWriteableCellFormats

protected Map<CellFormat, WritableCellFormat> generateWriteableCellFormats(WritableCellFormat base) {
    try {
        WritableFont bold = new WritableFont(WritableFont.createFont(base.getFont().getName()), 
            base.getFont().getPointSize(), WritableFont.BOLD);
        
        Map<CellFormat, WritableCellFormat> result = new HashMap<>();
        for (boolean isCentered : new boolean[] { true, false }) {
            for (boolean isBold : new boolean[] { true, false }) {
                for (boolean hasTopBorder : new boolean[] { true, false }) {
                    CellFormat f = new CellFormat();
                    f.isCentered = isCentered;
                    f.isBold = isBold;
                    f.hasTopBorder = hasTopBorder;
                    
                    WritableCellFormat format = new WritableCellFormat(base);
                    if (isCentered) format.setAlignment(Alignment.CENTRE);
                    if (isBold) format.setFont(bold);
                    if (hasTopBorder) format.setBorder(Border.TOP, BorderLineStyle.THIN);
    
                    result.put(f, format);
                }
            }
        }
        return result;
    }
    catch (WriteException e) { throw new RuntimeException(e); }
}
 
开发者ID:onestopconcept,项目名称:onestop-endpoints,代码行数:27,代码来源:ExcelGenerator.java

示例15: criaLabel

private void criaLabel(WritableSheet sheet)throws WriteException {
// Cria o tipo de fonte como TIMES e tamanho
WritableFont times10pt = new WritableFont(WritableFont.TIMES, 10);
 
// Define o formato da célula
times = new WritableCellFormat(times10pt);
 
// Efetua a quebra automática das células
times.setWrap(true);
 
// Cria a fonte em negrito com underlines
WritableFont times10ptBoldUnderline = new WritableFont(
WritableFont.ARIAL, 10, WritableFont.BOLD, false);
//UnderlineStyle.SINGLE);
timesBoldUnderline = new WritableCellFormat(times10ptBoldUnderline);
 
// Efetua a quebra automática das células
timesBoldUnderline.setWrap(true);
 
CellView cv = new CellView();
cv.setFormat(times);
cv.setFormat(timesBoldUnderline);
cv.setAutosize(true);
 
// Escreve os cabeçalhos
addCaption(sheet, 0/**COLUNAS*/, 0/**LINHAS*/, "Projeto");
addCaption(sheet, 1, 0, "Estado");
addCaption(sheet, 2, 0, "Votos");
}
 
开发者ID:ericlrf,项目名称:Voto-Popular,代码行数:29,代码来源:NewJFrame.java


注:本文中的jxl.write.WritableFont.BOLD属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。