Search in sources :

Example 11 with EscherContainerRecord

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

the class EscherAggregate method setMainSpRecordId.

/**
     * EscherDgContainer
     * -EscherSpgrContainer
     * --EscherSpContainer
     * ---EscherSpRecord -set id for this record
     * ---***
     * --***
     * -EscherDgRecord
     * set id for the sp record of the first spContainer in main spgrConatiner
     * @param shapeId - id which must be set
     */
public void setMainSpRecordId(int shapeId) {
    EscherContainerRecord dgContainer = getEscherContainer();
    EscherContainerRecord spgrConatiner = (EscherContainerRecord) dgContainer.getChildById(EscherContainerRecord.SPGR_CONTAINER);
    EscherContainerRecord spContainer = (EscherContainerRecord) spgrConatiner.getChild(0);
    EscherSpRecord sp = (EscherSpRecord) spContainer.getChildById(EscherSpRecord.RECORD_ID);
    sp.setShapeId(shapeId);
}
Also used : EscherSpRecord(org.apache.poi.ddf.EscherSpRecord) EscherContainerRecord(org.apache.poi.ddf.EscherContainerRecord)

Example 12 with EscherContainerRecord

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

the class EscherAggregate method setDgId.

/**
     * EscherDgContainer
     * -EscherSpgrContainer
     * -EscherDgRecord - set id for this record
     * set id for DgRecord of DgContainer
     * @param dgId - id which must be set
     */
public void setDgId(short dgId) {
    EscherContainerRecord dgContainer = getEscherContainer();
    EscherDgRecord dg = dgContainer.getChildById(EscherDgRecord.RECORD_ID);
    dg.setOptions((short) (dgId << 4));
}
Also used : EscherContainerRecord(org.apache.poi.ddf.EscherContainerRecord) EscherDgRecord(org.apache.poi.ddf.EscherDgRecord)

Example 13 with EscherContainerRecord

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

the class HSSFComment method cloneShape.

@Override
protected HSSFShape cloneShape() {
    TextObjectRecord txo = (TextObjectRecord) getTextObjectRecord().cloneViaReserialise();
    EscherContainerRecord spContainer = new EscherContainerRecord();
    byte[] inSp = getEscherContainer().serialize();
    spContainer.fillFields(inSp, 0, new DefaultEscherRecordFactory());
    ObjRecord obj = (ObjRecord) getObjRecord().cloneViaReserialise();
    NoteRecord note = (NoteRecord) getNoteRecord().cloneViaReserialise();
    return new HSSFComment(spContainer, obj, txo, note);
}
Also used : TextObjectRecord(org.apache.poi.hssf.record.TextObjectRecord) NoteRecord(org.apache.poi.hssf.record.NoteRecord) ObjRecord(org.apache.poi.hssf.record.ObjRecord) EscherContainerRecord(org.apache.poi.ddf.EscherContainerRecord) DefaultEscherRecordFactory(org.apache.poi.ddf.DefaultEscherRecordFactory)

Example 14 with EscherContainerRecord

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

the class HSSFPicture method cloneShape.

@Override
protected HSSFShape cloneShape() {
    EscherContainerRecord spContainer = new EscherContainerRecord();
    byte[] inSp = getEscherContainer().serialize();
    spContainer.fillFields(inSp, 0, new DefaultEscherRecordFactory());
    ObjRecord obj = (ObjRecord) getObjRecord().cloneViaReserialise();
    return new HSSFPicture(spContainer, obj);
}
Also used : ObjRecord(org.apache.poi.hssf.record.ObjRecord) EscherContainerRecord(org.apache.poi.ddf.EscherContainerRecord) DefaultEscherRecordFactory(org.apache.poi.ddf.DefaultEscherRecordFactory)

Example 15 with EscherContainerRecord

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

the class HSLFPictureShape method getEscherBSERecord.

@SuppressWarnings("resource")
protected EscherBSERecord getEscherBSERecord() {
    HSLFSlideShow ppt = getSheet().getSlideShow();
    Document doc = ppt.getDocumentRecord();
    EscherContainerRecord dggContainer = doc.getPPDrawingGroup().getDggContainer();
    EscherContainerRecord bstore = HSLFShape.getEscherChild(dggContainer, EscherContainerRecord.BSTORE_CONTAINER);
    if (bstore == null) {
        LOG.log(POILogger.DEBUG, "EscherContainerRecord.BSTORE_CONTAINER was not found ");
        return null;
    }
    List<EscherRecord> lst = bstore.getChildRecords();
    int idx = getPictureIndex();
    if (idx == 0) {
        LOG.log(POILogger.DEBUG, "picture index was not found, returning ");
        return null;
    }
    return (EscherBSERecord) lst.get(idx - 1);
}
Also used : EscherContainerRecord(org.apache.poi.ddf.EscherContainerRecord) EscherRecord(org.apache.poi.ddf.EscherRecord) Document(org.apache.poi.hslf.record.Document) EscherBSERecord(org.apache.poi.ddf.EscherBSERecord)

Aggregations

EscherContainerRecord (org.apache.poi.ddf.EscherContainerRecord)53 EscherRecord (org.apache.poi.ddf.EscherRecord)17 EscherSpRecord (org.apache.poi.ddf.EscherSpRecord)17 EscherOptRecord (org.apache.poi.ddf.EscherOptRecord)11 EscherBSERecord (org.apache.poi.ddf.EscherBSERecord)8 EscherSimpleProperty (org.apache.poi.ddf.EscherSimpleProperty)8 AbstractEscherOptRecord (org.apache.poi.ddf.AbstractEscherOptRecord)6 EscherDgRecord (org.apache.poi.ddf.EscherDgRecord)6 DefaultEscherRecordFactory (org.apache.poi.ddf.DefaultEscherRecordFactory)5 ObjRecord (org.apache.poi.hssf.record.ObjRecord)5 EscherDggRecord (org.apache.poi.ddf.EscherDggRecord)4 EscherSpgrRecord (org.apache.poi.ddf.EscherSpgrRecord)4 EscherTextboxRecord (org.apache.poi.ddf.EscherTextboxRecord)4 Document (org.apache.poi.hslf.record.Document)4 PPDrawing (org.apache.poi.hslf.record.PPDrawing)4 LinkedList (java.util.LinkedList)3 EscherBoolProperty (org.apache.poi.ddf.EscherBoolProperty)3 EscherClientDataRecord (org.apache.poi.ddf.EscherClientDataRecord)3 EscherRGBProperty (org.apache.poi.ddf.EscherRGBProperty)3 ExObjRefAtom (org.apache.poi.hslf.record.ExObjRefAtom)3