Search in sources :

Example 1 with HSLFEscherClientDataRecord

use of org.apache.poi.hslf.record.HSLFEscherClientDataRecord in project poi by apache.

the class ActiveXShape method createSpContainer.

/**
     * Create a new Placeholder and initialize internal structures
     *
     * @return the created <code>EscherContainerRecord</code> which holds shape data
     */
@Override
protected EscherContainerRecord createSpContainer(int idx, boolean isChild) {
    EscherContainerRecord ecr = super.createSpContainer(idx, isChild);
    EscherSpRecord spRecord = ecr.getChildById(EscherSpRecord.RECORD_ID);
    spRecord.setFlags(EscherSpRecord.FLAG_HAVEANCHOR | EscherSpRecord.FLAG_HASSHAPETYPE | EscherSpRecord.FLAG_OLESHAPE);
    setShapeType(ShapeType.HOST_CONTROL);
    setEscherProperty(EscherProperties.BLIP__PICTUREID, idx);
    setEscherProperty(EscherProperties.LINESTYLE__COLOR, 0x8000001);
    setEscherProperty(EscherProperties.LINESTYLE__NOLINEDRAWDASH, 0x80008);
    setEscherProperty(EscherProperties.SHADOWSTYLE__COLOR, 0x8000002);
    setEscherProperty(EscherProperties.PROTECTION__LOCKAGAINSTGROUPING, -1);
    HSLFEscherClientDataRecord cldata = getClientData(true);
    cldata.addChild(new ExObjRefAtom());
    return ecr;
}
Also used : ExObjRefAtom(org.apache.poi.hslf.record.ExObjRefAtom) HSLFEscherClientDataRecord(org.apache.poi.hslf.record.HSLFEscherClientDataRecord) EscherSpRecord(org.apache.poi.ddf.EscherSpRecord) EscherContainerRecord(org.apache.poi.ddf.EscherContainerRecord)

Example 2 with HSLFEscherClientDataRecord

use of org.apache.poi.hslf.record.HSLFEscherClientDataRecord in project poi by apache.

the class MovieShape method createSpContainer.

/**
     * Create a new Placeholder and initialize internal structures
     *
     * @return the created <code>EscherContainerRecord</code> which holds shape data
     */
@Override
protected EscherContainerRecord createSpContainer(int idx, boolean isChild) {
    EscherContainerRecord ecr = super.createSpContainer(idx, isChild);
    setEscherProperty(EscherProperties.PROTECTION__LOCKAGAINSTGROUPING, 0x1000100);
    setEscherProperty(EscherProperties.FILL__NOFILLHITTEST, 0x10001);
    ExObjRefAtom oe = new ExObjRefAtom();
    InteractiveInfo info = new InteractiveInfo();
    InteractiveInfoAtom infoAtom = info.getInteractiveInfoAtom();
    infoAtom.setAction(InteractiveInfoAtom.ACTION_MEDIA);
    infoAtom.setHyperlinkType(InteractiveInfoAtom.LINK_NULL);
    AnimationInfo an = new AnimationInfo();
    AnimationInfoAtom anAtom = an.getAnimationInfoAtom();
    anAtom.setFlag(AnimationInfoAtom.Automatic, true);
    HSLFEscherClientDataRecord cldata = getClientData(true);
    cldata.addChild(oe);
    cldata.addChild(an);
    cldata.addChild(info);
    return ecr;
}
Also used : ExObjRefAtom(org.apache.poi.hslf.record.ExObjRefAtom) HSLFEscherClientDataRecord(org.apache.poi.hslf.record.HSLFEscherClientDataRecord) InteractiveInfoAtom(org.apache.poi.hslf.record.InteractiveInfoAtom) AnimationInfo(org.apache.poi.hslf.record.AnimationInfo) AnimationInfoAtom(org.apache.poi.hslf.record.AnimationInfoAtom) EscherContainerRecord(org.apache.poi.ddf.EscherContainerRecord) InteractiveInfo(org.apache.poi.hslf.record.InteractiveInfo)

Example 3 with HSLFEscherClientDataRecord

use of org.apache.poi.hslf.record.HSLFEscherClientDataRecord in project poi by apache.

the class OLEShape method setObjectID.

/**
     * Set the unique identifier for the OLE object and
     * register it in the necessary structures
     * 
     * @param objectId the unique identifier for the OLE object
     */
public void setObjectID(int objectId) {
    setEscherProperty(EscherProperties.BLIP__PICTUREID, objectId);
    EscherContainerRecord ecr = getSpContainer();
    EscherSpRecord spRecord = ecr.getChildById(EscherSpRecord.RECORD_ID);
    spRecord.setFlags(spRecord.getFlags() | EscherSpRecord.FLAG_OLESHAPE);
    HSLFEscherClientDataRecord cldata = getClientData(true);
    ExObjRefAtom uer = null;
    for (Record r : cldata.getHSLFChildRecords()) {
        if (r.getRecordType() == RecordTypes.ExObjRefAtom.typeID) {
            uer = (ExObjRefAtom) r;
            break;
        }
    }
    if (uer == null) {
        uer = new ExObjRefAtom();
        cldata.addChild(uer);
    }
    uer.setExObjIdRef(objectId);
}
Also used : ExObjRefAtom(org.apache.poi.hslf.record.ExObjRefAtom) HSLFEscherClientDataRecord(org.apache.poi.hslf.record.HSLFEscherClientDataRecord) EscherSpRecord(org.apache.poi.ddf.EscherSpRecord) EscherContainerRecord(org.apache.poi.ddf.EscherContainerRecord) HSLFEscherClientDataRecord(org.apache.poi.hslf.record.HSLFEscherClientDataRecord) Record(org.apache.poi.hslf.record.Record) EscherContainerRecord(org.apache.poi.ddf.EscherContainerRecord) EscherSpRecord(org.apache.poi.ddf.EscherSpRecord)

Example 4 with HSLFEscherClientDataRecord

use of org.apache.poi.hslf.record.HSLFEscherClientDataRecord in project poi by apache.

the class HSLFShape method getClientData.

/**
     * Create a new HSLF-specific EscherClientDataRecord
     *
     * @param create if true, create the missing record 
     * @return the client record or null if it was missing and create wasn't activated
     */
protected HSLFEscherClientDataRecord getClientData(boolean create) {
    HSLFEscherClientDataRecord clientData = getEscherChild(EscherClientDataRecord.RECORD_ID);
    if (clientData == null && create) {
        clientData = new HSLFEscherClientDataRecord();
        clientData.setOptions((short) 15);
        clientData.setRecordId(EscherClientDataRecord.RECORD_ID);
        getSpContainer().addChildBefore(clientData, EscherTextboxRecord.RECORD_ID);
    }
    return clientData;
}
Also used : HSLFEscherClientDataRecord(org.apache.poi.hslf.record.HSLFEscherClientDataRecord)

Example 5 with HSLFEscherClientDataRecord

use of org.apache.poi.hslf.record.HSLFEscherClientDataRecord in project poi by apache.

the class HSLFHyperlink method createHyperlink.

/**
     * Creates a new Hyperlink and assign it to a shape
     * This is only a helper method - use {@link HSLFSimpleShape#createHyperlink()} instead!
     *
     * @param shape the shape which receives the hyperlink
     * @return the new hyperlink
     * 
     * @see HSLFSimpleShape#createHyperlink()
     */
/* package */
static HSLFHyperlink createHyperlink(HSLFSimpleShape shape) {
    // TODO: check if a hyperlink already exists
    ExHyperlink exHyper = new ExHyperlink();
    int linkId = shape.getSheet().getSlideShow().addToObjListAtom(exHyper);
    ExHyperlinkAtom obj = exHyper.getExHyperlinkAtom();
    obj.setNumber(linkId);
    InteractiveInfo info = new InteractiveInfo();
    info.getInteractiveInfoAtom().setHyperlinkID(linkId);
    HSLFEscherClientDataRecord cldata = shape.getClientData(true);
    cldata.addChild(info);
    HSLFHyperlink hyper = new HSLFHyperlink(exHyper, info);
    hyper.linkToNextSlide();
    shape.setHyperlink(hyper);
    return hyper;
}
Also used : ExHyperlinkAtom(org.apache.poi.hslf.record.ExHyperlinkAtom) HSLFEscherClientDataRecord(org.apache.poi.hslf.record.HSLFEscherClientDataRecord) ExHyperlink(org.apache.poi.hslf.record.ExHyperlink) InteractiveInfo(org.apache.poi.hslf.record.InteractiveInfo)

Aggregations

HSLFEscherClientDataRecord (org.apache.poi.hslf.record.HSLFEscherClientDataRecord)7 EscherContainerRecord (org.apache.poi.ddf.EscherContainerRecord)4 EscherSpRecord (org.apache.poi.ddf.EscherSpRecord)3 ExObjRefAtom (org.apache.poi.hslf.record.ExObjRefAtom)3 InteractiveInfo (org.apache.poi.hslf.record.InteractiveInfo)2 Record (org.apache.poi.hslf.record.Record)2 ArrayList (java.util.ArrayList)1 AbstractEscherOptRecord (org.apache.poi.ddf.AbstractEscherOptRecord)1 EscherChildAnchorRecord (org.apache.poi.ddf.EscherChildAnchorRecord)1 EscherClientAnchorRecord (org.apache.poi.ddf.EscherClientAnchorRecord)1 EscherOptRecord (org.apache.poi.ddf.EscherOptRecord)1 EscherRecord (org.apache.poi.ddf.EscherRecord)1 HSLFException (org.apache.poi.hslf.exceptions.HSLFException)1 AnimationInfo (org.apache.poi.hslf.record.AnimationInfo)1 AnimationInfoAtom (org.apache.poi.hslf.record.AnimationInfoAtom)1 ExHyperlink (org.apache.poi.hslf.record.ExHyperlink)1 ExHyperlinkAtom (org.apache.poi.hslf.record.ExHyperlinkAtom)1 ExObjList (org.apache.poi.hslf.record.ExObjList)1 InteractiveInfoAtom (org.apache.poi.hslf.record.InteractiveInfoAtom)1 OEPlaceholderAtom (org.apache.poi.hslf.record.OEPlaceholderAtom)1