use of jxl.write.WritableFont in project cubrid-manager by CUBRID.
the class ExportTableDefinitionLayoutType method getNormalLeftAlignCellStyle.
/**
* GetNormalLeftAlignCellStyle
*
* @return WritableCellFormat
*/
public static WritableCellFormat getNormalLeftAlignCellStyle() {
WritableFont font = new WritableFont(WritableFont.ARIAL, 10);
WritableCellFormat format = new WritableCellFormat(font);
try {
format.setAlignment(jxl.format.Alignment.LEFT);
format.setVerticalAlignment(jxl.format.VerticalAlignment.TOP);
format.setBorder(Border.ALL, BorderLineStyle.THIN, Colour.BLACK);
format.setWrap(true);
} catch (WriteException e) {
LOGGER.error("", e);
}
return format;
}
use of jxl.write.WritableFont in project cubrid-manager by CUBRID.
the class ExportTableDefinitionLayoutType method getBoldCenterAlignCellStyle.
/**
* GetNormalCell
*
* @return WritableCellFormat
*/
public static WritableCellFormat getBoldCenterAlignCellStyle() {
WritableFont font = new WritableFont(WritableFont.ARIAL, 10);
WritableCellFormat format = new WritableCellFormat(font);
try {
font.setBoldStyle(WritableFont.BOLD);
format.setAlignment(jxl.format.Alignment.CENTRE);
format.setVerticalAlignment(jxl.format.VerticalAlignment.CENTRE);
format.setBorder(Border.ALL, BorderLineStyle.THIN, Colour.BLACK);
format.setBackground(jxl.format.Colour.GREY_25_PERCENT);
format.setWrap(true);
} catch (WriteException e) {
LOGGER.error("", e);
}
return format;
}
use of jxl.write.WritableFont in project cubrid-manager by CUBRID.
the class RunSQLEventHandler method getNormalCell.
/**
* Return the normal cell format.
*
* @return WritableCellFormat
*/
public static WritableCellFormat getNormalCell() {
// FIXME logic code move to core module
WritableFont font = new WritableFont(WritableFont.TIMES, 12);
WritableCellFormat format = new WritableCellFormat(font);
try {
format.setAlignment(jxl.format.Alignment.LEFT);
format.setVerticalAlignment(jxl.format.VerticalAlignment.CENTRE);
format.setBorder(Border.ALL, BorderLineStyle.THIN, Colour.BLACK);
format.setWrap(true);
} catch (WriteException e) {
LOGGER.error(e.getMessage(), e);
}
return format;
}
use of jxl.write.WritableFont in project aws-doc-sdk-examples by awsdocs.
the class WriteExcel method createLabel.
// Create headings in the Excel spreadsheet.
private void createLabel(WritableSheet sheet) throws WriteException {
// Create a Times font.
WritableFont times10pt = new WritableFont(WritableFont.TIMES, 10);
// Define the cell format.
times = new WritableCellFormat(times10pt);
// Automatically wrap the cells.
times.setWrap(true);
// Create a bold font with underlining.
WritableFont times10ptBoldUnderline = new WritableFont(WritableFont.TIMES, 10, WritableFont.BOLD, false, UnderlineStyle.SINGLE);
timesBoldUnderline = new WritableCellFormat(times10ptBoldUnderline);
// Automatically wrap the cells.
timesBoldUnderline.setWrap(true);
CellView cv = new CellView();
cv.setFormat(times);
cv.setFormat(timesBoldUnderline);
cv.setAutosize(true);
// Write a few headers.
addCaption(sheet, 0, 0, "Writer");
addCaption(sheet, 1, 0, "Date");
addCaption(sheet, 2, 0, "Guide");
addCaption(sheet, 3, 0, "Description");
addCaption(sheet, 4, 0, "Status");
}
use of jxl.write.WritableFont in project network-monitor by caarmen.
the class ExcelExport method createCellFormats.
/**
* In order to set text to bold, red, or green, we need to create cell
* formats for each style.
*/
private void createCellFormats() {
// Insert a dummy empty cell, so we can obtain its cell. This allows to
// start with a default cell format.
Label cell = new Label(0, 0, " ");
CellFormat cellFormat = cell.getCellFormat();
try {
// Center all cells.
mDefaultFormat = new WritableCellFormat(cellFormat);
mDefaultFormat.setAlignment(Alignment.CENTRE);
// Create the bold format
final WritableFont boldFont = new WritableFont(cellFormat.getFont());
mBoldFormat = new WritableCellFormat(mDefaultFormat);
boldFont.setBoldStyle(WritableFont.BOLD);
mBoldFormat.setFont(boldFont);
mBoldFormat.setWrap(true);
mBoldFormat.setAlignment(Alignment.CENTRE);
// Create the red format
mRedFormat = new WritableCellFormat(mDefaultFormat);
final WritableFont redFont = new WritableFont(cellFormat.getFont());
redFont.setColour(Colour.RED);
mRedFormat.setFont(redFont);
// Create the green format
mGreenFormat = new WritableCellFormat(mDefaultFormat);
final WritableFont greenFont = new WritableFont(cellFormat.getFont());
greenFont.setColour(Colour.GREEN);
mGreenFormat.setFont(greenFont);
// Create the amber format
mAmberFormat = new WritableCellFormat(mDefaultFormat);
final WritableFont amberFont = new WritableFont(cellFormat.getFont());
amberFont.setColour(Colour.LIGHT_ORANGE);
mAmberFormat.setFont(amberFont);
} catch (WriteException e) {
Log.e(TAG, "createCellFormats Could not create cell formats", e);
}
}
Aggregations