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


Java Table.endHeaders方法代码示例

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


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

示例1: getPersonalInfo

import com.lowagie.text.Table; //导入方法依赖的package包/类
/**
 * Get the PDF Table with personal information about the initiator and traveler
 *
 * @returns {@link Table} used for a PDF
 */
protected Table getPersonalInfo() throws BadElementException {
    final Table retval = new Table(2);
    retval.setWidth(100f);
    retval.setBorder(NO_BORDER);
    retval.addCell(getHeaderCell("Traveler"));

    final Cell initiatorHeaderCell = getHeaderCell("Request Submitted By");

    retval.addCell(initiatorHeaderCell);
    retval.endHeaders();
    retval.addCell(getTravelerInfo());

    final Cell initiatorCell = getInitiatorInfo();

    retval.addCell(initiatorCell);
    return retval;
}
 
开发者ID:kuali,项目名称:kfs,代码行数:23,代码来源:Coversheet.java

示例2: getTripInfo

import com.lowagie.text.Table; //导入方法依赖的package包/类
/**
 * Get the PDF Table containing trip information like trip id, date, and destination
 *
 * @returns {@link Table} used for a PDF
 */
protected Table getTripInfo() throws BadElementException {
    final Table retval = new Table(3);
    retval.setWidth(100f);
    retval.setBorder(NO_BORDER);
    retval.addCell(getHeaderCell("Trip/Event ID"));

    final Cell dateHeaderCell = getHeaderCell("Date");

    retval.addCell(dateHeaderCell);
    retval.addCell(getHeaderCell("Destination/Event Name"));
    retval.endHeaders();
    retval.addCell(getBorderlessCell(getTripId()));

    final Cell dateCell = getBorderlessCell(getDate());

    retval.addCell(dateCell);
    retval.addCell(getBorderlessCell(getDestination()));
    return retval;
}
 
开发者ID:kuali,项目名称:kfs,代码行数:25,代码来源:Coversheet.java

示例3: getExpenses

import com.lowagie.text.Table; //导入方法依赖的package包/类
public Table getExpenses() throws BadElementException {
    final Table retval = new Table(3);
    retval.setWidth(100f);
    retval.setBorder(NO_BORDER);
    retval.addCell(getHeaderCell("Expenses"));
    retval.addCell(getHeaderCell("Amount"));
    retval.addCell(getHeaderCell("Receipt Required?"));
    retval.endHeaders();

    for (final Map<String, String> expense : expenses) {
        retval.addCell(getBorderlessCell(expense.get("expenseType")));
        retval.addCell(getBorderlessCell(expense.get("amount")));
        retval.addCell(getBorderlessCell(expense.get("receipt")));
    }
    return retval;
}
 
开发者ID:kuali,项目名称:kfs,代码行数:17,代码来源:Coversheet.java

示例4: renderHeaders

import com.lowagie.text.Table; //导入方法依赖的package包/类
/**
 * Effectue le rendu des headers.
 *
 * @param table
 *           MBasicTable
 * @param datatable
 *           Table
 * @throws BadElementException
 *            e
 */
protected void renderHeaders(final MBasicTable table, final Table datatable)
		throws BadElementException {
	final int columnCount = table.getColumnCount();
	final TableColumnModel columnModel = table.getColumnModel();
	// size of columns
	float totalWidth = 0;
	for (int i = 0; i < columnCount; i++) {
		totalWidth += columnModel.getColumn(i).getWidth();
	}
	final float[] headerwidths = new float[columnCount];
	for (int i = 0; i < columnCount; i++) {
		headerwidths[i] = 100f * columnModel.getColumn(i).getWidth() / totalWidth;
	}
	datatable.setWidths(headerwidths);
	datatable.setWidth(100f);

	// table header
	final Font font = FontFactory.getFont(FontFactory.HELVETICA, 12, Font.BOLD);
	datatable.getDefaultCell().setBorderWidth(2);
	datatable.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER);
	// datatable.setDefaultCellGrayFill(0.75f);

	String text;
	Object value;
	for (int i = 0; i < columnCount; i++) {
		value = columnModel.getColumn(i).getHeaderValue();
		text = value != null ? value.toString() : "";
		datatable.addCell(new Phrase(text, font));
	}
	// end of the table header
	datatable.endHeaders();
}
 
开发者ID:javamelody,项目名称:javamelody,代码行数:43,代码来源:MPdfWriter.java


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