Search in sources :

Example 1 with ExObjRefAtom

use of org.apache.poi.hslf.record.ExObjRefAtom 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 ExObjRefAtom

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

the class ActiveXShape method setActiveXIndex.

/**
     * Assign a control to this shape
     *
     * @see org.apache.poi.hslf.usermodel.HSLFSlideShow#addMovie(String, int)
     * @param idx  the index of the movie
     */
public void setActiveXIndex(int idx) {
    ExObjRefAtom oe = getClientDataRecord(RecordTypes.ExObjRefAtom.typeID);
    if (oe == null) {
        throw new HSLFException("OEShapeAtom for ActiveX doesn't exist");
    }
    oe.setExObjIdRef(idx);
}
Also used : ExObjRefAtom(org.apache.poi.hslf.record.ExObjRefAtom) HSLFException(org.apache.poi.hslf.exceptions.HSLFException)

Example 3 with ExObjRefAtom

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

the class ActiveXShape method getControlIndex.

public int getControlIndex() {
    int idx = -1;
    ExObjRefAtom oe = getClientDataRecord(RecordTypes.ExObjRefAtom.typeID);
    if (oe != null)
        idx = oe.getExObjIdRef();
    return idx;
}
Also used : ExObjRefAtom(org.apache.poi.hslf.record.ExObjRefAtom)

Example 4 with ExObjRefAtom

use of org.apache.poi.hslf.record.ExObjRefAtom 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 5 with ExObjRefAtom

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

the class MovieShape method setMovieIndex.

/**
     * Assign a movie to this shape
     *
     * @see org.apache.poi.hslf.usermodel.HSLFSlideShow#addMovie(String, int)
     * @param idx  the index of the movie
     */
public void setMovieIndex(int idx) {
    ExObjRefAtom oe = getClientDataRecord(RecordTypes.ExObjRefAtom.typeID);
    oe.setExObjIdRef(idx);
    AnimationInfo an = getClientDataRecord(RecordTypes.AnimationInfo.typeID);
    if (an != null) {
        AnimationInfoAtom ai = an.getAnimationInfoAtom();
        ai.setDimColor(0x07000000);
        ai.setFlag(AnimationInfoAtom.Automatic, true);
        ai.setFlag(AnimationInfoAtom.Play, true);
        ai.setFlag(AnimationInfoAtom.Synchronous, true);
        ai.setOrderID(idx + 1);
    }
}
Also used : ExObjRefAtom(org.apache.poi.hslf.record.ExObjRefAtom) AnimationInfo(org.apache.poi.hslf.record.AnimationInfo) AnimationInfoAtom(org.apache.poi.hslf.record.AnimationInfoAtom)

Aggregations

ExObjRefAtom (org.apache.poi.hslf.record.ExObjRefAtom)8 EscherContainerRecord (org.apache.poi.ddf.EscherContainerRecord)4 HSLFEscherClientDataRecord (org.apache.poi.hslf.record.HSLFEscherClientDataRecord)4 EscherSpRecord (org.apache.poi.ddf.EscherSpRecord)2 AnimationInfo (org.apache.poi.hslf.record.AnimationInfo)2 AnimationInfoAtom (org.apache.poi.hslf.record.AnimationInfoAtom)2 InteractiveInfo (org.apache.poi.hslf.record.InteractiveInfo)2 Record (org.apache.poi.hslf.record.Record)2 HSLFException (org.apache.poi.hslf.exceptions.HSLFException)1 MovieShape (org.apache.poi.hslf.model.MovieShape)1 OLEShape (org.apache.poi.hslf.model.OLEShape)1 ExMCIMovie (org.apache.poi.hslf.record.ExMCIMovie)1 ExObjList (org.apache.poi.hslf.record.ExObjList)1 ExVideoContainer (org.apache.poi.hslf.record.ExVideoContainer)1 InteractiveInfoAtom (org.apache.poi.hslf.record.InteractiveInfoAtom)1 HSLFSlideShow (org.apache.poi.hslf.usermodel.HSLFSlideShow)1