public void setAutoPlay(boolean flag){ AnimationInfo an = (AnimationInfo)getClientDataRecord(RecordTypes.AnimationInfo.typeID); if(an != null){ an.getAnimationInfoAtom().setFlag(AnimationInfoAtom.Automatic, flag); updateClientData(); } }
/** * Create a new <code>Picture</code> * * @param pictureIdx the index of the picture */ public MovieShape(int movieIdx, int pictureIdx){ super(pictureIdx, null); setMovieIndex(movieIdx); setAutoPlay(true); }
/** * @return UNC or local path to a video file */ public String getPath(){ OEShapeAtom oe = (OEShapeAtom)getClientDataRecord(RecordTypes.OEShapeAtom.typeID); int idx = oe.getOptions(); SlideShow ppt = getSheet().getSlideShow(); ExObjList lst = (ExObjList)ppt.getDocumentRecord().findFirstOfType(RecordTypes.ExObjList.typeID); if(lst == null) return null; Record[] r = lst.getChildRecords(); for (int i = 0; i < r.length; i++) { if(r[i] instanceof ExMCIMovie){ ExMCIMovie mci = (ExMCIMovie)r[i]; ExVideoContainer exVideo = mci.getExVideo(); int objectId = exVideo.getExMediaAtom().getObjectId(); if(objectId == idx){ return exVideo.getPathAtom().getText(); } } } return null; } }
public void setAutoPlay(boolean flag){ AnimationInfo an = getClientDataRecord(RecordTypes.AnimationInfo.typeID); if(an != null){ an.getAnimationInfoAtom().setFlag(AnimationInfoAtom.Automatic, flag); } }
/** * 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; }
/** * Create a new <code>Picture</code> * * @param idx the index of the picture * @param parent the parent shape */ public MovieShape(int movieIdx, int idx, Shape parent) { super(idx, parent); setMovieIndex(movieIdx); }
private static HSLFShape createFrame(EscherContainerRecord spContainer, ShapeContainer<HSLFShape,HSLFTextParagraph> parent) { InteractiveInfo info = getClientDataRecord(spContainer, RecordTypes.InteractiveInfo.typeID); if(info != null && info.getInteractiveInfoAtom() != null){ switch(info.getInteractiveInfoAtom().getAction()){ case InteractiveInfoAtom.ACTION_OLE: return new HSLFObjectShape(spContainer, parent); case InteractiveInfoAtom.ACTION_MEDIA: return new MovieShape(spContainer, parent); default: break; } } ExObjRefAtom oes = getClientDataRecord(spContainer, RecordTypes.ExObjRefAtom.typeID); return (oes != null) ? new HSLFObjectShape(spContainer, parent) : new HSLFPictureShape(spContainer, parent); }
_escherContainer = super.createSpContainer(idx, isChild); setEscherProperty(EscherProperties.PROTECTION__LOCKAGAINSTGROUPING, 0x1000100); setEscherProperty(EscherProperties.FILL__NOFILLHITTEST, 0x10001);
/** * @return UNC or local path to a video file */ @SuppressWarnings("resource") public String getPath(){ ExObjRefAtom oe = getClientDataRecord(RecordTypes.ExObjRefAtom.typeID); int idx = oe.getExObjIdRef(); HSLFSlideShow ppt = getSheet().getSlideShow(); ExObjList lst = (ExObjList)ppt.getDocumentRecord().findFirstOfType(RecordTypes.ExObjList.typeID); if(lst == null) { return null; } Record[] r = lst.getChildRecords(); for (int i = 0; i < r.length; i++) { if(r[i] instanceof ExMCIMovie){ ExMCIMovie mci = (ExMCIMovie)r[i]; ExVideoContainer exVideo = mci.getExVideo(); int objectId = exVideo.getExMediaAtom().getObjectId(); if(objectId == idx){ return exVideo.getPathAtom().getText(); } } } return null; } }
public boolean isAutoPlay(){ AnimationInfo an = getClientDataRecord(RecordTypes.AnimationInfo.typeID); if(an != null){ return an.getAnimationInfoAtom().getFlag(AnimationInfoAtom.Automatic); } return false; }
/** * Create a new <code>Picture</code> * * @param pictureData the picture data * @param parent the parent shape */ public MovieShape(int movieIdx, HSLFPictureData pictureData, ShapeContainer<HSLFShape,HSLFTextParagraph> parent) { super(pictureData, parent); setMovieIndex(movieIdx); }
break; case InteractiveInfoAtom.ACTION_MEDIA: shape = new MovieShape(spContainer, parent); break; default:
/** * Create a new <code>Picture</code> * * @param pictureData the picture data */ public MovieShape(int movieIdx, HSLFPictureData pictureData){ super(pictureData, null); setMovieIndex(movieIdx); setAutoPlay(true); }
public boolean isAutoPlay(){ AnimationInfo an = (AnimationInfo)getClientDataRecord(RecordTypes.AnimationInfo.typeID); if(an != null){ return an.getAnimationInfoAtom().getFlag(AnimationInfoAtom.Automatic); } return false; }
/** * Assign a movie to this shape * * @see org.apache.poi.hslf.usermodel.SlideShow#addMovie(String, int) * @param idx the index of the movie */ public void setMovieIndex(int idx){ OEShapeAtom oe = (OEShapeAtom)getClientDataRecord(RecordTypes.OEShapeAtom.typeID); oe.setOptions(idx); AnimationInfo an = (AnimationInfo)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); } }
/** * 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); } }