Example usage for org.apache.poi.ss.usermodel FontUnderline DOUBLE

List of usage examples for org.apache.poi.ss.usermodel FontUnderline DOUBLE

Introduction

In this page you can find the example usage for org.apache.poi.ss.usermodel FontUnderline DOUBLE.

Prototype

FontUnderline DOUBLE

To view the source code for org.apache.poi.ss.usermodel FontUnderline DOUBLE.

Click Source Link

Document

Double-line underlining under each character in the cell.

Usage

From source file:com.hauldata.dbpa.file.book.XlsxTargetSheet.java

License:Apache License

private static Font getFont(FontStyles fontStyles, SXSSFWorkbook book, Map<FontStyles, XSSFFont> fontsUsed,
        Map<Integer, XSSFColor> colorsUsed) {

    XSSFFont font = fontsUsed.get(fontStyles);
    if (font != null) {
        return font;
    }//from w w  w  .  j  av  a 2s.co m

    font = (XSSFFont) book.createFont();

    if (fontStyles.color != null) {
        font.setColor(getColor(fontStyles.color, book, colorsUsed));
    }

    if (fontStyles.fontStyle != null) {
        switch (fontStyles.fontStyle) {
        case NORMAL:
            break;
        case ITALIC:
            font.setItalic(true);
            break;
        }
    }

    if (fontStyles.fontWeight != null) {
        switch (fontStyles.fontWeight) {
        case NORMAL:
            break;
        case BOLD:
            font.setBold(true);
            break;
        }
    }

    if (fontStyles.textDecorationLine != null) {
        switch (fontStyles.textDecorationLine) {
        case NONE:
            break;
        case LINE_THROUGH:
            font.setStrikeout(true);
            break;
        case UNDERLINE:
            font.setUnderline((fontStyles.textDecorationStyle == FontStyles.TextDecorationStyle.DOUBLE)
                    ? FontUnderline.DOUBLE
                    : FontUnderline.SINGLE);
            break;
        }
    }

    fontsUsed.put(fontStyles, font);

    return font;
}