Java 类net.sf.jasperreports.engine.JRPrintAnchorIndex 实例源码

项目:PDFReporter-Studio    文件:ViewerCanvas.java   
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;
    }
}
项目:jasperreports    文件:ReadOnlyPartJasperPrint.java   
@Override
public synchronized Map<String,JRPrintAnchorIndex> getAnchorIndexes()
{
    return parentJasperPrint.getAnchorIndexes();
}