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);
}
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());
}
Aggregations