Search in sources :

Example 1 with HCenterRecord

use of org.apache.poi.hssf.record.HCenterRecord in project poi by apache.

the class TestHSSFSheet method horizontallyCenter.

/**
     * Test horizontally centered output.
     */
@Test
public void horizontallyCenter() throws IOException {
    HSSFWorkbook wb = new HSSFWorkbook();
    HSSFSheet s = wb.createSheet();
    HCenterRecord record = s.getSheet().getPageSettings().getHCenter();
    assertFalse(record.getHCenter());
    assertFalse(s.getHorizontallyCenter());
    s.setHorizontallyCenter(true);
    assertTrue(record.getHCenter());
    assertTrue(s.getHorizontallyCenter());
    wb.close();
}
Also used : HCenterRecord(org.apache.poi.hssf.record.HCenterRecord) Test(org.junit.Test)

Example 2 with HCenterRecord

use of org.apache.poi.hssf.record.HCenterRecord in project poi by apache.

the class HSSFChart method createHCenterRecord.

private HCenterRecord createHCenterRecord() {
    HCenterRecord r = new HCenterRecord();
    r.setHCenter(false);
    return r;
}
Also used : HCenterRecord(org.apache.poi.hssf.record.HCenterRecord)

Aggregations

HCenterRecord (org.apache.poi.hssf.record.HCenterRecord)2 Test (org.junit.Test)1