本文整理汇总了Java中org.odftoolkit.simple.table.Cell.setHorizontalAlignment方法的典型用法代码示例。如果您正苦于以下问题:Java Cell.setHorizontalAlignment方法的具体用法?Java Cell.setHorizontalAlignment怎么用?Java Cell.setHorizontalAlignment使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.odftoolkit.simple.table.Cell
的用法示例。
在下文中一共展示了Cell.setHorizontalAlignment方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addAdmonition
import org.odftoolkit.simple.table.Cell; //导入方法依赖的package包/类
private void addAdmonition(AsciiElement element) {
this.setTitle(element, FontStyle.ITALIC, HorizontalAlignmentType.LEFT, 12, new Color("#7a2518"), odtDocument);
Table table = odtDocument.addTable(1, 2);
Cell rowOColumn0 = table.getCellByPosition(0, 0);
String caption = getSpecificProperty(element.getjObj(), "caption", String.class);
rowOColumn0.setDisplayText(caption.toUpperCase());
rowOColumn0.setHorizontalAlignment(HorizontalAlignmentType.CENTER);
rowOColumn0.setVerticalAlignment(VerticalAlignmentType.MIDDLE);
Cell rowOColumn1 = table.getCellByPosition(1, 0);
if (element.getNOfBlocks() == 0)
rowOColumn1.setStringValue(element.getContent());
else {
this.buildODTDocument(element.getChildren(), rowOColumn1);
}
Column column = table.getColumnByIndex(0);
column.setUseOptimalWidth(true);
column.setWidth(32.0);
}
示例2: putHeader
import org.odftoolkit.simple.table.Cell; //导入方法依赖的package包/类
public static Cell putHeader(final Row row, int cellIndex, String header) {
Cell cell = row.getCellByIndex(cellIndex);
cell.setStringValue(header);
cell.setBorders(CellBordersType.ALL_FOUR, getBlackBorder());
cell.setCellBackgroundColor(ExportConstants.CALC_COL_GRAY10);
cell.setFont(getBoldFont(10));
cell.setVerticalAlignment(ExportConstants.ALIGN_VER_MIDDLE);
cell.setHorizontalAlignment(ExportConstants.ALIGH_HOR_CENTER);
cell.setTextWrapped(true);
return cell;
}
示例3: putMainTitle
import org.odftoolkit.simple.table.Cell; //导入方法依赖的package包/类
public static void putMainTitle(final Table table, int rowIndex, int maxCols, String title) {
Row row = table.getRowByIndex(rowIndex);
Cell cell = row.getCellByIndex(1);
cell.setStringValue(title);
cell.setTextWrapped(true);
cell.setFont(CalcUtils.getBoldFont(14));
cell.setVerticalAlignment(ExportConstants.ALIGN_VER_MIDDLE);
cell.setHorizontalAlignment(ExportConstants.ALIGH_HOR_CENTER);
CellRange cellRange = table.getCellRangeByPosition(1, rowIndex, maxCols, rowIndex);
cellRange.merge();
row.setHeight(7, false);
}
示例4: putGroupCell
import org.odftoolkit.simple.table.Cell; //导入方法依赖的package包/类
public static void putGroupCell(final Table table, int colIndex, int rowIndex, String value) {
final Cell cell = createBasicCell(table, colIndex, rowIndex, value);
cell.setCellBackgroundColor(ExportConstants.CALC_COL_ORANGE);
cell.setFont(getFont(10, false, true));
cell.setHorizontalAlignment(ExportConstants.ALIGH_HOR_LEFT);
}
示例5: setAlignmentTypes
import org.odftoolkit.simple.table.Cell; //导入方法依赖的package包/类
private void setAlignmentTypes(Map<String, String> attrs, Cell tableCell) {
HorizontalAlignmentType hAlign = HorizontalAlignmentType.enumValueOf(attrs.get("halign"));
VerticalAlignmentType vAlign = VerticalAlignmentType.enumValueOf(attrs.get("valign"));
tableCell.setHorizontalAlignment(hAlign);
tableCell.setVerticalAlignment(vAlign);
}