private void handleHyperlinkClick() { switch (currentLink.getHyperlinkTypeValue()) { case REFERENCE: case REMOTE_ANCHOR: case REMOTE_PAGE: case CUSTOM: notifyHyperlinkListeners(currentLink); break; case LOCAL_ANCHOR: Map<String, JRPrintAnchorIndex> anchorIndexes = rViewer.getReport().getAnchorIndexes(); JRPrintAnchorIndex indx = anchorIndexes.get(currentLink.getHyperlinkAnchor()); if (indx == null) return; if (indx.getPageIndex() != rViewer.getPageIndex()) rViewer.setPageIndex(indx.getPageIndex()); if (reportImage != null) { JRPrintElement p = indx.getElement(); setScrollBarSelection(getHorizontalBar(), (int) (p.getX() * zoom)); setScrollBarSelection(getVerticalBar(), (int) (p.getY() * zoom)); repaint(); } break; case LOCAL_PAGE: rViewer.setPageIndex(currentLink.getHyperlinkPage().intValue() - 1); break; } }
@Override public synchronized Map<String,JRPrintAnchorIndex> getAnchorIndexes() { return parentJasperPrint.getAnchorIndexes(); }