@Override public void linkToNextSlide() { InteractiveInfoAtom iia = info.getInteractiveInfoAtom(); iia.setAction(InteractiveInfoAtom.ACTION_JUMP); iia.setJump(InteractiveInfoAtom.JUMP_NEXTSLIDE); iia.setHyperlinkType(InteractiveInfoAtom.LINK_NextSlide); linkToDocument(1,-1,"NEXT",0x10); }
@Override public void linkToPreviousSlide() { InteractiveInfoAtom iia = info.getInteractiveInfoAtom(); iia.setAction(InteractiveInfoAtom.ACTION_JUMP); iia.setJump(InteractiveInfoAtom.JUMP_PREVIOUSSLIDE); iia.setHyperlinkType(InteractiveInfoAtom.LINK_PreviousSlide); linkToDocument(1,-1,"PREV",0x10); }
@Override public void linkToFirstSlide() { InteractiveInfoAtom iia = info.getInteractiveInfoAtom(); iia.setAction(InteractiveInfoAtom.ACTION_JUMP); iia.setJump(InteractiveInfoAtom.JUMP_FIRSTSLIDE); iia.setHyperlinkType(InteractiveInfoAtom.LINK_FirstSlide); linkToDocument(1,-1,"FIRST",0x10); }
@Override public void linkToLastSlide() { InteractiveInfoAtom iia = info.getInteractiveInfoAtom(); iia.setAction(InteractiveInfoAtom.ACTION_JUMP); iia.setJump(InteractiveInfoAtom.JUMP_LASTSLIDE); iia.setHyperlinkType(InteractiveInfoAtom.LINK_LastSlide); linkToDocument(1,-1,"LAST",0x10); }
@Override public void linkToEmail(String emailAddress) { InteractiveInfoAtom iia = info.getInteractiveInfoAtom(); iia.setAction(InteractiveInfoAtom.ACTION_HYPERLINK); iia.setJump(InteractiveInfoAtom.JUMP_NONE); iia.setHyperlinkType(InteractiveInfoAtom.LINK_Url); exHyper.setLinkURL("mailto:"+emailAddress); exHyper.setLinkTitle(emailAddress); exHyper.setLinkOptions(0x10); }
@Override public void linkToUrl(String url) { InteractiveInfoAtom iia = info.getInteractiveInfoAtom(); iia.setAction(InteractiveInfoAtom.ACTION_HYPERLINK); iia.setJump(InteractiveInfoAtom.JUMP_NONE); iia.setHyperlinkType(InteractiveInfoAtom.LINK_Url); exHyper.setLinkURL(url); exHyper.setLinkTitle(url); exHyper.setLinkOptions(0x10); }
@Override public void linkToSlide(Slide<HSLFShape,HSLFTextParagraph> slide) { assert(slide instanceof HSLFSlide); HSLFSlide sl = (HSLFSlide)slide; int slideNum = slide.getSlideNumber(); String alias = "Slide "+slideNum; InteractiveInfoAtom iia = info.getInteractiveInfoAtom(); iia.setAction(InteractiveInfoAtom.ACTION_HYPERLINK); iia.setJump(InteractiveInfoAtom.JUMP_NONE); iia.setHyperlinkType(InteractiveInfoAtom.LINK_SlideNumber); linkToDocument(sl._getSheetNumber(),slideNum,alias,0x30); }
infoAtom.setAction(InteractiveInfoAtom.ACTION_JUMP); infoAtom.setJump(InteractiveInfoAtom.JUMP_FIRSTSLIDE); infoAtom.setHyperlinkType(InteractiveInfoAtom.LINK_FirstSlide); break; case Hyperlink.LINK_LASTSLIDE: infoAtom.setAction(InteractiveInfoAtom.ACTION_JUMP); infoAtom.setJump(InteractiveInfoAtom.JUMP_LASTSLIDE); infoAtom.setHyperlinkType(InteractiveInfoAtom.LINK_LastSlide); break; case Hyperlink.LINK_NEXTSLIDE: infoAtom.setAction(InteractiveInfoAtom.ACTION_JUMP); infoAtom.setJump(InteractiveInfoAtom.JUMP_NEXTSLIDE); infoAtom.setHyperlinkType(InteractiveInfoAtom.LINK_NextSlide); break; case Hyperlink.LINK_PREVIOUSSLIDE: infoAtom.setAction(InteractiveInfoAtom.ACTION_JUMP); infoAtom.setJump(InteractiveInfoAtom.JUMP_PREVIOUSSLIDE); infoAtom.setHyperlinkType(InteractiveInfoAtom.LINK_PreviousSlide); break; case Hyperlink.LINK_URL: infoAtom.setAction(InteractiveInfoAtom.ACTION_HYPERLINK); infoAtom.setJump(InteractiveInfoAtom.JUMP_NONE); infoAtom.setHyperlinkType(InteractiveInfoAtom.LINK_Url); break;
/** * * Assigns a hyperlink to this text shape * * @param linkId id of the hyperlink, @see org.apache.poi.hslf.usermodel.SlideShow#addHyperlink(Hyperlink) * @param beginIndex the beginning index, inclusive. * @param endIndex the ending index, exclusive. * @see org.apache.poi.hslf.usermodel.SlideShow#addHyperlink(Hyperlink) */ public void setHyperlink(int linkId, int beginIndex, int endIndex){ //TODO validate beginIndex and endIndex and throw IllegalArgumentException InteractiveInfo info = new InteractiveInfo(); InteractiveInfoAtom infoAtom = info.getInteractiveInfoAtom(); infoAtom.setAction(InteractiveInfoAtom.ACTION_HYPERLINK); infoAtom.setHyperlinkType(InteractiveInfoAtom.LINK_Url); infoAtom.setHyperlinkID(linkId); _txtbox.appendChildRecord(info); TxInteractiveInfoAtom txiatom = new TxInteractiveInfoAtom(); txiatom.setStartIndex(beginIndex); txiatom.setEndIndex(endIndex); _txtbox.appendChildRecord(txiatom); }
InteractiveInfoAtom infoAtom = info.getInteractiveInfoAtom(); infoAtom.setAction(InteractiveInfoAtom.ACTION_MEDIA); infoAtom.setHyperlinkType(InteractiveInfoAtom.LINK_NULL);
/** * 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; }