Example usage for org.apache.poi.ss.util CellUtil FONT

List of usage examples for org.apache.poi.ss.util CellUtil FONT

Introduction

In this page you can find the example usage for org.apache.poi.ss.util CellUtil FONT.

Prototype

String FONT

To view the source code for org.apache.poi.ss.util CellUtil FONT.

Click Source Link

Usage

From source file:org.haplo.jsinterface.generate.KGenerateXLS.java

License:Mozilla Public License

private void styleFont(SheetStyleInstruction i) {
    HashMap<String, Object> properties = new HashMap<String, Object>(1);
    Font font = this.workbook.createFont();
    if (i.colour instanceof CharSequence) {
        switch (i.colour.toString()) {
        case "BOLD":
            font.setBold(true);/* w w w .  j a v a  2s .  c om*/
            font.setBold(true);
            break;
        case "BOLD-ITALIC":
            font.setBold(true);
            font.setBold(true);
            font.setItalic(true);
            break;
        case "ITALIC":
            font.setItalic(true);
            break;
        }
    }
    if (i.option instanceof Number) {
        font.setFontHeightInPoints(((Number) i.option).shortValue());
    }
    properties.put(CellUtil.FONT, font.getIndex());
    styleApplyToRegion(i, properties);
}