Search in sources :

Example 1 with CTFontScheme

use of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFontScheme in project poi by apache.

the class XSSFFont method setScheme.

/**
     * set font scheme property
     *
     * @param scheme - FontScheme enum value
     * @see FontScheme
     */
public void setScheme(FontScheme scheme) {
    CTFontScheme ctFontScheme = _ctFont.sizeOfSchemeArray() == 0 ? _ctFont.addNewScheme() : _ctFont.getSchemeArray(0);
    STFontScheme.Enum val = STFontScheme.Enum.forInt(scheme.getValue());
    ctFontScheme.setVal(val);
}
Also used : CTFontScheme(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFontScheme) STFontScheme(org.openxmlformats.schemas.spreadsheetml.x2006.main.STFontScheme)

Example 2 with CTFontScheme

use of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFontScheme in project poi by apache.

the class TestXSSFFont method testScheme.

@Test
public void testScheme() {
    CTFont ctFont = CTFont.Factory.newInstance();
    CTFontScheme scheme = ctFont.addNewScheme();
    scheme.setVal(STFontScheme.MAJOR);
    ctFont.setSchemeArray(0, scheme);
    XSSFFont font = new XSSFFont(ctFont);
    assertEquals(FontScheme.MAJOR, font.getScheme());
    font.setScheme(FontScheme.NONE);
    assertEquals(STFontScheme.NONE, ctFont.getSchemeArray(0).getVal());
}
Also used : CTFontScheme(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFontScheme) CTFont(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFont) Test(org.junit.Test)

Aggregations

CTFontScheme (org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFontScheme)2 Test (org.junit.Test)1 CTFont (org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFont)1 STFontScheme (org.openxmlformats.schemas.spreadsheetml.x2006.main.STFontScheme)1