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

项目:openbravo-pos    文件:JRViewer300.java   
public String getToolTipText(MouseEvent event)
{
    String tooltip = null;
    JRPrintImageAreaHyperlink imageMapArea = getImageMapArea(event);
    if (imageMapArea != null)
    {
        tooltip = getHyperlinkTooltip(imageMapArea.getHyperlink());
    }

    if (tooltip == null)
    {
        tooltip = super.getToolTipText(event);
    }

    return tooltip;
}
项目:openbravo-pos    文件:JRViewer300.java   
protected JRPrintImageAreaHyperlink getImageMapArea(int x, int y)
{
    JRPrintImageAreaHyperlink image = null;
    if (imageAreaHyperlinks != null)
    {
        for (ListIterator it = imageAreaHyperlinks.listIterator(imageAreaHyperlinks.size()); image == null && it.hasPrevious();)
        {
            JRPrintImageAreaHyperlink area = (JRPrintImageAreaHyperlink) it.previous();
            if (area.getArea().containsPoint(x, y))
            {
                image = area;
            }
        }
    }
    return image;
}
项目:jasperreports    文件:JRViewerPanel.java   
@Override
public String getToolTipText(MouseEvent event)
{
    String tooltip = null;
    JRPrintImageAreaHyperlink imageMapArea = getImageMapArea(event);
    if (imageMapArea != null)
    {
        tooltip = getHyperlinkTooltip(imageMapArea.getHyperlink());
    }

    if (tooltip == null)
    {
        tooltip = super.getToolTipText(event);
    }

    return tooltip;
}
项目:jasperreports    文件:JRViewerPanel.java   
protected JRPrintImageAreaHyperlink getImageMapArea(int x, int y)
{
    JRPrintImageAreaHyperlink image = null;
    if (imageAreaHyperlinks != null)
    {
        for (ListIterator<JRPrintImageAreaHyperlink> it = imageAreaHyperlinks.listIterator(imageAreaHyperlinks.size()); image == null && it.hasPrevious();)
        {
            JRPrintImageAreaHyperlink area = it.previous();
            if (area.getArea().containsPoint(x, y))
            {
                image = area;
            }
        }
    }
    return image;
}
项目:PDFReporter-Studio    文件:ViewerCanvas.java   
private void initHypelinks() {
    links.clear();
    if (page == null)
        return;
    List<JRPrintElement> elements = page.getElements();
    if (elements == null)
        return;

    for (JRPrintElement element : elements) {
        if (element instanceof JRPrintImage) {
            Renderable r = ((JRPrintImage) element).getRenderable();
            if (r instanceof ImageMapRenderable) {
                try {
                    List<JRPrintImageAreaHyperlink> hyperlinks = ((ImageMapRenderable) r).getImageAreaHyperlinks(new java.awt.Rectangle(0, 0, element.getWidth(), element.getHeight()));
                    if (hyperlinks != null)
                        links.add(new ImageAreaHyperlink(element.getX(), element.getY(), hyperlinks));
                } catch (JRException e) {
                    throw new RuntimeException(e);
                }
            }
        } else if (element instanceof JRPrintHyperlink && !((JRPrintHyperlink) element).getHyperlinkTypeValue().equals(HyperlinkTypeEnum.NONE))
            links.add(new PrintHyperlink(0, 0, element));
    }
}
项目:nordpos    文件:JRViewer.java   
public String getToolTipText(MouseEvent event)
{
    String tooltip = null;
    JRPrintImageAreaHyperlink imageMapArea = getImageMapArea(event);
    if (imageMapArea != null)
    {
        tooltip = getHyperlinkTooltip(imageMapArea.getHyperlink());
    }

    if (tooltip == null)
    {
        tooltip = super.getToolTipText(event);
    }

    return tooltip;
}
项目:nordpos    文件:JRViewer.java   
protected JRPrintImageAreaHyperlink getImageMapArea(int x, int y)
{
    JRPrintImageAreaHyperlink image = null;
    if (imageAreaHyperlinks != null)
    {
        for (ListIterator<JRPrintImageAreaHyperlink> it = imageAreaHyperlinks.listIterator(imageAreaHyperlinks.size()); image == null && it.hasPrevious();)
        {
            JRPrintImageAreaHyperlink area = it.previous();
            if (area.getArea().containsPoint(x, y))
            {
                image = area;
            }
        }
    }
    return image;
}
项目:OpenbravoPOS    文件:JRViewer300.java   
public String getToolTipText(MouseEvent event)
{
    String tooltip = null;
    JRPrintImageAreaHyperlink imageMapArea = getImageMapArea(event);
    if (imageMapArea != null)
    {
        tooltip = getHyperlinkTooltip(imageMapArea.getHyperlink());
    }

    if (tooltip == null)
    {
        tooltip = super.getToolTipText(event);
    }

    return tooltip;
}
项目:OpenbravoPOS    文件:JRViewer300.java   
protected JRPrintImageAreaHyperlink getImageMapArea(int x, int y)
{
    JRPrintImageAreaHyperlink image = null;
    if (imageAreaHyperlinks != null)
    {
        for (ListIterator it = imageAreaHyperlinks.listIterator(imageAreaHyperlinks.size()); image == null && it.hasPrevious();)
        {
            JRPrintImageAreaHyperlink area = (JRPrintImageAreaHyperlink) it.previous();
            if (area.getArea().containsPoint(x, y))
            {
                image = area;
            }
        }
    }
    return image;
}
项目:openbravo-pos    文件:JRViewer300.java   
public void mouseMoved(MouseEvent e)
{
    JRPrintImageAreaHyperlink imageArea = getImageMapArea(e);
    if (imageArea != null
            && imageArea.getHyperlink().getHyperlinkType() != JRHyperlink.HYPERLINK_TYPE_NONE)
    {
        e.getComponent().setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
    }
    else
    {
        e.getComponent().setCursor(Cursor.getDefaultCursor());
    }
}
项目:openbravo-pos    文件:JRViewer300.java   
public void mouseClicked(MouseEvent e)
{
    JRPrintImageAreaHyperlink imageMapArea = getImageMapArea(e);
    if (imageMapArea != null)
    {
        hyperlinkClicked(imageMapArea.getHyperlink());
    }
}
项目:jasperreports    文件:DrawChartRenderer.java   
/**
 * @deprecated To be removed.
 */
@Override
public List<JRPrintImageAreaHyperlink> renderWithHyperlinks(Graphics2D grx, Rectangle2D rectangle) 
{
    try
    {
        render(grx, rectangle);
    }
    catch (JRException e)
    {
        throw new JRRuntimeException(e);
    }

    return ChartUtil.getImageAreaHyperlinks(chart, chartHyperlinkProvider, grx, rectangle);
}
项目:jasperreports    文件:HtmlExporter.java   
protected void writeImageMap(String imageMapName, JRPrintImage image, List<JRPrintImageAreaHyperlink> imageMapAreas) throws IOException
{
    writer.write("<map name=\"" + imageMapName + "\">\n");

    for (ListIterator<JRPrintImageAreaHyperlink> it = imageMapAreas.listIterator(imageMapAreas.size()); it.hasPrevious();)
    {
        JRPrintImageAreaHyperlink areaHyperlink = it.previous();
        JRPrintHyperlink link = areaHyperlink.getHyperlink();
        JRPrintImageArea area = areaHyperlink.getArea();

        writer.write("  <area shape=\"" + JRPrintImageArea.getHtmlShape(area.getShape()) + "\"");

        writeImageAreaCoordinates(area.getCoordinates());           
        writeImageAreaHyperlink(link);
        writer.write("/>\n");
    }

    if (image.getHyperlinkTypeValue() != HyperlinkTypeEnum.NONE)
    {
        writer.write("  <area shape=\"default\"");
        writeImageAreaCoordinates(new int[]{0, 0, image.getWidth(), image.getHeight()});//for IE
        writeImageAreaHyperlink(image);
        writer.write("/>\n");
    }

    writer.write("</map>\n");
}
项目:jasperreports    文件:JRSimpleImageMapRenderer.java   
/**
 * @deprecated To be removed.
 */
@Override
public List<JRPrintImageAreaHyperlink> renderWithHyperlinks(Graphics2D grx, Rectangle2D rectangle) throws JRException
{
    render(grx, rectangle);

    return areaHyperlinks;
}
项目:jasperreports    文件:SimpleRenderToImageAwareDataRenderer.java   
/**
 * Creates a SVG renderer.
 *
 * @param areaHyperlinks a list of {@link JRPrintImageAreaHyperlink area hyperlinks}
 */
public SimpleRenderToImageAwareDataRenderer(
    byte[] data,
    List<JRPrintImageAreaHyperlink> areaHyperlinks
    )
{
    this.data = data;
    this.areaHyperlinks = areaHyperlinks;
}
项目:jasperreports    文件:BatikRenderer.java   
/**
 * @deprecated To be removed.
 */
@Override
public List<JRPrintImageAreaHyperlink> renderWithHyperlinks(Graphics2D grx, Rectangle2D rectangle) throws JRException
{
    render(grx, rectangle);

    return areaHyperlinks;
}
项目:jasperreports    文件:JRViewerPanel.java   
@Override
public void mouseMoved(MouseEvent e)
{
    JRPrintImageAreaHyperlink imageArea = getImageMapArea(e);
    if (imageArea != null
            && imageArea.getHyperlink().getHyperlinkTypeValue() != HyperlinkTypeEnum.NONE)
    {
        e.getComponent().setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
    }
    else
    {
        e.getComponent().setCursor(Cursor.getDefaultCursor());
    }
}
项目:jasperreports    文件:JRViewerPanel.java   
@Override
public void mouseClicked(MouseEvent e)
{
    JRPrintImageAreaHyperlink imageMapArea = getImageMapArea(e);
    if (imageMapArea != null)
    {
        hyperlinkClicked(imageMapArea.getHyperlink());
    }
}
项目:PDFReporter-Studio    文件:ViewerCanvas.java   
public JRPrintHyperlink getHyperlink(Point point) {
    int x = point.x - originX;
    int y = point.y - originY;

    for (JRPrintImageAreaHyperlink areaHyperlink : imageAreaHyperlinks)
        if (areaHyperlink.getArea().containsPoint(x, y))
            return areaHyperlink.getHyperlink();
    return null;
}
项目:nordpos    文件:JRViewer.java   
public void mouseMoved(MouseEvent e)
{
    JRPrintImageAreaHyperlink imageArea = getImageMapArea(e);
    if (imageArea != null
            && imageArea.getHyperlink().getHyperlinkTypeValue() != HyperlinkTypeEnum.NONE)
    {
        e.getComponent().setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
    }
    else
    {
        e.getComponent().setCursor(Cursor.getDefaultCursor());
    }
}
项目:nordpos    文件:JRViewer.java   
public void mouseClicked(MouseEvent e)
{
    JRPrintImageAreaHyperlink imageMapArea = getImageMapArea(e);
    if (imageMapArea != null)
    {
        hyperlinkClicked(imageMapArea.getHyperlink());
    }
}
项目:OpenbravoPOS    文件:JRViewer300.java   
public void mouseMoved(MouseEvent e)
{
    JRPrintImageAreaHyperlink imageArea = getImageMapArea(e);
    if (imageArea != null
            && imageArea.getHyperlink().getHyperlinkType() != JRHyperlink.HYPERLINK_TYPE_NONE)
    {
        e.getComponent().setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
    }
    else
    {
        e.getComponent().setCursor(Cursor.getDefaultCursor());
    }
}
项目:OpenbravoPOS    文件:JRViewer300.java   
public void mouseClicked(MouseEvent e)
{
    JRPrintImageAreaHyperlink imageMapArea = getImageMapArea(e);
    if (imageMapArea != null)
    {
        hyperlinkClicked(imageMapArea.getHyperlink());
    }
}
项目:openbravo-pos    文件:JRViewer300.java   
protected JRPrintImageAreaHyperlink getImageMapArea(MouseEvent e)
{
    return getImageMapArea((int) (e.getX() / realZoom), (int) (e.getY() / realZoom));
}
项目:jasperreports    文件:DrawChartRendererImpl.java   
@Override
public List<JRPrintImageAreaHyperlink> getImageAreaHyperlinks(Rectangle2D renderingArea) throws JRException
{
    return ChartUtil.getImageAreaHyperlinks(chart, chartHyperlinkProvider, null, renderingArea);
}
项目:jasperreports    文件:ChartUtil.java   
/**
 * 
 */
public static List<JRPrintImageAreaHyperlink> getImageAreaHyperlinks(
    JFreeChart chart,
    ChartHyperlinkProvider chartHyperlinkProvider,
    Graphics2D grx,
    Rectangle2D renderingArea
    )// throws JRException
{
    List<JRPrintImageAreaHyperlink> areaHyperlinks = null;

    if (chartHyperlinkProvider != null && chartHyperlinkProvider.hasHyperlinks())
    {
        ChartRenderingInfo renderingInfo = new ChartRenderingInfo();

        if (grx == null)
        {
            chart.createBufferedImage((int) renderingArea.getWidth(), (int)  renderingArea.getHeight(), renderingInfo);
        }
        else
        {
            chart.draw(grx, renderingArea, renderingInfo);
        }

        EntityCollection entityCollection = renderingInfo.getEntityCollection();
        if (entityCollection != null && entityCollection.getEntityCount() > 0)
        {
            areaHyperlinks = new ArrayList<JRPrintImageAreaHyperlink>(entityCollection.getEntityCount());

            for (@SuppressWarnings("unchecked")
            Iterator<ChartEntity> it = entityCollection.iterator(); it.hasNext();)
            {
                ChartEntity entity = it.next();
                JRPrintHyperlink printHyperlink = chartHyperlinkProvider.getEntityHyperlink(entity);
                if (printHyperlink != null)
                {
                    JRPrintImageArea area = getImageArea(entity);

                    JRPrintImageAreaHyperlink areaHyperlink = new JRPrintImageAreaHyperlink();
                    areaHyperlink.setArea(area);
                    areaHyperlink.setHyperlink(printHyperlink);
                    areaHyperlinks.add(areaHyperlink);
                }
            }
        }
    }

    return areaHyperlinks;
}
项目:jasperreports    文件:DrawChartRenderer.java   
@Override
public List<JRPrintImageAreaHyperlink> getImageAreaHyperlinks(Rectangle2D renderingArea) throws JRException
{
    return ChartUtil.getImageAreaHyperlinks(chart, chartHyperlinkProvider, null, renderingArea);
}
项目:jasperreports    文件:ImageChartRendererFactory.java   
@Override
public Renderable getRenderable(
    JasperReportsContext jasperReportsContext,
    JFreeChart chart, 
    ChartHyperlinkProvider chartHyperlinkProvider,
    Rectangle2D rectangle
    )
{
    int dpi = JRPropertiesUtil.getInstance(jasperReportsContext).getIntegerProperty(Renderable.PROPERTY_IMAGE_DPI, 72);
    double scale = dpi/72d;

    BufferedImage bi = 
        new BufferedImage(
            (int) (scale * (int)rectangle.getWidth()),
            (int) (scale * rectangle.getHeight()),
            BufferedImage.TYPE_INT_ARGB
            );

    List<JRPrintImageAreaHyperlink> areaHyperlinks = null;

    Graphics2D grx = bi.createGraphics();
    try
    {
        grx.scale(scale, scale);

        if (chartHyperlinkProvider != null && chartHyperlinkProvider.hasHyperlinks())
        {
            areaHyperlinks = ChartUtil.getImageAreaHyperlinks(chart, chartHyperlinkProvider, grx, rectangle);
        }
        else
        {
            chart.draw(grx, rectangle);
        }
    }
    finally
    {
        grx.dispose();
    }

    try
    {
        return new SimpleDataRenderer(JRImageLoader.getInstance(jasperReportsContext).loadBytesFromAwtImage(bi, ImageTypeEnum.PNG), areaHyperlinks);
    }
    catch (JRException e)
    {
        throw new JRRuntimeException(e);
    }
}
项目:jasperreports    文件:WrappingImageMapRenderable.java   
@Override
public List<JRPrintImageAreaHyperlink> renderWithHyperlinks(Graphics2D grx,
        Rectangle2D rectangle) throws JRException {
    return imageMapRenderer.renderWithHyperlinks(grx, rectangle);
}
项目:jasperreports    文件:WrappingImageMapRenderable.java   
@Override
public List<JRPrintImageAreaHyperlink> getImageAreaHyperlinks(
        Rectangle2D renderingArea) throws JRException {
    return imageMapRenderer.getImageAreaHyperlinks(renderingArea);
}
项目:jasperreports    文件:WrappingDataToGraphics2DRenderer.java   
@Override
public List<JRPrintImageAreaHyperlink> getImageAreaHyperlinks(Rectangle2D renderingArea) throws JRException
{
    return areaHyperlinksRenderer == null ? null : areaHyperlinksRenderer.getImageAreaHyperlinks(renderingArea);
}
项目:jasperreports    文件:AbstractSvgDataToGraphics2DRenderer.java   
@Override
public List<JRPrintImageAreaHyperlink> getImageAreaHyperlinks(Rectangle2D renderingArea) throws JRException
{
    return areaHyperlinks;
}
项目:jasperreports    文件:JRSimpleImageMapRenderer.java   
/**
 * 
 */
public JRSimpleImageMapRenderer(byte[] imageData, List<JRPrintImageAreaHyperlink> areaHyperlinks) 
{
    super(imageData);
    this.areaHyperlinks = areaHyperlinks;
}
项目:jasperreports    文件:JRSimpleImageMapRenderer.java   
@Override
public List<JRPrintImageAreaHyperlink> getImageAreaHyperlinks(Rectangle2D renderingArea) throws JRException 
{
    return areaHyperlinks;
}
项目:jasperreports    文件:WrappingSvgDataToGraphics2DRenderer.java   
@Override
public List<JRPrintImageAreaHyperlink> getImageAreaHyperlinks(Rectangle2D renderingArea) throws JRException
{
    return areaHyperlinksRenderer == null ? super.getImageAreaHyperlinks(renderingArea) : areaHyperlinksRenderer.getImageAreaHyperlinks(renderingArea);
}
项目:jasperreports    文件:SimpleDataRenderer.java   
/**
 * 
 */
public SimpleDataRenderer(byte[] data, List<JRPrintImageAreaHyperlink> areaHyperlinks) 
{
    this.data = data;
    this.areaHyperlinks = areaHyperlinks;
}
项目:jasperreports    文件:SimpleDataRenderer.java   
@Override
public List<JRPrintImageAreaHyperlink> getImageAreaHyperlinks(Rectangle2D renderingArea) throws JRException 
{
    return areaHyperlinks;
}
项目:jasperreports    文件:SimpleRenderToImageAwareDataRenderer.java   
@Override
public List<JRPrintImageAreaHyperlink> getImageAreaHyperlinks(Rectangle2D renderingArea) throws JRException
{
    return areaHyperlinks;
}
项目:jasperreports    文件:BatikRenderer.java   
protected BatikRenderer(List<JRPrintImageAreaHyperlink> areaHyperlinks)
{
    this.areaHyperlinks = areaHyperlinks;
}
项目:jasperreports    文件:BatikRenderer.java   
@Override
public List<JRPrintImageAreaHyperlink> getImageAreaHyperlinks(Rectangle2D renderingArea) throws JRException
{
    return areaHyperlinks;
}