/** * Check if a given shape is associated with a sound. * @return 0-based reference to a sound in the sound collection * or -1 if the shape is not associated with a sound */ protected static int getSoundReference(HSLFShape shape){ int soundRef = -1; //dive into the shape container and search for InteractiveInfoAtom InteractiveInfoAtom info = shape.getClientDataRecord(RecordTypes.InteractiveInfo.typeID); if (info != null && info.getAction() == InteractiveInfoAtom.ACTION_MEDIA) { soundRef = info.getSoundRef(); } return soundRef; } }
private static void find(Record[] records, ExObjList exobj, List out){ for (int i = 0; i < records.length; i++) { //see if we have InteractiveInfo in the textrun's records if( records[i] instanceof InteractiveInfo){ InteractiveInfo hldr = (InteractiveInfo)records[i]; InteractiveInfoAtom info = hldr.getInteractiveInfoAtom(); int id = info.getHyperlinkID(); ExHyperlink linkRecord = exobj.get(id); if (linkRecord != null){ Hyperlink link = new Hyperlink(); link.title = linkRecord.getLinkTitle(); link.address = linkRecord.getLinkURL(); link.type = info.getAction(); if (++i < records.length && records[i] instanceof TxInteractiveInfoAtom){ TxInteractiveInfoAtom txinfo = (TxInteractiveInfoAtom)records[i]; link.startIndex = txinfo.getStartIndex(); link.endIndex = txinfo.getEndIndex(); } out.add(link); } } } } }
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); }
OEShapeAtom oes = (OEShapeAtom)getClientDataRecord(spContainer, RecordTypes.OEShapeAtom.typeID); if(info != null && info.getInteractiveInfoAtom() != null){ switch(info.getInteractiveInfoAtom().getAction()){ case InteractiveInfoAtom.ACTION_OLE: shape = new OLEShape(spContainer, parent);