本文整理汇总了Java中org.odftoolkit.simple.table.Cell.setCellBackgroundColor方法的典型用法代码示例。如果您正苦于以下问题:Java Cell.setCellBackgroundColor方法的具体用法?Java Cell.setCellBackgroundColor怎么用?Java Cell.setCellBackgroundColor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.odftoolkit.simple.table.Cell
的用法示例。
在下文中一共展示了Cell.setCellBackgroundColor方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addBlock
import org.odftoolkit.simple.table.Cell; //导入方法依赖的package包/类
private void addBlock(AsciiElement element) {
final Table table = odtDocument.addTable(1, 1);
Cell cell = table.getCellByPosition(0, 0);
if (element.getName().equals("sidebar"))
cell.setCellBackgroundColor(new Color("#f8f8f7"));
HorizontalAlignmentType type;
Border border = new Border(new Color("#e0e0dc"), 1.0, SupportedLinearMeasure.PT);
if (element.getName().equals("open")) {
type = HorizontalAlignmentType.JUSTIFY;
border.setColor(Color.WHITE);
cell.setBorders(CellBordersType.NONE, border);
} else {
type = HorizontalAlignmentType.CENTER;
cell.setBorders(CellBordersType.ALL_FOUR, border);
}
this.setTitle(element, type, 14, new Color("#7a2518"), cell);
this.buildODTDocument(element.getChildren(), cell);
}
示例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: putGlobalExportHeader
import org.odftoolkit.simple.table.Cell; //导入方法依赖的package包/类
public static Cell putGlobalExportHeader(final Row row, int cellIndex, String header) {
Cell cell = row.getCellByIndex(cellIndex);
cell.setStringValue(header);
cell.setCellStyleName(coreStyleName);
cell.setCellBackgroundColor(ExportConstants.CALC_COL_GRAY5);
cell.setFont(getFont(10, false, true));
return cell;
}
示例4: newLine
import org.odftoolkit.simple.table.Cell; //导入方法依赖的package包/类
@Override
public void newLine() throws IOException {
if (this.first) {
this.table.appendColumns(this.headers.size());
final Row row = this.table.getRowByIndex(0);
int i = 0;
for (String h : this.headers) {
final Cell c = row.getCellByIndex(i++);
c.setCellBackgroundColor(Color.ORANGE);
Font f = c.getFont();
f.setFontStyle(FontStyle.ITALIC);
f.setSize(10);
c.setFont(f);
c.setStringValue(h);
}
for (Node n : new DomNodeList(
this.table.getOdfElement().getChildNodes())) {
if (n instanceof TableTableRowElement) {
this.rowElement = (TableTableRowElement) n;
}
}
this.first = false;
}
final TableTableRowElement aRow =
(TableTableRowElement) OdfXMLFactory.newOdfElement(this.dom,
OdfName.newName(OdfDocumentNamespace.TABLE, "table-row"));
this.tableElement.appendChild(aRow);
this.rowElement = aRow;
}
示例5: 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);
}