Example usage for org.apache.poi.xslf.usermodel XSLFTextRun isStrikethrough

List of usage examples for org.apache.poi.xslf.usermodel XSLFTextRun isStrikethrough

Introduction

In this page you can find the example usage for org.apache.poi.xslf.usermodel XSLFTextRun isStrikethrough.

Prototype

@Override
    public boolean isStrikethrough() 

Source Link

Usage

From source file:org.joeffice.presentation.ShapeComponent.java

License:Apache License

private AttributeSet getFontAttributes(XSLFTextRun textPart) {
    SimpleAttributeSet attributes = new SimpleAttributeSet();
    String fontFamily = textPart.getFontFamily();
    if (fontFamily != null) {
        StyleConstants.setFontFamily(attributes, fontFamily);
    }//from  ww w  . j ava  2s  .com
    Color textColor = textPart.getFontColor();
    if (textColor != null) {
        StyleConstants.setForeground(attributes, textColor);
    }
    double fontSize = textPart.getFontSize();
    if (fontSize > 0) {
        fontSize = fontSize * slideComponent.getScale();
        StyleConstants.setFontSize(attributes, (int) fontSize);
    }
    boolean italic = textPart.isItalic();
    if (italic) {
        StyleConstants.setItalic(attributes, true);
    }
    boolean bold = textPart.isBold();
    if (bold) {
        StyleConstants.setBold(attributes, true);
    }
    boolean underlined = textPart.isUnderline();
    if (underlined) {
        StyleConstants.setUnderline(attributes, true);
    }
    boolean strikeThrough = textPart.isStrikethrough();
    if (strikeThrough) {
        StyleConstants.setStrikeThrough(attributes, true);
    }
    boolean subScript = textPart.isSubscript();
    if (subScript) {
        StyleConstants.setSubscript(attributes, true);
    }
    boolean superScript = textPart.isSuperscript();
    if (superScript) {
        StyleConstants.setSuperscript(attributes, true);
    }
    return attributes;
}