Search in sources :

Example 31 with EscherSpRecord

use of org.apache.poi.ddf.EscherSpRecord in project poi by apache.

the class TestHSSFComment method shapeId.

@Test
public void shapeId() throws IOException {
    HSSFWorkbook wb = new HSSFWorkbook();
    HSSFSheet sh = wb.createSheet();
    HSSFPatriarch patriarch = sh.createDrawingPatriarch();
    HSSFComment comment = patriarch.createCellComment(new HSSFClientAnchor());
    comment.setShapeId(2024);
    assertEquals(comment.getShapeId(), 2024);
    CommonObjectDataSubRecord cod = (CommonObjectDataSubRecord) comment.getObjRecord().getSubRecords().get(0);
    assertEquals(2024, cod.getObjectId());
    EscherSpRecord spRecord = (EscherSpRecord) comment.getEscherContainer().getChild(0);
    assertEquals(2024, spRecord.getShapeId(), 2024);
    assertEquals(2024, comment.getShapeId(), 2024);
    assertEquals(2024, comment.getNoteRecord().getShapeId());
    wb.close();
}
Also used : CommonObjectDataSubRecord(org.apache.poi.hssf.record.CommonObjectDataSubRecord) EscherSpRecord(org.apache.poi.ddf.EscherSpRecord) Test(org.junit.Test)

Aggregations

EscherSpRecord (org.apache.poi.ddf.EscherSpRecord)31 EscherContainerRecord (org.apache.poi.ddf.EscherContainerRecord)17 EscherClientAnchorRecord (org.apache.poi.ddf.EscherClientAnchorRecord)5 EscherDgRecord (org.apache.poi.ddf.EscherDgRecord)5 EscherOptRecord (org.apache.poi.ddf.EscherOptRecord)5 CommonObjectDataSubRecord (org.apache.poi.hssf.record.CommonObjectDataSubRecord)5 AbstractEscherOptRecord (org.apache.poi.ddf.AbstractEscherOptRecord)4 EscherChildAnchorRecord (org.apache.poi.ddf.EscherChildAnchorRecord)4 EscherRecord (org.apache.poi.ddf.EscherRecord)4 EscherTextboxRecord (org.apache.poi.ddf.EscherTextboxRecord)4 Test (org.junit.Test)4 EscherSimpleProperty (org.apache.poi.ddf.EscherSimpleProperty)3 EscherSpgrRecord (org.apache.poi.ddf.EscherSpgrRecord)3 HSLFEscherClientDataRecord (org.apache.poi.hslf.record.HSLFEscherClientDataRecord)3 EscherBoolProperty (org.apache.poi.ddf.EscherBoolProperty)2 EscherClientDataRecord (org.apache.poi.ddf.EscherClientDataRecord)2 EscherDggRecord (org.apache.poi.ddf.EscherDggRecord)2 EscherRGBProperty (org.apache.poi.ddf.EscherRGBProperty)2 ExObjRefAtom (org.apache.poi.hslf.record.ExObjRefAtom)2 Record (org.apache.poi.hslf.record.Record)2